diff options
| author | ulim <a.sporto+bee@gmail.com> | 2008-05-04 15:32:15 +0200 | 
|---|---|---|
| committer | ulim <a.sporto+bee@gmail.com> | 2008-05-04 15:32:15 +0200 | 
| commit | 4358b10c11410a27af9458c92067549cafbc4c0b (patch) | |
| tree | d60712a886fe6e54b76204dd1362b6fe71e9c805 | |
| parent | 0cab3888888c7c6b58af9560a0ae2c74a795727f (diff) | |
ulibc support, fixes "Invalid SOCKS5 Connect message" problem
| -rw-r--r-- | dcc.c | 14 | ||||
| -rw-r--r-- | irc.c | 3 | ||||
| -rw-r--r-- | protocols/jabber/iq.c | 5 | ||||
| -rw-r--r-- | protocols/jabber/s5bytestream.c | 16 | 
4 files changed, 32 insertions, 6 deletions
| @@ -29,6 +29,20 @@  #include <netinet/tcp.h>  #include <regex.h> +/* Some ifdefs for ulibc (Thanks to Whoopie) */ +#ifndef HOST_NAME_MAX +#include <sys/param.h> +#ifdef MAXHOSTNAMELEN +#define HOST_NAME_MAX MAXHOSTNAMELEN +#else +#define HOST_NAME_MAX 255 +#endif +#endif + +#ifndef AI_NUMERICSERV +#define AI_NUMERICSERV 0x0400   /* Don't use name resolution.  */ +#endif +  /*    * Since that might be confusing a note on naming:   * @@ -29,9 +29,6 @@  #include "ipc.h"  #include "dcc.h" -#include <regex.h> -#include <netinet/in.h> -  static gboolean irc_userping( gpointer _irc, int fd, b_input_condition cond );  GSList *irc_connection_list = NULL; diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c index 22aa3e7c..eacc85af 100644 --- a/protocols/jabber/iq.c +++ b/protocols/jabber/iq.c @@ -611,7 +611,7 @@ xt_status jabber_iq_query_features( struct im_connection *ic, char *bare_jid )  	if( ( bud = jabber_buddy_by_jid( ic, bare_jid , 0 ) ) == NULL )  	{  		/* Who cares about the unknown... */ -		imcb_log( ic, "Couldnt find the man: %s", bare_jid); +		imcb_log( ic, "Couldn't find buddy: %s", bare_jid);  		return 0;  	} @@ -625,6 +625,7 @@ xt_status jabber_iq_query_features( struct im_connection *ic, char *bare_jid )  	{  		imcb_log( ic, "WARNING: Couldn't generate feature query" );  		xt_free_node( node ); +		return 0;  	}  	jabber_cache_add( ic, query, jabber_iq_parse_features ); @@ -647,7 +648,7 @@ xt_status jabber_iq_parse_features( struct im_connection *ic, struct xt_node *no  	if( ( bud = jabber_buddy_by_jid( ic, xt_find_attr( node, "from") , 0 ) ) == NULL )  	{  		/* Who cares about the unknown... */ -		imcb_log( ic, "Couldnt find the man: %s", xt_find_attr( node, "from")); +		imcb_log( ic, "Couldn't find buddy: %s", xt_find_attr( node, "from"));  		return 0;  	} diff --git a/protocols/jabber/s5bytestream.c b/protocols/jabber/s5bytestream.c index 1008f162..15696501 100644 --- a/protocols/jabber/s5bytestream.c +++ b/protocols/jabber/s5bytestream.c @@ -25,6 +25,16 @@  #include "sha1.h"  #include <poll.h> +/* Some ifdefs for ulibc (Thanks to Whoopie) */ +#ifndef HOST_NAME_MAX +#include <sys/param.h> +#ifdef MAXHOSTNAMELEN +#define HOST_NAME_MAX MAXHOSTNAMELEN +#else +#define HOST_NAME_MAX 255 +#endif +#endif +  struct bs_transfer {  	struct jabber_transfer *tf; @@ -1047,10 +1057,14 @@ gboolean jabber_bs_send_handshake( gpointer data, gint fd, b_input_condition con  		{  			struct socks5_message socks5_connect;  			int msgsize = sizeof( struct socks5_message ); +			int ret; -			if( !jabber_bs_peek( bt, &socks5_connect, msgsize ) ) +			if( !( ret = jabber_bs_peek( bt, &socks5_connect, msgsize ) ) )  				return FALSE; +			if( ret < msgsize ) +				return TRUE; +  			if( !( socks5_connect.ver == 5) ||  			    !( socks5_connect.cmdrep.cmd == 1 ) ||  			    !( socks5_connect.atyp == 3 ) || | 
