Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.3.0

Bug #16149 Multiple requests through a single object errors
Submitted: 2009-04-24 23:27 UTC
From: jstump Assigned: avb
Status: Closed Package: HTTP_Request2 (version 0.3.0)
PHP Version: 5.2.9 OS: OS X
Roadmaps: 0.4.0    
Subscription  


 [2009-04-24 23:27 UTC] jstump (Joe Stump)
Description: ------------ I'm having trouble reproducing this, but if you run the unit test suite for my new Services_ShortURL package (http://github.com/joestump/services_shorturl/tree/master) with the socket adapter I get malformed requests on expanding a TinyURL after a few requests. Switching to the curl adapter fixes it. I did some poking around, but couldn't track it down.

Comments

 [2009-05-03 02:37 UTC] avb (Alexey Borzov)
-Status: Open +Status: Verified
Thanks, running the tests (after removing hardcoded Curl adapter) indeed triggers that error. Looks like the problem is with persistent connection (Keep-Alive) to tinyurl.com
 [2009-05-03 03:09 UTC] avb (Alexey Borzov)
-Status: Verified +Status: Analyzed
Looks like tinyurl.com has a short keep-alive timeout, so while we are busy doing requests to other servers it closes the connection. And then Socket adapter tries to reuse the connected socket without bothering to check whether it is still connected. It then gets an empty string from disconnected socket triggering the "Malformed response" error. Hard to debug, indeed: doing requests to tinyurl.com only will not trigger the error! :)
 [2009-05-03 17:18 UTC] avb (Alexey Borzov)
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: avb
Fixed in release 0.4.0