- Timestamp:
- 2008-06-15T18:11:47Z (17 years ago)
- Branches:
- master
- Children:
- d419073
- Parents:
- 5ec4129
- Location:
- protocols/jabber
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
r5ec4129 r7f69740 37 37 GSList *jabber_connections; 38 38 39 /* First enty is the default */ 40 static const int jabber_port_list[] = { 41 5222, 42 5223, 43 5220, 44 5221, 45 5224, 46 5225, 47 5226, 48 5227, 49 5228, 50 5229, 51 80, 52 443, 53 0 54 }; 55 39 56 static void jabber_init( account_t *acc ) 40 57 { 41 58 set_t *s; 42 43 s = set_add( &acc->set, "port", JABBER_PORT_DEFAULT, set_eval_int, acc ); 59 char str[16]; 60 61 g_snprintf( str, sizeof( str ), "%d", jabber_port_list[0] ); 62 s = set_add( &acc->set, "port", str, set_eval_int, acc ); 44 63 s->flags |= ACC_SET_OFFLINE_ONLY; 45 64 … … 72 91 struct ns_srv_reply *srv = NULL; 73 92 char *connect_to, *s; 93 int i; 74 94 75 95 /* For now this is needed in the _connected() handlers if using … … 177 197 imcb_log( ic, "Connecting" ); 178 198 179 if( set_getint( &acc->set, "port" ) < JABBER_PORT_MIN || 180 set_getint( &acc->set, "port" ) > JABBER_PORT_MAX ) 181 { 182 imcb_log( ic, "Incorrect port number, must be in the %d-%d range", 183 JABBER_PORT_MIN, JABBER_PORT_MAX ); 199 for( i = 0; jabber_port_list[i] > 0; i ++ ) 200 if( set_getint( &acc->set, "port" ) == jabber_port_list[i] ) 201 break; 202 203 if( jabber_port_list[i] == 0 ) 204 { 205 imcb_log( ic, "Illegal port number" ); 184 206 imc_logout( ic, FALSE ); 185 207 return; -
protocols/jabber/jabber.h
r5ec4129 r7f69740 134 134 135 135 #define JABBER_XMLCONSOLE_HANDLE "xmlconsole" 136 137 #define JABBER_PORT_DEFAULT "5222"138 #define JABBER_PORT_MIN 5220139 #define JABBER_PORT_MAX 5229140 136 141 137 /* Prefixes to use for packet IDs (mainly for IQ packets ATM). Usually the
Note: See TracChangeset
for help on using the changeset viewer.