diff options
author | Matt Johnston <matt@ucc.asn.au> | 2009-02-26 13:21:14 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2009-02-26 13:21:14 +0000 |
commit | 4f5acb34c461b06539188b02bf1a8880c766e82a (patch) | |
tree | 1b68a40a677aec7d498848f9e124f4efcf1a2375 /packet.c | |
parent | 73633f243488a151d3f463d5d0799b88c94490a2 (diff) | |
parent | b41e6bc99c1db6ec19f003193f3361ec219335d4 (diff) | |
download | dropbear-4f5acb34c461b06539188b02bf1a8880c766e82a.tar.gz |
merge of 'e1c100e6366c5d607af08f4abdbb0f4281df4fa9'
and 'fe8161b0698c9816b98f79e3cab2b9d59f2be71b'
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -46,16 +46,14 @@ static buffer* buf_decompress(buffer* buf, unsigned int len); static void buf_compress(buffer * dest, buffer * src, unsigned int len); #endif -/* non-blocking function writing out a current encrypted packet. Returns - * DROPBEAR_SUCCESS if entire packet was written, DROPBEAR_FAILURE - * otherwise */ -static int write_packet() { +/* non-blocking function writing out a current encrypted packet */ +void write_packet() { int len, written; - int ret = DROPBEAR_FAILURE; buffer * writebuf = NULL; TRACE(("enter write_packet")) + dropbear_assert(!isempty(&ses.writequeue)); /* Get the next buffer in the queue of encrypted packets to write*/ writebuf = (buffer*)examine(&ses.writequeue); @@ -86,19 +84,12 @@ static int write_packet() { dequeue(&ses.writequeue); buf_free(writebuf); writebuf = NULL; - ret = DROPBEAR_SUCCESS; } else { /* More packet left to write, leave it in the queue for later */ buf_incrpos(writebuf, written); } TRACE(("leave write_packet")) - return ret; -} - -void write_packets() { - /* keep writing packets while we can. */ - while (!isempty(&ses.writequeue) && write_packet() == DROPBEAR_SUCCESS) {} } /* Non-blocking function reading available portion of a packet into the |