1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-10-31 23:30:25 +03:00

packets: code cleanup

I added size checks in several places. I fixed the code flow to be easier
to read in some places.

I removed unnecessary zeroing of structs. I removed unused struct fields.
This commit is contained in:
Daniel Stenberg
2010-11-10 14:56:14 +01:00
parent f4ad3e0120
commit 1d11d02aa9
2 changed files with 275 additions and 308 deletions

View File

@@ -304,18 +304,13 @@ struct _LIBSSH2_PACKET
{
struct list_node node; /* linked list header */
unsigned char type;
/* Unencrypted Payload (no type byte, no padding, just the facts ma'am) */
/* the raw unencrypted payload */
unsigned char *data;
size_t data_len;
/* Where to start reading data from,
* used for channel data that's been partially consumed */
unsigned long data_head;
/* Can the message be confirmed? */
int mac;
};
typedef struct _libssh2_channel_data
@@ -745,9 +740,8 @@ struct _LIBSSH2_SESSION
/* State variables used in libssh2_packet_add() */
libssh2_nonblocking_states packAdd_state;
LIBSSH2_CHANNEL *packAdd_channel;
unsigned long packAdd_data_head;
key_exchange_state_t packAdd_key_state;
LIBSSH2_CHANNEL *packAdd_channelp; /* keeper of the channel during EAGAIN
states */
packet_queue_listener_state_t packAdd_Qlstn_state;
packet_x11_open_state_t packAdd_x11open_state;