View Single Post
Old 07-08-2011, 10:54 AM   #116
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,699
Karma: 205039118
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by chaley View Post
Does your PHP setup use cookies for session management, or does it use query strings and URL rewriting to pass the session token? If the latter, then there might be a problem with the kindle not passing the query string back when doing a download. This would cause the server to go into a login cycle, certainly preventing the download. I can see this happening if the kindle is being smart, noticing the extension on the URL, and doing something special.
My PHP is set up to use cookies.

Quote:
Originally Posted by chaley View Post
Another thought, and one that is embarrassing. When someone logs in, the utility function dprint is called to log the event. This is the only place that dprint is used for a non-exceptional condition. For historical reasons (my debugging), dprint does a check on PHP_OS, and if it isn't "linux", it writes the log line to C:/php_errors.txt. I can imagine this causing some errors and, even worse, write something to the HTTP stream. The latter would prevent writing the headers needed for downloads to succeed, explaining the problem you see. Try commenting out the body of dprint (utilities.php, at the end) and see if the weird errors and/or the kindle problem go away.
Commenting out the body of the dprint function made no noticeable difference.

However, after tweaking some of the FastCGI parameters for my Nginx server... I seem to have everything working fine, now. Including the internal authentication and file downloads (with the dprint function). Bumping up various fastcgi timeouts, buffers, busy buffers, and adjusting the temp file write size seemed to do the trick.

I'll let you know what else I run into.
DiapDealer is offline   Reply With Quote