View Single Post
Old 07-08-2011, 02:20 AM   #113
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,772
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by DiapDealer View Post
Do you have a good way to capture headers on the Kindle? That's not something I've tried but it would definitely help the debugging process.
Absolutely no clue.
Quote:
Anyway, I think I narrowed my problem down to the embedded session authentication. Once I disabled authentication (in the config_local.php file), I was able to download books to the Kindle just fine. So I just set up authentication in the web server conf and everything is golden.

That may be related to PHP being run as FastCGI vs Module. I was getting weird permission errors in my server logs until I turned off the embedded authentication. Now I'm not getting any errors.
Session management was one thing I was/am concerned about when running under flavors of CGI. That said, it must be working if you can search and sort, so I am confused.

I purposely didn't use HTTP authentication to avoid problems with devices that don't handle it well. As far as the kindle is concerned, login is just another page with some form elements on it.

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.

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.
Quote:
On a side note... sometime in the twenty minutes or so that my website was wide open for testing purposes, google started crawling my library. I couldn't pay that spider to crawl my websites any other time.
The street view van was also just outside...
chaley is offline   Reply With Quote