You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Norman Tuttle <nt...@photon.poly.edu> on 2003/10/21 20:44:31 UTC

New Flood diff to handle "100 continue" when in first chunk, and next packet available [Ref A5]

The new patch is the first step towards Flood handling "100 continue" 
responses. If such response is found in the first chunk read, and the 
next response is also available there already, then we read past the 100 
message and read in the next message's headers and body if available.

Please evaluate the attached diff file and incorporate into the 
flood_socket_keepalive.c file in CVS. I have made the diff off the build 
1.1 version and not off my own previous changes since this is an 
independent change.

-Norman Tuttle, developer, OpenDemand Systems, ntuttle@opendemand.com



Redo for diff: Flood: New patch to flood_socket_keepalive.c fixes keepalive protocol bugs [Ref A7]

Posted by Norman Tuttle <nt...@photon.poly.edu>.
Here is the patch again for flood_socket_keepalive relating to the
protocol, diff done correctly this time. The patches fix actual client
issues we have had with sites, and is explained in what I previously
wrote to the group, quoted below (note that it does not touch issues
related to chunking, which I also mentioned in that post, other than to
replace the assert() with something more user-friendly):

-Norman Tuttle, developer, OpenDemand Systems ntuttle@opendemand.com

On Wed, 22 Oct 2003, Norman Tuttle wrote:

> The new diff available for Flood fixes protocol errors for keepalive (file
> flood_socket_keepalive.c, function keepalive_recv_resp()) mainly by
> assimilating the functionality of the wantresponse and !wantresponse modes
> within the readback operations, and maintaining whatever worked correctly.
> Also the algorithm for reading a decimal value within the above function
> was simplified (we found cases where what was replaced did not work), as
> was the routine for reading a hexadecimal value (this being in the
> function keepalive_read_chunk_size()), the same reason for its replacement
> applying.

In addition, I applied some fixes which would yield a more correct byte
count, and replaced the assert() with something more user-friendly.
Even after these changes, there are some gaping holes in the logic
connected with chunked transfer protocol. Besides not being applied in the
"wantresponse" case, it would clearly be unable to field a chunk size
which was greater than the MAX_DOC_LENGTH.

Flood patch: Fixes hangup bug with SSL and generic sockets [Ref A8]

Posted by Norman Tuttle <nt...@photon.poly.edu>.
Flood developers:

I discovered an error where my system would simply lock up (with maximum
CPU utilization from Flood.exe!) while trying to access an https page,
which is using a server-side certificate, when running Flood from Windows
(did not experience this problem in either Linux. My current SSL package
in use there is openssl-0.9.7b. I did some debugging, and found that there
is a spurious SSL error occurring (SSL_ERROR_SYSCALL). When associated
with a non-zero errno (coming from somewhere in the ssl_open_socket()
routine), this generated an APR_EGENERAL return for ssl_read_socket()
(ERR_print_errors_fp() did not provide any output in this case). Then the
calling code in flood_socket_generic.c apparently does not handle this
error well. I intend to send a follow-up email both to this group and to
the openssl group regarding this issue, but I have a fix available since
the packet is actually coming back successfully (so I am treating this as
a ghost error for now).

The patch I am providing (attached here) to fix this bug and stop the
lock-up affects two files:

flood_net_ssl.c (ssl_read_socket() function): Sets errno=0 before doing
the SSL read so that the check on errno generates an APR_EOF.
flood_socket_generic.c (generic_recv_resp() function): Handle errors more
robustly by not exiting a while loop under any non-APR_SUCCESS status
condition. The function exit, however, will not record an APR_EOF code as
an error since it is the usual way for ending the function.

flood_socket_keepalive.c probably needs similar work which will be posted
as a separate diff in the near future.

-Norman Tuttle, developer, OpenDemand Systems ntuttle@opendemand.com




Flood: New patch to flood_socket_keepalive.c fixes keepalive protocol bugs [Ref A7], Question on Chunking Protocol

Posted by Norman Tuttle <nt...@photon.poly.edu>.
The new diff available for Flood fixes protocol errors for keepalive (file
flood_socket_keepalive.c, function keepalive_recv_resp()) mainly by
assimilating the functionality of the wantresponse and !wantresponse modes
within the readback operations, and maintaining whatever worked correctly.
Also the algorithm for reading a decimal value within the above function
was simplified (we found cases where what was replaced did not work), as
was the routine for reading a hexadecimal value (this being in the
function keepalive_read_chunk_size()), the same reason for its replacement
applying.

Since this diff is independent of other changes made recently, I have done
it off the original file in CVS/Flood 1.1, which I have in my local
directory c:\flood-1.1

Norman Tuttle, developer, OpenDemand Systems, ntuttle@opendemand.com

PS: In a comparison between the 2 modes mentioned above (wantresponse and
!wantresponse), the Chunked Transfer-Encoding method of reading of the
body is absent from the wantresponse pathway. I was wondering whether that
was inadvertent, and if so, it looks like we will have to add this
functionality as well or our readback of data in that case will be
incomplete.