From 3faa8bc9400fdc2f67181bfb3da482baeaad9263 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 15 Dec 2010 09:27:00 +0100 Subject: [PATCH] SFTP: request_ids are uint32_t 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. --- src/sftp.c | 8 ++++---- src/sftp.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sftp.c b/src/sftp.c index e4b3679..410a8cb 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -91,7 +91,7 @@ static int sftp_close_handle(LIBSSH2_SFTP_HANDLE *handle); static int sftp_packet_ask(LIBSSH2_SFTP *sftp, unsigned char packet_type, - int request_id, unsigned char **data, + uint32_t request_id, unsigned char **data, size_t *data_len); static void sftp_packet_flush(LIBSSH2_SFTP *sftp); @@ -297,7 +297,7 @@ static void sftp_packetlist_flush(LIBSSH2_SFTP_HANDLE *handle) */ static int sftp_packet_ask(LIBSSH2_SFTP *sftp, unsigned char packet_type, - int request_id, unsigned char **data, + uint32_t request_id, unsigned char **data, size_t *data_len) { LIBSSH2_SESSION *session = sftp->channel->session; @@ -334,7 +334,7 @@ sftp_packet_ask(LIBSSH2_SFTP *sftp, unsigned char packet_type, */ static int sftp_packet_require(LIBSSH2_SFTP *sftp, unsigned char packet_type, - int request_id, unsigned char **data, + uint32_t request_id, unsigned char **data, size_t *data_len) { LIBSSH2_SESSION *session = sftp->channel->session; @@ -377,7 +377,7 @@ sftp_packet_require(LIBSSH2_SFTP *sftp, unsigned char packet_type, static int sftp_packet_requirev(LIBSSH2_SFTP *sftp, int num_valid_responses, const unsigned char *valid_responses, - int request_id, unsigned char **data, + uint32_t request_id, unsigned char **data, size_t *data_len) { int i; diff --git a/src/sftp.h b/src/sftp.h index de9aa94..a0d45b8 100644 --- a/src/sftp.h +++ b/src/sftp.h @@ -67,7 +67,7 @@ struct sftp_pipeline_chunk { struct _LIBSSH2_SFTP_PACKET { struct list_node node; /* linked list header */ - int request_id; + uint32_t request_id; unsigned char *data; size_t data_len; /* payload size */ }; @@ -120,7 +120,7 @@ struct _LIBSSH2_SFTP_HANDLE /* State variables used in libssh2_sftp_close_handle() */ libssh2_nonblocking_states close_state; - unsigned long close_request_id; + uint32_t close_request_id; unsigned char *close_packet; /* list of outstanding packets sent to server */ @@ -132,7 +132,7 @@ struct _LIBSSH2_SFTP { LIBSSH2_CHANNEL *channel; - unsigned long request_id, version; + uint32_t request_id, version; struct list_head packets;