Tcl Source Code

View Ticket
Login
Ticket UUID: 2953175
Title: Premature EOF on channel with zlib
Type: Bug Version: obsolete: 8.6b1.1
Submitter: pspjuth Created on: 2010-02-16 23:48:13
Subsystem: 57. zlib Assigned To: dkf
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2010-02-22 21:39:55
Resolution: Duplicate Closed By: ferrieux
    Closed on: 2010-02-22 14:39:55
Description:
Looking at intermittent failures in http11-2.6 to http11-2.8, I got
it distilled to the attached test case.

Some combination of:
The server closing the socket before the client starts reading.
Adding zlib by "zlib push".
Gives a premature eof on the channel.

In the script, eof is signalled before all data is received.
If the 500 ms wait is removed, allowing the reader
to start before the server closes, it works.

The failures in http11-2.6 to 8 happens when the httpd
server process is fast enough to close the socket before
the client process starts to read data.
User Comments: ferrieux added on 2010-02-22 21:39:55:

allow_comments - 1

ferrieux added on 2010-02-22 21:39:19:
s/sses/ssed
fscking iPhone hard-to-disable localized spell-checker !

ferrieux added on 2010-02-19 01:01:32:
First note that this is kept track of in 2762041.
Then the investigation there shows that the problem arises when a single read/recv() contains both uncompressed and compresses data . Clearly in that case the buffered zlib'd input is not properly passes down the stack.

dkf added on 2010-02-17 17:27:41:
While I quite agree that it is probably a problem with the zlib channel code, I don't know what the problem is. But whatever *is* the problem, it's either in ZlibTransformInput or it's due to some issue with a channel that needs multiple events delivering in order to drain the already-read buffers. Or maybe it is even due to trying to read the header when nothing has been received yet at all. I don't know.

pspjuth added on 2010-02-17 06:48:14:

File Added - 363217: testeof.tcl

Attachments: