| Bug #8006 | readLeftOver causing problems with HTTP_Server |
| Submitted: |
2006年06月26日 16:28 UTC |
| From: |
erudd at netfor dot com |
Assigned: |
cweiske |
| Status: |
Closed |
Package: |
Net_Server (version 1.0.0) |
| PHP Version: |
Irrelevant |
OS: |
| Roadmaps: |
(Not assigned) |
[2006年06月26日 16:28 UTC] erudd at netfor dot com
(Edward Rudd)
Description:
------------
the new readLeftOver feature in Net_Server 1.0.0 is causing problems with HTTP_Server when using (at least) the sequential driver. The problem that is occuring is the "end" of a previous request is appearing in the beginning of the next request and causing HTTP_Server to fail to find the initial GET line of the HTTP request as any trailing \r\ns from the previous request appear in the beginning of the new un-related request.
What is the intended reasoning for the readLeftOver feature??
And shouldn't it be cleared upon client disconnect?
Comments
[2006年06月26日 17:02 UTC] erudd at netfor dot com
Patch to fix of of the underlying issues. The length of readEndCharacter (which with HTTP_Server is 4 characters not 1). was not taken into account when appending the endCharacter to $data. also when checking for leftover parts, readEndCharacter was not taken into account at all.
--- Net_Server-1.0.0/Server/Driver.php.orig 2006年06月26日 12:57:38.000000000 -0400
+++ Net_Server-1.0.0/Server/Driver.php 2006年06月26日 12:57:49.000000000 -0400
@@ -232,8 +233,8 @@
if ($posEndChar === false) {
$data .= $buf;
} else {
- $data .= substr($buf, 0, $posEndChar + 1);
- if ($posEndChar < strlen($buf)) {
+ $data .= substr($buf, 0, $posEndChar + strlen($this->readEndCharacter));
+ if (($posEndChar + strlen($this->readEndCharacter)) < strlen($buf)) {
$this->_readLeftOver = substr($buf, $posEndChar + 1);
}
break;
[2006年06月27日 10:02 UTC] User who submitted this comment has not confirmed identityIf you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE. Write a message to pear-dev@lists.php.net
to request the confirmation link. All bugs/comments/patches associated with this
email address will be deleted within 48 hours if the account request is not confirmed!
[2006年06月27日 10:42 UTC] User who submitted this comment has not confirmed identityIf you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE. Write a message to pear-dev@lists.php.net
to request the confirmation link. All bugs/comments/patches associated with this
email address will be deleted within 48 hours if the account request is not confirmed!
[2006年06月27日 14:51 UTC] erudd at netfor dot com
Thanks. CVS HEAD works.
When the 1.0.1 release gets out I can finally drop all my "kludges, patches and workarounds" in my code.