Mercurial > pidgin.yaz
comparison src/protocols/simple/simple.c @ 12769:a90255f67652
[gaim-migrate @ 15116]
Use the user specified port instead of the SRV one if the user
explicitly sets a port in the account prefs.
committer: Tailor Script <tailor@pidgin.im>
author | Thomas Butter <tbutter> |
---|---|
date | Sun, 08 Jan 2006 22:50:34 +0000 |
parents | 3f6f2d59bcb4 |
children | ab00cea25ef2 |
comparison
equal
deleted
inserted
replaced
12768:3f6f2d59bcb4 | 12769:a90255f67652 |
---|---|
1248 int error = 0; | 1248 int error = 0; |
1249 | 1249 |
1250 /* find the host to connect to */ | 1250 /* find the host to connect to */ |
1251 if(results) { | 1251 if(results) { |
1252 hostname = g_strdup(resp->hostname); | 1252 hostname = g_strdup(resp->hostname); |
1253 /* TODO: Should this work more like Jabber where the SRV value will be ignored | 1253 if(!port) |
1254 * if there is one manually specified? */ | 1254 port = resp->port; |
1255 port = resp->port; | |
1256 g_free(resp); | 1255 g_free(resp); |
1257 } else { | 1256 } else { |
1258 if(!gaim_account_get_bool(sip->account, "useproxy", FALSE)) { | 1257 if(!gaim_account_get_bool(sip->account, "useproxy", FALSE)) { |
1259 hostname = g_strdup(sip->servername); | 1258 hostname = g_strdup(sip->servername); |
1260 } else { | 1259 } else { |
1262 } | 1261 } |
1263 } | 1262 } |
1264 | 1263 |
1265 sip->realhostname = hostname; | 1264 sip->realhostname = hostname; |
1266 sip->realport = port; | 1265 sip->realport = port; |
1266 if(!sip->realport) sip->realport = 5060; | |
1267 /* TCP case */ | 1267 /* TCP case */ |
1268 if(! sip->udp) { | 1268 if(! sip->udp) { |
1269 /* create socket for incoming connections */ | 1269 /* create socket for incoming connections */ |
1270 sip->listenfd = gaim_network_listen_range(5060, 5160, SOCK_STREAM); | 1270 sip->listenfd = gaim_network_listen_range(5060, 5160, SOCK_STREAM); |
1271 if(sip->listenfd == -1) { | 1271 if(sip->listenfd == -1) { |
1475 prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); | 1475 prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); |
1476 | 1476 |
1477 option = gaim_account_option_bool_new(_("Publish status (note: everyone may watch you)"), "dopublish", TRUE); | 1477 option = gaim_account_option_bool_new(_("Publish status (note: everyone may watch you)"), "dopublish", TRUE); |
1478 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | 1478 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
1479 | 1479 |
1480 option = gaim_account_option_int_new(_("Connect port"), "port", 5060); | 1480 option = gaim_account_option_int_new(_("Connect port"), "port", 0); |
1481 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | 1481 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
1482 | 1482 |
1483 | 1483 |
1484 option = gaim_account_option_bool_new(_("Use UDP"), "udp", FALSE); | 1484 option = gaim_account_option_bool_new(_("Use UDP"), "udp", FALSE); |
1485 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | 1485 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |