Switch branches/tags
Nothing to show
Commits on Dec 29, 2010
  1. data size: cleanup

    bagder committed Dec 29, 2010
    Fix 64bit warnings by using (s)size_t and dedicated uint32_t types more.
  2. ssize_t: proper typedef with MSVC compilers

    pierrejoye authored and bagder committed Dec 29, 2010
    As discussed on the mailing list, it was wrong for win64 and using the
    VC-provided type is the safest approach instead of second- guessing
    which one it should be.
Commits on Dec 22, 2010
  1. Updated OpenSSL version.

    gknauf committed Dec 22, 2010
  2. Expanded tabs to spaces.

    gknauf committed Dec 22, 2010
Commits on Dec 21, 2010
  1. _libssh2_ntohu64: fix conversion from network bytes to uint64

    jdegges authored and Peter Stuge committed Dec 21, 2010
    Cast individual bytes to uint64 to avoid overflow in arithmetic.
Commits on Dec 20, 2010
  1. libssh2_userauth_list: language fix

    bagder committed Dec 20, 2010
    "faily" is not a good English word, and I also cleaned up some other minor
Commits on Dec 18, 2010
  1. crypto: unify the generic functions

    bagder committed Dec 18, 2010
    Added crypto.h that is the unified header to include when using crypto
    functionality. It should be the only header that needs to adapt to the
    underlying crypto library in use. It provides the set of prototypes that
    are library agnostic.
  2. userauth: derive publickey from private

    Mark Smith authored and bagder committed Dec 18, 2010
    Pass a NULL pointer for the publickey parameter of
    libssh2_userauth_publickey_fromfile and
    libssh2_userauth_hostbased_fromfile functions.  In this case, the
    functions recompute the public key from the private key file data.
    This is work done by Jean-Louis CHARTON
    <>, then adapted by Mark Smith and
    slightly edited further by me Daniel.
    WARNING: this does leave the feature NOT WORKING when libssh2 is built
    to use libgcrypt instead of OpenSSL simply due to lack of
Commits on Dec 15, 2010
  1. _libssh2_packet_add: fix SSH_MSG_DEBUG weirdness

    bagder committed Dec 15, 2010
    I believe I may have caused this weird typo style error when I cleaned
    up this function a while ago. Corrected now.
  2. uint32: more longs converted to proper types

    bagder committed Dec 15, 2010
    I also moved the MAC struct over to the mac.h header file and made sure
    that the users of that struct include that file.
  3. SFTP: more types to uint32_t

    bagder committed Dec 15, 2010
    The 'num_names' field in the SSH_FXP_NAME response is an unsigned 32bit
    value so we make sure to treat it like that.
  4. SFTP: request_ids are uint32_t

    bagder committed Dec 15, 2010
    I went over the code and made sure we use uint32_t all over for the
    request_id data. It is an unsigned 32bit value on the wire.
Commits on Dec 14, 2010
  1. SFTP: store request_id separately in packets

    bagder committed Dec 14, 2010
    By using a new separate struct for incoming SFTP packets and not sharing
    the generic packet struct, we can get rid of an unused field and add a
    new one dedicated for holding the request_id for the incoming
    package. As sftp_packet_ask() is called fairly often, a "mere" integer
    comparison is MUCH faster than the previous memcmp() of (typically) 5
  2. libssh2_sftp_open_ex: man page extended and cleaned up

    bagder committed Dec 14, 2010
    I added the missing documentation for the 'flags' argument.
  3. SFTP: fix memory leaks

    bagder committed Dec 14, 2010
    Make sure that we cleanup remainders when the handle is closed and when
    the subsystem is shutdown.
    Existing flaw: if a single handle sends packets that haven't been
    replied to yet at the time when the handle is closed, those packets will
    arrive later and end up in the generic packet brigade queue and they
    will remain in there until flushed. They will use unnecessary memory,
    make things slower and they will ruin the SFTP handling if the
    request_id counter ever wraps (highly unlikely to every happen).
  4. sftp_close_handle: packet list is generic

    bagder committed Dec 14, 2010
    Fix comment, simplify the loop logic
  5. sftp_read: pipeline reads

    bagder committed Dec 14, 2010
    The SFTP read function now does transfers the same way the SFTP write
    function was made to recently: it creates a list of many outgoing
    FXP_READ packets that each asks for a small data chunk. The code then
    tries to keep sending read request while collecting the acks for the
    previous requests and returns the received data.
Commits on Dec 13, 2010
Commits on Dec 11, 2010
  1. _libssh2_channel_close: don't call transport read if disconnected

    bagder committed Dec 11, 2010
    The loop that waits for remote.close to get set may end up looping
    forever since session->socket_state gets set to
    LIBSSH2_SOCKET_DISCONNECTED by the packet_add() function called from the
    transport_read() function and after having been set to
    LIBSSH2_SOCKET_DISCONNECTED, the transport_read() function will only
    return 0.
Commits on Dec 10, 2010
  1. libssh2_sftp_seek64: new man page

    bagder committed Dec 10, 2010
    Split off libssh2_sftp_seek64 from the libssh2_sftp_seek man page, and
    mentioned that we consider the latter deprecated. Also added a mention
    about the dangers of doing seek during writing or reading.
  2. sftp_seek: fix

    bagder committed Dec 10, 2010
    The new SFTP write code caused a regression as the seek function no
    longer worked as it didn't set the write position properly.
    It should be noted that seeking is STRONGLY PROHIBITED during upload, as
    the upload magic uses two different offset positions and the multiple
    outstanding packets etc make them sensitive to change in the midst of
    This functionality was just verified with the new example code
    sftp_append. This bug was filed as bug #202:
Commits on Dec 6, 2010

    bagder committed Dec 6, 2010
    I ran SFTP upload tests against localhost. It showed that to make the
    app reach really good speeds, I needed to do a little code tweak and
    change MAX_SFTP_OUTGOING_SIZE from 4000 to 30000. The tests I did before
    with the high latency tests didn't show any real difference whatever I
    had that size set to.
    This number is the size in bytes that libssh2 cuts off the large input
    buffer and sends off as an individual sftp packet.
Commits on Dec 4, 2010
  1. sftp_write_sliding.c: new example

    bagder committed Dec 4, 2010
    This is an example that is very similar to sftp_write_nonblock.c, with
    the exception that this uses
    1 - a larger upload buffer
    2 - a sliding buffer mechnism to allow the app to keep sending lots of
    data to libssh2 without having to first drain the buffer.
    These are two key issues to make libssh2 SFTP uploads really perform
    well at this point in time.
Commits on Dec 2, 2010
  1. cpp: s/#elsif/#elif

    bagder committed Dec 2, 2010
    This looks like a typo as #elsif is not really C...
Commits on Nov 13, 2010
  1. _libssh2_channel_write: revert channel_write() use

    bagder committed Nov 13, 2010
    The attempts made to have _libssh2_channel_write() accept larger pieces
    of data and split up the data by itself into 32700 byte chunks and pass
    them on to channel_write() in a loop as a way to do faster operations on
    larger data blocks was a failed attempt.
    The reason why it is difficult:
    The API only allows EAGAIN or a length to be returned. When looping over
    multiple blocks to get sent, one block can get sent and the next might
    not. And yet: when transport_send() has returned EAGAIN we must not call
    it again with new data until it has returned OK on the existing data it
    is still working on. This makes it a mess and we do get a much easier
    job by simply returning the bytes or EAGAIN at once, as in the EAGAIN
    case we can assume that we will be called with the same arguments again
    and transport_send() will be happy.
    Unfortunately, I think we take a small performance hit by not being able
    to do this.
  2. ssh2_echo: new example

    bagder committed Nov 13, 2010
    This is a new example snippet. The code is largely based on ssh2_exec,
    and is written by Tommy Lindgren. I edited it into C90 compliance and to
    conform to libssh2 indent style and some more.
  3. send_existing: return after send_existing

    bagder committed Nov 13, 2010
    When a piece of data is sent from the send_existing() function we must
    make the parent function return afterwards. Otherwise we risk that the
    parent function tries to send more data and ends up getting an EGAIN for
    that more data and since it can only return one return code it doesn't
    return info for the successfully sent data.
    As this change is a regression I now added a larger comment explaining
    why it has to work like this.
  4. _libssh2_channel_write: count resent data as written

    bagder committed Nov 13, 2010
    In the logic that resends data that was kept for that purpose due to a
    previous EAGAIN, the data was not counted as sent causing badness.
Commits on Nov 12, 2010
  1. send/recv: use _libssh2_recv and _libssh2_send now

    bagder committed Nov 12, 2010
    Starting now, we unconditionally use the internal replacement functions
    for send() and recv() - creatively named _libssh2_recv() and
    On errors, these functions return the negative 'errno' value instead of
    the traditional -1. This design allows systems that have no "natural"
    errno support to not have to invent it. It also means that no code
    outside of these two transfer functions should use the errno variable.