Giampaolo Rodola' added the comment:

In attachment I provide a patch for fixing this last mentioned issue.
It's a rewriting of initiate_send method which now looks at what is
specified by ac_out_buffer_size attribute.

Added file: http://bugs.python.org/file8917/initiate_send.py

_____________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1736190>
_____________________________________
    def initiate_send (self):
        while self.producer_fifo and self.connected:
            first = self.producer_fifo[0]
            # handle empty string/buffer or None entry
            if not first:
                del self.producer_fifo[0]
                if first is None:
                    self.handle_close()
                    return

            # handle classic producer behavior
            obs = self.ac_out_buffer_size
            try:
                data = buffer(first, 0, obs)
            except TypeError:
                self.producer_fifo.appendleft(first.more())
                continue

            # send the data
            try:
               num_sent = self.send(data)
            except socket.error, why:
               self.handle_error()
               return

            if num_sent:
                if num_sent < len(data) or obs < len(first):
                    self.producer_fifo[0] = first[num_sent:]
                else:
                    del self.producer_fifo[0]
            # we tried to send some actual data
            return
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to