Mercurial > pidgin.yaz
comparison src/network.c @ 11424:e1ab173ef3b5
[gaim-migrate @ 13661]
prefs for STUN
adjustments for NTLM in SIP
committer: Tailor Script <tailor@pidgin.im>
author | Thomas Butter <tbutter> |
---|---|
date | Fri, 02 Sep 2005 09:09:04 +0000 |
parents | 8caea199b018 |
children | 5f65a0cca87c |
comparison
equal
deleted
inserted
replaced
11423:202a3b3c5a88 | 11424:e1ab173ef3b5 |
---|---|
142 const char * | 142 const char * |
143 gaim_network_get_my_ip(int fd) | 143 gaim_network_get_my_ip(int fd) |
144 { | 144 { |
145 const char *ip = NULL; | 145 const char *ip = NULL; |
146 GaimUPnPControlInfo* controlInfo = NULL; | 146 GaimUPnPControlInfo* controlInfo = NULL; |
147 struct stun_nattype *stun; | |
147 | 148 |
148 /* Check if the user specified an IP manually */ | 149 /* Check if the user specified an IP manually */ |
149 if (!gaim_prefs_get_bool("/core/network/auto_ip")) { | 150 if (!gaim_prefs_get_bool("/core/network/auto_ip")) { |
150 ip = gaim_network_get_public_ip(); | 151 ip = gaim_network_get_public_ip(); |
151 if (ip != NULL) | 152 if (ip != NULL) |
152 return ip; | 153 return ip; |
153 } | 154 } |
155 | |
156 if (ip == NULL || *ip == '\0') { | |
157 /* Check if STUN discovery was already done */ | |
158 stun = gaim_stun_discover(NULL); | |
159 if(stun && stun->status>1) | |
160 return stun->publicip; | |
161 } | |
162 | |
154 | 163 |
155 /* attempt to get the ip from a NAT device */ | 164 /* attempt to get the ip from a NAT device */ |
156 if ((controlInfo = gaim_upnp_discover()) != NULL) { | 165 if ((controlInfo = gaim_upnp_discover()) != NULL) { |
157 ip = gaim_upnp_get_public_ip(controlInfo); | 166 ip = gaim_upnp_get_public_ip(controlInfo); |
158 g_free(controlInfo->controlURL); | 167 g_free(controlInfo->controlURL); |