Bugs item #2885133, was opened at 2009-10-24 01:49
Message generated for change (Comment added) made by bagder
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2885133&group_id=125852

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: David Russell (dseanrussell)
>Assigned to: Daniel Stenberg (bagder)
Summary: _libssh2_channel_write returns erroneous value

Initial Comment:
_libssh2_channel_write is not returning correct data under the following 
circumstances:
- buflen is larger than the current local window size, so 
channel->write_bufwrite is reduced to 
  channel->local.window_size.
- The first chunk of the block is successfully written, so buflen, buf, and 
channel->write_bufwrote
  are updated correctly.
- When the second chunk of the block is to be written, there is apparenly new 
room in the local
  window, so the new data is copied to the packet and _libssh2_transport_write 
is called.
- _libssh2_transport_write fails with PACKET_EAGAIN, which is returned.
- The write is retried, and finally succeeds.  The 'wrote' value is returned, 
which only contains
  the amount of the second chunk of the original write.

I believe that this function should return channel->write_bufwrote, not wrote.

----------------------------------------------------------------------

>Comment By: Daniel Stenberg (bagder)
Date: 2009-12-06 23:12

Message:
I'm not sure I agree, but I agree that there's a problem here!

in my mind, it should not return PACKET_EAGAIN in the first case where it
did manage to send away data, it should rather return the amount it managed
to send even if it did get a EAGAIN case in the last transport_write()
call. EAGAIN would then only be returned if no previous call to
transport_write() was successful.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2885133&group_id=125852
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to