From 3ab1d317831a6c1830bb648a1a8d63a41c92f651 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 11 Apr 2010 20:12:25 +0200 Subject: Fixing a bug in s5bytestream code to deal with incomplete SOCKS5 messages and my rewrite of the bs_peek function. --- protocols/jabber/s5bytestream.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'protocols') diff --git a/protocols/jabber/s5bytestream.c b/protocols/jabber/s5bytestream.c index 58a6c2e4..36a2e438 100644 --- a/protocols/jabber/s5bytestream.c +++ b/protocols/jabber/s5bytestream.c @@ -481,10 +481,11 @@ gboolean jabber_bs_recv_handshake( gpointer data, gint fd, b_input_condition con return TRUE; else if( ret < sizeof( struct socks5_message ) ) { - /* Either a buggy proxy or just one that doesnt regard the SHOULD in XEP-0065 - * saying the reply SHOULD contain the address */ - - ASSERTSOCKOP( ret = recv( fd, &socks5_reply, ret, 0 ), "Dequeuing after MSG_PEEK" ); + /* Either a buggy proxy or just one that doesnt regard + * the SHOULD in XEP-0065 saying the reply SHOULD + * contain the address. We'll take it, so make sure the + * next jabber_bs_peek starts with an empty buffer. */ + bt->peek_buf_len = 0; } if( !( socks5_reply.ver == 5 ) || -- cgit v1.2.3