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

Bug #17031 Erroneous Keep-Alive assertions
Submitted: 2010-01-25 16:59 UTC
From: nomoa Assigned: avb
Status: Closed Package: HTTP_Request2
PHP Version: 5.2.5 OS: ubuntu 64 (PHP5.2.10-2ubuntu6.4)
Roadmaps: 2.0.0beta1    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 14 + 6 = ?

 
 [2010-01-25 16:59 UTC] nomoa (David Causse)
Description: ------------ Hi, In HTTP/Request.php the response evaluation at line 742 say that Keep-Alive can only be used when (at option): - content-length is set - trasnfer-encoding is chunked I think there is another option to add : - HTTP response code is 204 I changed Request.php to this : $keepAlive = (isset($this->_response->_headers['content-length']) || (isset($this->_response->_headers['transfer-encoding']) && strtolower($this->_response->_headers['transfer-encoding']) == 'chunked') || $this->_response->_code == 204); and I can have only one socket created for my conversation. Test script: --------------- On a JAX-RS enabled java serveur (JBoss RESTEasy) when you do a DELETE /path query the server response is : DBG: Envoie de la requête DELETE sur http://localhost:8080/spotter-ws/api/traduction/services/traduction-synchro/132 DBG: Réponse à la requête: DBG: CODE HTTP 204 DBG: server = Apache-Coyote/1.1 DBG: x-powered-by = Servlet 2.5; JBoss-5.0/JBossWeb-2.1 DBG: date = Mon, 25 Jan 2010 11:42:14 GMT and no response body. Expected result: ---------------- The keep-alive connection should be kept alive. (with modified Request.php file) techno@spotter-dclnx:~$ netstat -t tcp -n | grep 8080 tcp 0 0 127.0.0.1:50476 127.0.0.1:8080 TIME_WAIT techno@spotter-dclnx:~$ Actual result: -------------- The keep-alive connection is closed. (with unmodified Request.php file) techno@spotter-dclnx:~$ netstat -t tcp -n | grep 8080 tcp 0 0 127.0.0.1:50469 127.0.0.1:8080 TIME_WAIT tcp 0 0 127.0.0.1:50470 127.0.0.1:8080 TIME_WAIT tcp 0 0 127.0.0.1:50468 127.0.0.1:8080 TIME_WAIT tcp 0 0 127.0.0.1:50467 127.0.0.1:8080 TIME_WAIT tcp 0 0 127.0.0.1:50471 127.0.0.1:8080 TIME_WAIT tcp 0 0 127.0.0.1:50465 127.0.0.1:8080 TIME_WAIT tcp 0 0 127.0.0.1:50472 127.0.0.1:8080 TIME_WAIT

Comments

 [2011-02-20 01:24 UTC] avb (Alexey Borzov)
-Status: Open +Status: Assigned -Package: HTTP_Request +Package: HTTP_Request2 -Assigned To: +Assigned To: avb
Moving to HTTP_Request2
 [2011-02-26 00:37 UTC] avb (Alexey Borzov)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.