Compare commits
1 Commits
RELEASE.0.
...
start
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6b40898187 |
9
INSTALL
9
INSTALL
@@ -1,9 +0,0 @@
|
|||||||
Installing libssh2
|
|
||||||
==================
|
|
||||||
|
|
||||||
* Untar this tarball (which, if you're reading this, you've already done)
|
|
||||||
|
|
||||||
* Run: ./configure (passing additional options as desired)
|
|
||||||
|
|
||||||
* Run: make all install
|
|
||||||
|
|
@@ -10,7 +10,7 @@ CC = @CC@
|
|||||||
CFLAGS = -c @CFLAGS@ -Iinclude/ -Wall -g
|
CFLAGS = -c @CFLAGS@ -Iinclude/ -Wall -g
|
||||||
LIBS = -lssh2 -Lsrc/
|
LIBS = -lssh2 -Lsrc/
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
VERSION=0.1
|
VERSION=0.1-dev
|
||||||
DISTLIB=libssh2-$(VERSION)
|
DISTLIB=libssh2-$(VERSION)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@@ -40,8 +40,8 @@ dist:
|
|||||||
rm -f $(DISTLIB)
|
rm -f $(DISTLIB)
|
||||||
ln -s . $(DISTLIB)
|
ln -s . $(DISTLIB)
|
||||||
tar -zcf $(DISTLIB).tar.gz \
|
tar -zcf $(DISTLIB).tar.gz \
|
||||||
$(DISTLIB)/configure $(DISTLIB)/Makefile.in $(DISTLIB)/ssh2_sample.c \
|
$(DISTLIB)/configure.in $(DISTLIB)/configure $(DISTLIB)/Makefile.in $(DISTLIB)/ssh2_sample.c \
|
||||||
$(DISTLIB)/LICENSE $(DISTLIB)/README $(DISTLIB)/TODO $(DISTLIB)/INSTALL \
|
$(DISTLIB)/LICENSE $(DISTLIB)/README $(DISTLIB)/TODO \
|
||||||
$(DISTLIB)/mkinstalldirs $(DISTLIB)/install-sh \
|
$(DISTLIB)/mkinstalldirs $(DISTLIB)/install-sh \
|
||||||
$(DISTLIB)/src/*.c $(DISTLIB)/src/Makefile.in \
|
$(DISTLIB)/src/*.c $(DISTLIB)/src/Makefile.in \
|
||||||
$(DISTLIB)/include/libssh2.h $(DISTLIB)/include/libssh2_priv.h $(DISTLIB)/include/libssh2_config.h.in
|
$(DISTLIB)/include/libssh2.h $(DISTLIB)/include/libssh2_priv.h $(DISTLIB)/include/libssh2_config.h.in
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#define LIBSSH2_VERSION "0.1"
|
#define LIBSSH2_VERSION "0.1dev"
|
||||||
|
|
||||||
/* Part of every banner, user specified or not */
|
/* Part of every banner, user specified or not */
|
||||||
#define LIBSSH2_SSH_BANNER "SSH-2.0-libssh2_" LIBSSH2_VERSION
|
#define LIBSSH2_SSH_BANNER "SSH-2.0-libssh2_" LIBSSH2_VERSION
|
||||||
@@ -202,7 +202,6 @@ LIBSSH2_API int libssh2_channel_write_ex(LIBSSH2_CHANNEL *channel, int stream_id
|
|||||||
#define libssh2_channel_write_stderr(channel, buf, buflen) libssh2_channel_write_ex((channel), SSH_EXTENDED_DATA_STDERR, (buf), (buflen))
|
#define libssh2_channel_write_stderr(channel, buf, buflen) libssh2_channel_write_ex((channel), SSH_EXTENDED_DATA_STDERR, (buf), (buflen))
|
||||||
|
|
||||||
LIBSSH2_API void libssh2_channel_set_blocking(LIBSSH2_CHANNEL *channel, int blocking);
|
LIBSSH2_API void libssh2_channel_set_blocking(LIBSSH2_CHANNEL *channel, int blocking);
|
||||||
LIBSSH2_API void libssh2_channel_ignore_extended_data(LIBSSH2_CHANNEL *channel, int ignore);
|
|
||||||
|
|
||||||
LIBSSH2_API int libssh2_channel_send_eof(LIBSSH2_CHANNEL *channel);
|
LIBSSH2_API int libssh2_channel_send_eof(LIBSSH2_CHANNEL *channel);
|
||||||
LIBSSH2_API int libssh2_channel_eof(LIBSSH2_CHANNEL *channel);
|
LIBSSH2_API int libssh2_channel_eof(LIBSSH2_CHANNEL *channel);
|
||||||
|
@@ -98,7 +98,7 @@ typedef struct _libssh2_channel_data {
|
|||||||
unsigned long window_size_initial, window_size, packet_size;
|
unsigned long window_size_initial, window_size, packet_size;
|
||||||
|
|
||||||
/* Set to 1 when CHANNEL_CLOSE / CHANNEL_EOF sent/received */
|
/* Set to 1 when CHANNEL_CLOSE / CHANNEL_EOF sent/received */
|
||||||
char close, eof, ignore_extended_data;
|
int close, eof;
|
||||||
} libssh2_channel_data;
|
} libssh2_channel_data;
|
||||||
|
|
||||||
struct _LIBSSH2_CHANNEL {
|
struct _LIBSSH2_CHANNEL {
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
# Created: 1993-05-16
|
# Created: 1993-05-16
|
||||||
# Public domain
|
# Public domain
|
||||||
|
|
||||||
# $Id: mkinstalldirs,v 1.1 2004/12/07 21:17:20 sarag Exp $
|
# $Id: mkinstalldirs,v 1.1.1.1 2004/12/07 21:17:20 sarag Exp $
|
||||||
|
|
||||||
errstatus=0
|
errstatus=0
|
||||||
|
|
||||||
|
@@ -337,7 +337,6 @@ LIBSSH2_API int libssh2_channel_request_pty_ex(LIBSSH2_CHANNEL *channel, char *t
|
|||||||
LIBSSH2_FREE(session, packet);
|
LIBSSH2_FREE(session, packet);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
LIBSSH2_FREE(session, packet);
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
@@ -434,56 +433,6 @@ LIBSSH2_API void libssh2_channel_set_blocking(LIBSSH2_CHANNEL *channel, int bloc
|
|||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
/* {{{ libssh2_channel_ignore_extended_data
|
|
||||||
* Ignore (or stop ignoring) extended data
|
|
||||||
*/
|
|
||||||
LIBSSH2_API void libssh2_channel_ignore_extended_data(LIBSSH2_CHANNEL *channel, int ignore)
|
|
||||||
{
|
|
||||||
channel->remote.ignore_extended_data = ignore;
|
|
||||||
|
|
||||||
if (ignore) {
|
|
||||||
/* Flush queued extended data */
|
|
||||||
LIBSSH2_PACKET *packet = channel->session->packets.head;
|
|
||||||
unsigned long refund_bytes = 0;
|
|
||||||
|
|
||||||
while (packet) {
|
|
||||||
LIBSSH2_PACKET *next = packet->next;
|
|
||||||
|
|
||||||
if ((packet->data[0] == SSH_MSG_CHANNEL_EXTENDED_DATA) && (libssh2_ntohu32(packet->data + 1) == channel->local.id)) {
|
|
||||||
refund_bytes += packet->data_len - 13;
|
|
||||||
LIBSSH2_FREE(channel->session, packet->data);
|
|
||||||
if (packet->prev) {
|
|
||||||
packet->prev->next = packet->next;
|
|
||||||
} else {
|
|
||||||
channel->session->packets.head = packet->next;
|
|
||||||
}
|
|
||||||
if (packet->next) {
|
|
||||||
packet->next->prev = packet->prev;
|
|
||||||
} else {
|
|
||||||
channel->session->packets.tail = packet->prev;
|
|
||||||
}
|
|
||||||
LIBSSH2_FREE(channel->session, packet);
|
|
||||||
}
|
|
||||||
packet = next;
|
|
||||||
}
|
|
||||||
if (refund_bytes && channel->remote.window_size_initial) {
|
|
||||||
unsigned char adjust[9]; /* packet_type(1) + channel(4) + adjustment(4) */
|
|
||||||
|
|
||||||
/* Adjust the window based on the block we just freed */
|
|
||||||
adjust[0] = SSH_MSG_CHANNEL_WINDOW_ADJUST;
|
|
||||||
libssh2_htonu32(adjust + 1, channel->remote.id);
|
|
||||||
libssh2_htonu32(adjust + 5, refund_bytes);
|
|
||||||
|
|
||||||
if (libssh2_packet_write(channel->session, adjust, 9)) {
|
|
||||||
libssh2_error(channel->session, LIBSSH2_ERROR_SOCKET_SEND, "Unable to send transfer-window adjustment packet", 0);
|
|
||||||
} else {
|
|
||||||
channel->remote.window_size += refund_bytes;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* }}} */
|
|
||||||
|
|
||||||
/* {{{ libssh2_channel_read_ex
|
/* {{{ libssh2_channel_read_ex
|
||||||
* Read data from a channel
|
* Read data from a channel
|
||||||
*/
|
*/
|
||||||
@@ -531,18 +480,16 @@ LIBSSH2_API int libssh2_channel_read_ex(LIBSSH2_CHANNEL *channel, int stream_id,
|
|||||||
}
|
}
|
||||||
LIBSSH2_FREE(session, packet->data);
|
LIBSSH2_FREE(session, packet->data);
|
||||||
|
|
||||||
if (channel->remote.window_size_initial) {
|
/* Adjust the window based on the block we just freed */
|
||||||
/* Adjust the window based on the block we just freed */
|
adjust[0] = SSH_MSG_CHANNEL_WINDOW_ADJUST;
|
||||||
adjust[0] = SSH_MSG_CHANNEL_WINDOW_ADJUST;
|
libssh2_htonu32(adjust + 1, channel->remote.id);
|
||||||
libssh2_htonu32(adjust + 1, channel->remote.id);
|
libssh2_htonu32(adjust + 5, packet->data_len - (stream_id ? 13 : 9));
|
||||||
libssh2_htonu32(adjust + 5, packet->data_len - (stream_id ? 13 : 9));
|
|
||||||
|
|
||||||
if (libssh2_packet_write(session, adjust, 9)) {
|
if (libssh2_packet_write(session, adjust, 9)) {
|
||||||
libssh2_error(session, LIBSSH2_ERROR_SOCKET_SEND, "Unable to send transfer-window adjustment packet", 0);
|
libssh2_error(session, LIBSSH2_ERROR_SOCKET_SEND, "Unable to send transfer-window adjustment packet", 0);
|
||||||
}
|
|
||||||
|
|
||||||
LIBSSH2_FREE(session, packet);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LIBSSH2_FREE(session, packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
packet = next;
|
packet = next;
|
||||||
@@ -716,11 +663,6 @@ LIBSSH2_API int libssh2_channel_free(LIBSSH2_CHANNEL *channel)
|
|||||||
LIBSSH2_FREE(session, data);
|
LIBSSH2_FREE(session, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free "channel_type" */
|
|
||||||
if (channel->channel_type) {
|
|
||||||
LIBSSH2_FREE(session, channel->channel_type);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Unlink from channel brigade */
|
/* Unlink from channel brigade */
|
||||||
if (channel->prev) {
|
if (channel->prev) {
|
||||||
channel->prev->next = channel->next;
|
channel->prev->next = channel->next;
|
||||||
|
18
src/packet.c
18
src/packet.c
@@ -153,24 +153,6 @@ static int libssh2_packet_add(LIBSSH2_SESSION *session, unsigned char *data, siz
|
|||||||
LIBSSH2_FREE(session, data);
|
LIBSSH2_FREE(session, data);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (channel->remote.ignore_extended_data && (data[0] == SSH_MSG_CHANNEL_EXTENDED_DATA)) {
|
|
||||||
/* Pretend we didn't receive this */
|
|
||||||
LIBSSH2_FREE(session, data);
|
|
||||||
|
|
||||||
if (channel->remote.window_size_initial) {
|
|
||||||
/* Adjust the window based on the block we just freed */
|
|
||||||
unsigned char adjust[9];
|
|
||||||
|
|
||||||
adjust[0] = SSH_MSG_CHANNEL_WINDOW_ADJUST;
|
|
||||||
libssh2_htonu32(adjust + 1, channel->remote.id);
|
|
||||||
libssh2_htonu32(adjust + 5, datalen - 13);
|
|
||||||
|
|
||||||
if (libssh2_packet_write(channel->session, adjust, 9)) {
|
|
||||||
libssh2_error(channel->session, LIBSSH2_ERROR_SOCKET_SEND, "Unable to send transfer-window adjustment packet", 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* REMEMBER! remote means remote as source of data, NOT remote window! */
|
/* REMEMBER! remote means remote as source of data, NOT remote window! */
|
||||||
if (channel->remote.packet_size < (datalen - data_head)) {
|
if (channel->remote.packet_size < (datalen - data_head)) {
|
||||||
|
Reference in New Issue
Block a user