Subject: Re: [libssh2] #256: many writes, congested link -> LIBSSH2_ERROR_BAD_USE, stuck

Re: [libssh2] #256: many writes, congested link -> LIBSSH2_ERROR_BAD_USE, stuck

From: libssh2 Trac <trac_at_libssh2.stuge.se>
Date: Tue, 05 Feb 2013 20:48:26 -0000

#256: many writes, congested link -> LIBSSH2_ERROR_BAD_USE, stuck
---------------------+-------------------
  Reporter: ncm | Owner:
      Type: defect | Status: new
  Priority: normal | Milestone: 1.4.3
 Component: misc | Version: 1.4.2
Resolution: | Keywords:
Blocked By: | Blocks:
---------------------+-------------------

Comment (by ncm):

 OK, will post another patch, with corresponding changes in channel.c. I
 recognize that the present patch is not compatible with the logic in
 current {{{_libssh2_channel_receive_window_adjust()}}}.

 If I understand you correctly, there is no need to force internal state
 details into the POSIX mold, so we can use more expressive status
 reporting internally, and then filter them to POSIX-style codes only at
 the public interface boundary. Would you prefer to have new internal-only
 error codes defined in {{{include/libssh2.h}}}, or create an island in
 that space in {{{src/libssh2_priv.h}}}? (Assuming the former.)

 The additional return values I propose to define are _QUEUED (encrypted
 into {{{session->packet->outbuf}}} but not all sent yet) and _DROPPED,
 which callers of _transport_send may then translate to _EAGAIN as
 appropriate for delivery to their callers. I assume we don't want to
 change the interface to clients by adding more error return values there.

 An alternative to dropping control messages that cannot be posted
 immediately is to encrypt and append them to the present contents of
 {{{session->packet->outbuf}}}, but I don't see a clean way to protect
 against appending too much. I think we need either a "send_eof" flag
 saying to insert one at the next opportunity, OR to allow a single EOF
 message to be appended to outbuf, with a "sent_eof" flag. The latter
 seems a little cleaner.

-- 
Ticket URL: <https://trac.libssh2.org/ticket/256#comment:3>
libssh2 <https://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2013-02-05