From: Philip S T. <blu...@us...> - 2005-10-22 20:05:22
|
Update of /cvsroot/ayttm/ayttm/modules/jabber/libjabber In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3030/libjabber Modified Files: jconn.c Log Message: allow overriding of connect server Index: jconn.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/jabber/libjabber/jconn.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- jconn.c 18 Oct 2003 23:49:03 -0000 1.8 +++ jconn.c 22 Oct 2005 20:05:13 -0000 1.9 @@ -39,12 +39,13 @@ * parameters * user -- jabber id of the user * pass -- password of the user + * serv -- connection server (overrides domain in JID) * * results * a pointer to the connection structure * or NULL if allocations failed */ -jconn jab_new(char *user, char *pass) +jconn jab_new(char *user, char *pass, char *serv) { pool p; jconn j; @@ -59,6 +60,7 @@ j->user = jid_new(p, user); j->pass = pstrdup(p, pass); + j->serv = pstrdup(p, serv); j->state = JCONN_STATE_OFF; j->id = 1; @@ -134,7 +136,11 @@ #endif j->user->port = port; - if ((tag = proxy_connect_host(j->user->server, port, + + if (!j->serv || !strlen(j->serv)) + j->serv = j->user->server; + + if ((tag = proxy_connect_host(j->serv, port, (ay_socket_callback)jab_continue, j, NULL)) < 0) { STATE_EVT(JCONN_STATE_OFF); return 0; |