Opened 7 years ago

Closed 7 years ago

#5915 defect closed worksforme (worksforme)

transfer encoding chunked

Reported by: rain.ning Owned by:
Priority: normal Milestone:
Component: web Keywords: chunked encoding
Cc: jknight Branch:

Description (last modified by Jean-Paul Calderone)

I am simulating chunked encoding with the code below. Twisted web server can successfully chunked transfer the content, however, the last chunk (0 + CRLF) is not sent, at least from the tcpdump, I don't see it.

f = open(DOC_ROOT + "/" + request.prepath[0] + "/" + request.prepath[1], 'rb')
while 1:
    chunk_size = random.randint(100, 1000)
    chunk_data =
    if len(chunk_data) != chunk_size:
        chunk_size = len(chunk_data)
    if chunk_size == 0:
        #comment the line below or not, does not change the result
        #request.write('0' + CRLF) 

Attachments (2) (844 bytes) - added by rain.ning 7 years ago.
code in description was in a mess.
twisted-chunked-encoding.rpy (911 bytes) - added by Jean-Paul Calderone 7 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 7 years ago by DefaultCC Plugin

Cc: jknight added

Changed 7 years ago by rain.ning

Attachment: added

code in description was in a mess.

comment:2 Changed 7 years ago by Jean-Paul Calderone

Description: modified (diff)

Fix description markup

comment:3 Changed 7 years ago by Jean-Paul Calderone

Resolution: worksforme
Status: newclosed

Thanks for your interest. I can't reproduce a problem with this code. A complete, working example based on yours is attached. Please re-open if you can demonstrate the problem with a runnable example. Thanks again.

Changed 7 years ago by Jean-Paul Calderone

Note: See TracTickets for help on using tickets.