A few things to keep in mind here is that when it comes to POST requests:

1. using persisent-connections (keepalive) is broken because of
long-standing bugs in nearly every browser
2. the bug in most browsers is that they will often send the body
*plus* 2 bytes (CR and LF). Depending on a variety of factors, these
last two bytes may be send in a different write(2) call by the client
and may not end up in the same packet as the last packat of the body.
Consequently, if you (the server) only read CONTENT-LENGTH bytes,
produce a response, and then close the socket you will cause a TCP
reset to be sent to the client because there is unread data in your
read buffer.

The safest thing to do is to read content-length "plus a little bit".
You do *not*, however, provide that extra data, if any, to any
consumers.


-- 
Jon

_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to