Message60570
If one has a non-blocking socket, 'sock', and uses
'sock.makefile()' to create file-like object out of it,
there exists the possibility (even probability) of data
loss in the event of an EAGAIN error.
The code that comprises _fileobject in socket does not
try to catch EAGAIN. In the event that the read()
operation does not encounter EOF, but *has* read data
(and then gets an EAGAIN) such as when there is less
than 8KB of data to read, the socket.error traceback is
handed back to the caller of read and the read data is
discarded. This is horrible. The _fileobject read
routine (and probably write, too) should catch
socket.error and check it for EAGAIN, and in that case,
return what it has already read (if anything). |
|
Date |
User |
Action |
Args |
2008-01-20 09:57:11 | admin | link | issue1038591 messages |
2008-01-20 09:57:11 | admin | create | |
|