[issue2073] asynchat push always sends 512 bytes (ignoring ac_out_buffer_size)

Mike Coleman report at bugs.python.org
Wed Feb 13 16:59:42 CET 2008


Mike Coleman added the comment:

The value is used there, but this is not effective in causing larger
packets to be sent, which I noticed by watching with strace.  I think
the reason for this is that 'refill_buffer' will only make at most one
call to simple_producer.more, and that call will produce at most 512
bytes, because that's the default value of that argument, and its not
overridden in the call that creates the simple_producer inside of 'push'.

In addition, I see at least one other place in the code where the
constant '512' appears.  Probably all of these should be changed to use
the 'ac_*' values, or at least a larger constant.

Looking at the big picture, though, I don't understand why we're trying
to break this stuff up in the first place.  That seems like the job of
the OS, and it may well do it faster and better anyway.  I would think
that every call to socket 'send' should try to ram as much data through
as possible.  The return value will let us know what actually happened.

(In my application, send's of size >200K are regularly succeeding, as
seen with strace.  I got this behavior by overriding 'push' with a fixed
version.)

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2073>
__________________________________


More information about the Python-bugs-list mailing list