summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2009-02-26 13:20:53 +0000
committerMatt Johnston <matt@ucc.asn.au>2009-02-26 13:20:53 +0000
commitd1bfb6bfb7a346715a66318ec9d1e860903c8245 (patch)
tree399e320035e8c5743c41c20be336206b621f979e /packet.c
parenta60cb7dbaa41432d359468c4f2972b1348fa8631 (diff)
downloaddropbear-d1bfb6bfb7a346715a66318ec9d1e860903c8245.tar.gz
disapproval of revision 'a101cbd046507cf723e6362a49196dbd4b924042'
--HG-- extra : convert_revision : e1c100e6366c5d607af08f4abdbb0f4281df4fa9
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/packet.c b/packet.c
index 4e2eedf..870d5d8 100644
--- a/packet.c
+++ b/packet.c
@@ -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