comparison src/protocols/oscar/ft.c @ 10271:361c9170d8af

[gaim-migrate @ 11420] This is a better way to do the aim logout thing. I don't know why I did it the other way. That's a lie, I know why. It's because I'm dumb. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 27 Nov 2004 16:09:31 +0000
parents 9cafe038c95e
children 33746d45bd0d
comparison
equal deleted inserted replaced
10270:e5451763f5b9 10271:361c9170d8af
194 if ((acceptfd = accept(cur->fd, &addr, &addrlen)) == -1) 194 if ((acceptfd = accept(cur->fd, &addr, &addrlen)) == -1)
195 return 0; /* not an error */ 195 return 0; /* not an error */
196 196
197 if ((addr.sa_family != PF_INET) && (addr.sa_family != PF_INET6)) { 197 if ((addr.sa_family != PF_INET) && (addr.sa_family != PF_INET6)) {
198 close(acceptfd); 198 close(acceptfd);
199 aim_conn_close(sess, cur); 199 aim_conn_close(cur);
200 return -1; 200 return -1;
201 } 201 }
202 202
203 strncpy(ip, inet_ntoa(((struct sockaddr_in *)&addr)->sin_addr), sizeof(ip)); 203 strncpy(ip, inet_ntoa(((struct sockaddr_in *)&addr)->sin_addr), sizeof(ip));
204 port = ntohs(((struct sockaddr_in *)&addr)->sin_port); 204 port = ntohs(((struct sockaddr_in *)&addr)->sin_port);
205 205
206 if (!(newconn = aim_cloneconn(sess, cur))) { 206 if (!(newconn = aim_cloneconn(sess, cur))) {
207 close(acceptfd); 207 close(acceptfd);
208 aim_conn_close(sess, cur); 208 aim_conn_close(cur);
209 return -ENOMEM; 209 return -ENOMEM;
210 } 210 }
211 211
212 newconn->type = AIM_CONN_TYPE_RENDEZVOUS; 212 newconn->type = AIM_CONN_TYPE_RENDEZVOUS;
213 newconn->fd = acceptfd; 213 newconn->fd = acceptfd;
230 if ((userfunc = aim_callhandler(sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_ESTABLISHED))) 230 if ((userfunc = aim_callhandler(sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_ESTABLISHED)))
231 ret = userfunc(sess, NULL, newconn, cur); 231 ret = userfunc(sess, NULL, newconn, cur);
232 232
233 } else { 233 } else {
234 faimdprintf(sess, 1,"Got a connection on a listener that's not rendezvous. Closing connection.\n"); 234 faimdprintf(sess, 1,"Got a connection on a listener that's not rendezvous. Closing connection.\n");
235 aim_conn_close(sess, newconn); 235 aim_conn_close(newconn);
236 ret = -1; 236 ret = -1;
237 } 237 }
238 238
239 return ret; 239 return ret;
240 } 240 }
930 930
931 free(header); 931 free(header);
932 } 932 }
933 933
934 if (ret == -1) 934 if (ret == -1)
935 aim_conn_close(sess, conn); 935 aim_conn_close(conn);
936 936
937 return ret; 937 return ret;
938 } 938 }