1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-02 10:53:16 +03:00

Simplified libssh2_channel_read_ex() and made it send window adjustments less

frequent, use a few less struct fields in the channel struct and improved
reading from the network with libssh2_packet_read(). I also modified the
windowing algorithm and now use a much larger window. This greatly enhances
SSH/SCP performance. I also increased the size of the buffer the transport
layer uses from 4k to 16K.
This commit is contained in:
Daniel Stenberg
2009-03-15 22:29:23 +00:00
parent 3793b6768d
commit 1a630c5c09
2 changed files with 88 additions and 54 deletions

View File

@@ -1,4 +1,5 @@
/* Copyright (c) 2004-2008, Sara Golemon <sarag@libssh2.org>
* Copyright (c) 2009 by Daniel Stenberg
* All rights reserved.
*
* Redistribution and use in source and binary forms,
@@ -79,6 +80,13 @@
#include "libssh2_publickey.h"
#include "libssh2_sftp.h"
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
/* Provide iovec / writev on WIN32 platform. */
#ifdef WIN32
@@ -387,11 +395,8 @@ struct _LIBSSH2_CHANNEL
libssh2_nonblocking_states read_state;
LIBSSH2_PACKET *read_packet;
LIBSSH2_PACKET *read_next;
int read_block;
int read_bytes_read;
uint32_t read_local_id;
int read_want;
int read_unlink_packet;
/* State variables used in libssh2_channel_write_ex() */
libssh2_nonblocking_states write_state;
@@ -466,7 +471,7 @@ typedef struct _libssh2_endpoint_data
char *lang_prefs;
} libssh2_endpoint_data;
#define PACKETBUFSIZE 4096
#define PACKETBUFSIZE (1024*16)
struct transportpacket
{