Le 07/06/2012 15:12, Jānis a écrit :
HTTP debugging proxy Fiddler informs that, for example, the HTTP
header says the content length is 39942 bytes, however, the actual
lengh is 32768, and in the text view I can clearly see that the
response, which is JSON code, gets cut off unexpectedly.


32768 is 2^15, this is suspicious.

I have had a similar problem in Werkzeug, but it was with file uploads, not responses.

It was because werkzeug.datastructures.FileStorage.save has a default buffer size of 16k. I was saving to a file object, and reading that object without flushing the writes first. So the files would end up being 16k, 32k or sometimes 48k, with end missing. However, your problem is likely not the same, only similar.

Can you track down the code that generates the response that is cut off? Is there a WSGI middleware between that code and Werkzeug’s server?

I see no such buffer in Werkzeug’s server itself:
https://github.com/mitsuhiko/werkzeug/blob/master/werkzeug/serving.py#L105

Regards,
--
Simon Sapin


--
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pocoo-libs?hl=en.

Reply via email to