comparison src/network.c @ 8250:b248c1f4efbd

[gaim-migrate @ 8973] 1) Minor changes to the network listen code again. Tim, let me know if you have any other suggestions. 2) Changed how charsets are handled in oscar a tad bit. I think this should guarantee that Gaim doesn't crash when people send funky messages, or have funky away messages or really anything that is using a charset that isn't utf8, iso-8859-1, ucs-2be, or ascii. Ethan, this should fix the problem with that person's away message. Although, the message itself still looks kinda funky to me. The encoding is Windows-31J, which is apparently a valid iconv encoding? You would know more than I. 3) Fix the following crash: 1. IM yourself a message on AIM 2. Do NOT begin to type a second message, but instead hit CTRL+up committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 13 Feb 2004 05:37:12 +0000
parents fabcfd9a7c1c
children 86b8d8b4287e
comparison
equal deleted inserted replaced
8249:b51ed4506180 8250:b248c1f4efbd
187 187
188 gaim_debug_info("network", "Listening on port: %hu\n", gaim_network_get_port_from_fd(listenfd)); 188 gaim_debug_info("network", "Listening on port: %hu\n", gaim_network_get_port_from_fd(listenfd));
189 return listenfd; 189 return listenfd;
190 } 190 }
191 191
192 int gaim_network_listen(short port) 192 int gaim_network_listen(unsigned short port)
193 { 193 {
194 g_return_val_if_fail(port != 0, -1);
195
194 return gaim_network_do_listen(port); 196 return gaim_network_do_listen(port);
195 } 197 }
196 198
197 int gaim_network_listen_range(short start, short end) 199 int gaim_network_listen_range(unsigned short start, unsigned short end)
198 { 200 {
199 int ret = -1; 201 int ret = -1;
200 202
201 if (gaim_prefs_get_bool("/core/network/ports_range_use") || 203 if (gaim_prefs_get_bool("/core/network/ports_range_use")) {
202 (start > end) || (start < 0) || (end < 0)) {
203 start = gaim_prefs_get_int("/core/network/ports_range_start"); 204 start = gaim_prefs_get_int("/core/network/ports_range_start");
204 end = gaim_prefs_get_int("/core/network/ports_range_end"); 205 end = gaim_prefs_get_int("/core/network/ports_range_end");
206 } else {
207 if (end < start)
208 end = start;
205 } 209 }
206 210
207 for (; start <= end; start++) { 211 for (; start <= end; start++) {
208 ret = gaim_network_do_listen(start); 212 ret = gaim_network_do_listen(start);
209 if (ret >= 0) 213 if (ret >= 0)