Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » Getfile mysql_close()?
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Return to the default flat view Create a new topic Submit Reply
Getfile mysql_close()? [message #164693] Mon, 28 February 2011 23:12 Go to previous message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Senior Member
add to buddy list
ignore all messages by this user
If you are grabbing a large file attachment with getfile.php.t it will keep the current mysql connection in sleepmode until the file finishes downloading. This might make you reach your max_connections or max_user_connections in mysql since the processess will sit in sleepmode until the script finishes.

I tried adding a db_close() function to db.inc but it seems I cannot call that from getfile.php.t.

Do I have to make those functions global somehow, or should I define that function somewhere else? I figured it would be correct to do it in db.inc since we have the fud_sql_connect variable defined there, so that we can easier access the proper string for mysql_close().

I tried running mysql_close() with the global variables in it, but that didn't close the connection, shouldn't that work?

IE - close the mysql connection just before we run @readfile($r[2]); and that would hopefully not keep a connection open while the user has the run/save/cancel box open (or while they download the file)

Anyone have any suggestions, other than raising the max_connections in mysql.

[Message index]
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Setting Notification w/body as a per-user option and editing email template
Next Topic: two ideas - Bookmarks and Taxonomy
Goto Forum:

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Jul 23 09:46:15 EDT 2018

Total time taken to generate the page: 0.00727 seconds