comparison libpurple/protocols/gg/lib/dcc.c @ 32827:4a34689eeb33 default tip

merged from im.pidgin.pidgin
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 19 Nov 2011 14:42:54 +0900
parents e2ff2ac0e022
children
comparison
equal deleted inserted replaced
32692:0f94ec89f0bc 32827:4a34689eeb33
24 * \file dcc.c 24 * \file dcc.c
25 * 25 *
26 * \brief Obsługa połączeń bezpośrednich do wersji Gadu-Gadu 6.x 26 * \brief Obsługa połączeń bezpośrednich do wersji Gadu-Gadu 6.x
27 */ 27 */
28 28
29 #include "compat.h"
29 #include <sys/types.h> 30 #include <sys/types.h>
30 #include <sys/stat.h> 31 #include <sys/stat.h>
31 #ifndef _WIN32 32 #ifdef sun
32 # include <sys/ioctl.h> 33 # include <sys/filio.h>
33 # include <sys/socket.h>
34 # include <netinet/in.h>
35 # include <arpa/inet.h>
36 # ifdef sun
37 # include <sys/filio.h>
38 # endif
39 #endif 34 #endif
40 35
41 #include <ctype.h> 36 #include <ctype.h>
42 #include <errno.h> 37 #include <errno.h>
43 #include <fcntl.h> 38 #include <fcntl.h>
599 594
600 if (h->type == GG_SESSION_DCC_SOCKET) { 595 if (h->type == GG_SESSION_DCC_SOCKET) {
601 struct sockaddr_in sin; 596 struct sockaddr_in sin;
602 struct gg_dcc *c; 597 struct gg_dcc *c;
603 int fd, one = 1; 598 int fd, one = 1;
604 unsigned int sin_len = sizeof(sin); 599 socklen_t sin_len = sizeof(sin);
605 600
606 if ((fd = accept(h->fd, (struct sockaddr*) &sin, &sin_len)) == -1) { 601 if ((fd = accept(h->fd, (struct sockaddr*) &sin, &sin_len)) == -1) {
607 gg_debug(GG_DEBUG_MISC, "// gg_dcc_watch_fd() can't accept() new connection (errno=%d, %s)\n", errno, strerror(errno)); 602 gg_debug(GG_DEBUG_MISC, "// gg_dcc_watch_fd() can't accept() new connection (errno=%d, %s)\n", errno, strerror(errno));
608 return e; 603 return e;
609 } 604 }
646 } else { 641 } else {
647 struct gg_dcc_tiny_packet tiny; 642 struct gg_dcc_tiny_packet tiny;
648 struct gg_dcc_small_packet small; 643 struct gg_dcc_small_packet small;
649 struct gg_dcc_big_packet big; 644 struct gg_dcc_big_packet big;
650 int size, tmp, res; 645 int size, tmp, res;
651 unsigned int utmp, res_size = sizeof(res); 646 unsigned int utmp;
647 socklen_t res_size = sizeof(res);
652 char buf[1024], ack[] = "UDAG"; 648 char buf[1024], ack[] = "UDAG";
653 649
654 struct gg_dcc_file_info_packet { 650 struct gg_dcc_file_info_packet {
655 struct gg_dcc_big_packet big; 651 struct gg_dcc_big_packet big;
656 struct gg_file_info file_info; 652 struct gg_file_info file_info;