| 81 * |
81 * |
| 82 * patrz gg_send_message_ctcp(). |
82 * patrz gg_send_message_ctcp(). |
| 83 */ |
83 */ |
| 84 int gg_dcc_request(struct gg_session *sess, uin_t uin) |
84 int gg_dcc_request(struct gg_session *sess, uin_t uin) |
| 85 { |
85 { |
| 86 return gg_send_message_ctcp(sess, GG_CLASS_CTCP, uin, "\002", 1); |
86 return gg_send_message_ctcp(sess, GG_CLASS_CTCP, uin, (const unsigned char *)"\002", 1); |
| 87 } |
87 } |
| 88 |
88 |
| 89 /* |
89 /* |
| 90 * gg_dcc_fill_filetime() // funkcja wewnętrzna |
90 * gg_dcc_fill_filetime() // funkcja wewnętrzna |
| 91 * |
91 * |
| 225 *q = 175; |
225 *q = 175; |
| 226 } |
226 } |
| 227 } |
227 } |
| 228 |
228 |
| 229 gg_debug(GG_DEBUG_MISC, "// gg_dcc_fill_file_info2() short name \"%s\", dos name \"%s\"\n", name, d->file_info.short_filename); |
229 gg_debug(GG_DEBUG_MISC, "// gg_dcc_fill_file_info2() short name \"%s\", dos name \"%s\"\n", name, d->file_info.short_filename); |
| 230 strncpy(d->file_info.filename, name, sizeof(d->file_info.filename) - 1); |
230 strncpy((char *)d->file_info.filename, name, sizeof(d->file_info.filename) - 1); |
| 231 |
231 |
| 232 return 0; |
232 return 0; |
| 233 } |
233 } |
| 234 |
234 |
| 235 /* |
235 /* |
| 566 e->type = GG_EVENT_NONE; |
566 e->type = GG_EVENT_NONE; |
| 567 |
567 |
| 568 if (h->type == GG_SESSION_DCC_SOCKET) { |
568 if (h->type == GG_SESSION_DCC_SOCKET) { |
| 569 struct sockaddr_in sin; |
569 struct sockaddr_in sin; |
| 570 struct gg_dcc *c; |
570 struct gg_dcc *c; |
| 571 int fd, sin_len = sizeof(sin), one = 1; |
571 int fd; |
| |
572 socklen_t sin_len = sizeof(sin); |
| |
573 int one = 1; |
| 572 |
574 |
| 573 if ((fd = accept(h->fd, (struct sockaddr*) &sin, &sin_len)) == -1) { |
575 if ((fd = accept(h->fd, (struct sockaddr*) &sin, &sin_len)) == -1) { |
| 574 gg_debug(GG_DEBUG_MISC, "// gg_dcc_watch_fd() can't accept() new connection (errno=%d, %s)\n", errno, strerror(errno)); |
576 gg_debug(GG_DEBUG_MISC, "// gg_dcc_watch_fd() can't accept() new connection (errno=%d, %s)\n", errno, strerror(errno)); |
| 575 return e; |
577 return e; |
| 576 } |
578 } |
| 612 return e; |
614 return e; |
| 613 } else { |
615 } else { |
| 614 struct gg_dcc_tiny_packet tiny; |
616 struct gg_dcc_tiny_packet tiny; |
| 615 struct gg_dcc_small_packet small; |
617 struct gg_dcc_small_packet small; |
| 616 struct gg_dcc_big_packet big; |
618 struct gg_dcc_big_packet big; |
| 617 int size, tmp, res, res_size = sizeof(res); |
619 int size, tmp, res; |
| |
620 socklen_t res_size = sizeof(res); |
| 618 unsigned int utmp; |
621 unsigned int utmp; |
| 619 char buf[1024], ack[] = "UDAG"; |
622 char buf[1024], ack[] = "UDAG"; |
| 620 |
623 |
| 621 struct gg_dcc_file_info_packet { |
624 struct gg_dcc_file_info_packet { |
| 622 struct gg_dcc_big_packet big; |
625 struct gg_dcc_big_packet big; |