Mercurial > pidgin
comparison src/protocols/oscar/ft.c @ 9430:30a812571a6b
[gaim-migrate @ 10250]
I haven't tested this, but it should be ok. Read my note.
Also, I'm using PF_INET instead of AF_INET for the reasons
given at
http://www.ecst.csuchico.edu/~beej/guide/net/html/syscalls.html#socket
(This is one of those things were it doesn't matter but
it feels more correct.)
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 30 Jun 2004 03:52:22 +0000 |
parents | f13172eed3ad |
children | 6f2a90c36ee2 |
comparison
equal
deleted
inserted
replaced
9429:a3e3c71d995a | 9430:30a812571a6b |
---|---|
59 | 59 |
60 #ifdef _WIN32 | 60 #ifdef _WIN32 |
61 #include "win32dep.h" | 61 #include "win32dep.h" |
62 #endif | 62 #endif |
63 | 63 |
64 /* | |
65 * I really want to switch all our networking code to using IPv6 only, | |
66 * but that really isn't a good idea at all. Evan S. of Adium says | |
67 * OS X sets all connections as "AF_INET6/PF_INET6," even if there is | |
68 * nothing inherently IPv6 about them. And I feel like Linux kernel | |
69 * 2.6.5 is doing the same thing. So we REALLY should accept | |
70 * connections if they're showing up as IPv6. Old OSes (Solaris?) | |
71 * that might not have full IPv6 support yet will fail if we try | |
72 * to use PF_INET6 but it isn't defined. --Mark Doliner | |
73 */ | |
74 #ifndef PF_INET6 | |
75 #define PF_INET6 PF_INET | |
76 #endif | |
77 | |
64 struct aim_odc_intdata { | 78 struct aim_odc_intdata { |
65 fu8_t cookie[8]; | 79 fu8_t cookie[8]; |
66 char sn[MAXSNLEN+1]; | 80 char sn[MAXSNLEN+1]; |
67 char ip[22]; | 81 char ip[22]; |
68 }; | 82 }; |
178 unsigned short port; | 192 unsigned short port; |
179 | 193 |
180 if ((acceptfd = accept(cur->fd, &addr, &addrlen)) == -1) | 194 if ((acceptfd = accept(cur->fd, &addr, &addrlen)) == -1) |
181 return 0; /* not an error */ | 195 return 0; /* not an error */ |
182 | 196 |
183 /* Also accept inet6? */ | 197 if ((addr.sa_family != PF_INET) && (addr.sa_family != PF_INET6)) { |
184 if (addr.sa_family != AF_INET) { | |
185 close(acceptfd); | 198 close(acceptfd); |
186 aim_conn_close(cur); | 199 aim_conn_close(cur); |
187 return -1; | 200 return -1; |
188 } | 201 } |
189 | 202 |