Lines Matching refs:Client

202    DCC_list **Client, *NewClient;  local
204 for (Client = (&ClientList); *Client ; Client = (&(**Client).next))
206 if ((((**Client).flags&DCC_TYPES) != type))
208 if (my_stricmp(user, (**Client).user) != 0)
210 if ((!name || (my_stricmp(name, (**Client).description) == 0)) ||
211 (othername && (**Client).othername
212 && (my_stricmp(othername, (**Client).othername)) == 0))
213 return *Client;
218 *Client = NewClient = (DCC_list *) dma_Malloc(sizeof(DCC_list));
262 DCC_list **Client; local
264 for (Client = &ClientList; *Client; Client = &(**Client).next)
265 if (*Client == Element)
267 *Client = Element->next;
301 DCC_list *Client; local
303 for (Client = ClientList; Client != NULL; Client = Client->next)
306 if (Client->write != -1 && (Client->flags & DCC_CNCT_PEND))
307 FD_SET(Client->write, wd);
309 if (Client->read != -1)
310 FD_SET(Client->read, rd);
323 DCC_list **Client, *tmp; local
332 for (Client = (&ClientList); *Client != NULL && !break_io_processing;)
338 if ((*Client)->flags & DCC_CNCT_PEND)
343 if (getpeername((*Client)->read, (struct sockaddr *)&remaddr, &rl) != -1)
345 if ((*Client)->flags & DCC_OFFER)
347 (*Client)->flags &= ~DCC_OFFER;
349 message_from((*Client)->user, LOG_DCC);
351 if (((*Client)->flags & DCC_TYPES) != DCC_RAW)
353 dcc_types[(*Client)->flags&DCC_TYPES], (*Client)->user,
356 if (((*Client)->flags & DCC_TYPES) == DCC_CHAT)
357 add_tab_key(0, "msg =", (*Client)->user);
358 else if (((*Client)->flags & DCC_TYPES) == DCC_FILEREAD)
361 (*Client)->file = open((*Client)->description, O_WRONLY | O_TRUNC | O_CREAT, 0600);
362 if ((*Client)->file == -1)
364 tmp = *Client;
365 Client = (&(**Client).next);
372 (*Client)->starttime = time(NULL);
373 (*Client)->flags &= ~DCC_CNCT_PEND;
374 set_blocking((*Client)->read);
375 if ((*Client)->read != (*Client)->write)
376 set_blocking((*Client)->write);
380 if ((*Client)->read != -1 && FD_ISSET((*Client)->read, rd))
382 switch((*Client)->flags & DCC_TYPES)
385 process_incoming_chat(*Client);
388 process_incoming_listen(*Client);
391 process_incoming_raw(*Client);
394 process_outgoing_file(*Client);
397 process_incoming_file(*Client);
400 process_incoming_talk(*Client);
404 if ((*Client)->flags & DCC_DELETE)
406 dcc_add_deadclient(*Client);
407 Client = (&(**Client).next);
410 Client = (&(**Client).next);
452 dcc_open(Client) in dcc_open() argument
453 DCC_list *Client; in dcc_open()
465 user = Client->user;
472 Type = dcc_types[Client->flags & DCC_TYPES];
473 if (Client->flags & DCC_OFFER)
476 Client->flags |= DCC_CNCT_PEND;
478 if ((Client->write = connect_by_number(Client->remport,
479 UP(inet_ntoa(Client->remote)), 1)) < 0)
483 if ((Client->write) != -5)
486 dcc_erase(Client);
490 Client->read = Client->write;
492 Client->bytes_read = Client->bytes_sent = 0L;
493 Client->flags |= DCC_ACTIVE;
495 Client->flags &= ~DCC_OFFER;
496 Client->starttime = time(NULL);
497 if (getpeername(Client->read, (struct sockaddr *)&remaddr, &rl) == -1)
503 dcc_erase(Client);
507 if ((Client->flags & DCC_TYPES) != DCC_RAW)
511 if ((Client->file = open(Client->description, O_WRONLY | O_TRUNC | O_CREAT, 0600)) == -1)
515 put_error("DCC: Unable to open %s: %s", Client->description, strerror(errno));
517 dcc_erase(Client);
547 Client->flags |= DCC_WAIT|DCC_CNCT_PEND;
549 Client->flags |= DCC_WAIT;
551 if ((Client->read = connect_by_number(0, empty_string, 1)) < 0)
555 if (Client->read != -5)
559 dcc_erase(Client);
564 getsockname(Client->read, (struct sockaddr *) &localaddr, &sla);
565 if (Client->flags & DCC_TWOCLIENTS)
570 if ((Client->flags & DCC_FILEOFFER) &&
571 (nopath = my_rindex(Client->description, '/')))
574 nopath = Client->description;
582 if (Client->filesize)
587 (long)Client->filesize);
594 if (!(Client->flags & DCC_FILEOFFER))
610 Client->starttime = 0;
621 DCC_list *Client; local
628 Client = dcc_searchlist(UP("chat"), user, DCC_CHAT, 1, (u_char *) 0, 0);
629 if ((Client->flags&DCC_ACTIVE) || (Client->flags&DCC_WAIT))
634 Client->flags |= DCC_TWOCLIENTS;
635 dcc_open(Client);
642 DCC_list *Client; local
658 Client = dcc_searchlist(UP("raw_listen"), PortName, DCC_RAW_LISTEN, 1, (u_char *) 0, 0);
659 if (Client->flags & DCC_ACTIVE)
669 if (0 > (Client->read = getTCPSock()))
671 dcc_erase(Client);
676 set_socket_options(Client->read);
677 if (bind(Client->read, (struct sockaddr *) &locaddr, sizeof(locaddr)) == -1)
679 dcc_erase(Client);
684 listen(Client->read, 4);
686 Client->starttime = time((time_t *) 0);
687 getsockname(Client->read, (struct sockaddr *) &locaddr, &size);
688 Client->write = ntohs(locaddr.sin_port);
689 Client->flags |= DCC_ACTIVE;
690 sprintf(CP(PortName), "%d", Client->write);
691 dma_strcpy(&Client->user, PortName);
702 DCC_list *Client; local
717 Client = dcc_searchlist(host, PortName, DCC_RAW, 1, (u_char *) 0, 0);
718 if (Client->flags & DCC_ACTIVE)
724 Client->remport = port;
725 bcopy((char *) &address, (char *) &Client->remote, sizeof(address));
726 Client->flags = DCC_OFFER | DCC_RAW;
727 if (!dcc_open(Client))
729 sprintf(CP(PortName), "%d", Client->read);
730 dma_strcpy(&Client->user, PortName);
761 DCC_list *Client; local
781 Client = dcc_searchlist(host, user, DCC_TALK, 1, (u_char *) 0, 0);
782 if (Client->flags & DCC_ACTIVE || Client->flags & DCC_WAIT)
785 ntohs(Client->remport));
790 if (!resolve_host(&(Client->remote), host))
793 dcc_erase(Client);
798 bcopy((char *) &MyHostAddr, (char *) &(Client->remote),
800 if ((Client->file = connect_by_number(-1, empty_string, 0)) < 0)
802 if (Client->file != -5)
805 dcc_erase(Client);
809 if (!(status = send_talk_control(Client, DCC_TALK_CHECK)))
811 dcc_erase(Client);
815 if (--status || (Client->read = connect_by_number(Client->remport,
816 UP(inet_ntoa(Client->remote)), 0)) < 0)
818 put_info("DCC: Inviting %s@%s for a TALK.", Client->user, Client->description);
819 if ((Client->read = connect_by_number(0, empty_string, 0)) == -1 ||
820 !send_talk_control(Client, DCC_TALK_INVITE) ||
821 !(status=send_talk_control(Client, DCC_TALK_ANNOUNCE)))
823 send_talk_control(Client, DCC_TALK_DELETE_LOCAL);
824 dcc_erase(Client);
830 dcc_erase(Client);
834 Client->flags |= DCC_WAIT;
838 put_info("DCC: TALK connection to %s@%s:%d established.", Client->user, Client->description,
839 ntohs(Client->remport));
840 time(&(Client->starttime));
841 Client->write = Client->read;
842 send(Client->write, "\008\025\027", 3, 0);
843 recv(Client->read, CP(Client->talkchars), 3, 0);
844 Client->bytes_read = Client->bytes_sent = 3;
845 Client->flags |= DCC_ACTIVE;
855 DCC_list *Client; local
869 Client = dcc_searchlist(host, user, DCC_SUMMON, 1, (u_char *) 0, 0);
873 if (!resolve_host(&(Client->remote), host))
876 dcc_erase(Client);
881 bcopy((char *) &MyHostAddr, (char *) &(Client->remote),
883 if ((Client->file = connect_by_number(-1, empty_string, 0)) < 0)
885 if (Client->file != -5)
890 if (0 == send_talk_control(Client, DCC_TALK_SUMMON))
892 send_talk_control(Client, DCC_TALK_DELETE_SUMMON);
893 dcc_erase(Client);
897 send_talk_control(Client, MessageType) in send_talk_control() argument
898 DCC_list *Client; in send_talk_control()
915 getsockname(Client->file, (struct sockaddr *) &SockAddr, &dummy);
917 if (Client->read > 0)
919 getsockname(Client->read, (struct sockaddr *) &SockAddr,
926 my_strncpy(Message.r_name, Client->user, NAME_SIZE);
930 SockAddr.sin_addr = Client->remote;
969 if (sendto(Client->file, (char *) &Message, sizeof(Message), 0,
979 FD_SET(Client->file, &selset);
980 switch(select(Client->file+1, &selset, NULL, NULL, &time_out))
988 recv(Client->file, (char *) &Response, sizeof(Response), 0);
990 FD_SET(Client->file, &selset);
994 while (select(Client->file + 1, &selset, NULL, NULL,
1003 Client->remote = SockAddr.sin_addr;
1004 Client->remport = ntohs(SockAddr.sin_port);
1111 DCC_list *Client; local
1148 if (0 == (Client = dcc_searchlist(filename, user, DCC_FILEREAD, 0, (u_char *) 0, 0)))
1159 dcc_getbyptr(Client);
1175 DCC_list *Client; local
1221 Client = dcc_searchlist(description, user, CType, 1, (u_char *) 0, filesize);
1223 if (Client->flags & DCC_WAIT)
1225 dcc_erase(Client);
1228 Client = dcc_searchlist(description, user, CType, 1, (u_char *) 0, 0);
1239 if (Client->flags & DCC_ACTIVE)
1244 Client->flags |= DCC_OFFER;
1246 Client->remote.s_addr = htonl(TempLong);
1248 Client->remport = TempInt;
1252 dcc_erase(Client);
1255 if ((u_long) 0 == TempLong || 0 == Client->remport)
1259 dcc_erase(Client);
1273 else if (Client->filesize)
1277 put_info(mfmt, type, description, ninja_size(Client->filesize),
1278 user, ninja_host(Client->remote), port);
1281 add_to_awaylog(mfmt, type, description, ninja_size(Client->filesize),
1282 user, ninja_host(Client->remote), port);
1323 dcc_getbyptr(Client);
1327 if (Client->filesize > sb.st_size)
1359 dcc_closebyptr(Client);
1378 user, ninja_host(Client->remote), port);
1381 user, ninja_host(Client->remote), port);
1417 process_incoming_chat(Client) in process_incoming_chat() argument
1418 DCC_list *Client; in process_incoming_chat()
1430 message_from(Client->user, LOG_DCC);
1431 if (Client->flags & DCC_WAIT)
1434 Client->write = accept(Client->read, (struct sockaddr *)
1437 mark_socket(Client->write);
1439 new_close(Client->read);
1440 Client->read = Client->write;
1441 Client->flags &= ~DCC_WAIT;
1442 Client->flags |= DCC_ACTIVE;
1443 put_info("DCC: chat connection to %s[%s:%d] established.", Client->user,
1445 add_tab_key(0, "msg =", Client->user);
1446 Client->starttime = time(NULL);
1449 s = Client->buffer;
1460 bytesread = dgets(bufptr, (int)((BIG_BUFFER_SIZE/2) - len), Client->read, (u_char *) 0);
1465 add_to_dcc_buffer(Client, bufptr);
1466 if (Client->buffer && (my_strlen(Client->buffer) > BIG_BUFFER_SIZE/2))
1468 dma_Free(&Client->buffer);
1469 put_error("DCC: dropped long CHAT message from %s", Client->user);
1473 …put_error("DCC: CHAT connection to %s lost: %s", Client->user, dgets_errno == -1 ? "Remote end clo…
1474 new_close(Client->read);
1475 Client->read = Client->write = -1;
1476 Client->flags |= DCC_DELETE;
1479 dma_Free(&Client->buffer);
1483 Client->bytes_read += len;
1485 strmcpy(tmpuser+1, Client->user, IRCD_BUFFER_SIZE-2);
1491 if (do_hook(DCC_CHAT_LIST, "%s %s", Client->user, s))
1494 add_to_awaylog("=%s= %s", Client->user, s);
1495 put_it("=%s= %s", Client->user, s);
1497 add_tab_key(0, "msg =", Client->user);
1512 process_incoming_listen(Client) in process_incoming_listen() argument
1513 DCC_list *Client; in process_incoming_listen()
1524 new_socket = accept(Client->read, (struct sockaddr *) &remaddr,
1546 Client->write))
1550 Client->write);
1555 process_incoming_raw(Client) in process_incoming_raw() argument
1556 DCC_list *Client; in process_incoming_raw()
1565 message_from(Client->user, LOG_DCC);
1567 s = Client->buffer;
1578 switch(bytesread = dgets(bufptr, (int)((BIG_BUFFER_SIZE/2) - len), Client->read, (u_char *) 0))
1581 add_to_dcc_buffer(Client, bufptr);
1582 if (Client->buffer && (my_strlen(Client->buffer) > BIG_BUFFER_SIZE/2))
1584 dma_Free(&Client->buffer);
1585 put_error("DCC: dropping long RAW message from %s", Client->user);
1590 Client->user, Client->description))
1592 Client->user, Client->description);
1593 new_close(Client->read);
1594 Client->read = Client->write = -1;
1595 Client->flags |= DCC_DELETE;
1599 dma_Free(&Client->buffer);
1604 Client->bytes_read += len;
1606 Client->user, Client->description, tmp))
1608 Client->user, Client->description, tmp);
1615 process_incoming_talk(Client) in process_incoming_talk() argument
1616 DCC_list *Client; in process_incoming_talk()
1627 message_from(Client->user, LOG_DCC);
1628 if (Client->flags & DCC_WAIT)
1631 Client->write = accept(Client->read, (struct sockaddr *)
1634 mark_socket(Client->write);
1636 new_close(Client->read);
1637 Client->read = Client->write;
1638 Client->flags &= ~DCC_WAIT;
1639 Client->flags |= DCC_ACTIVE;
1640 send_talk_control(Client, DCC_TALK_DELETE_LOCAL);
1641 new_close(Client->file);
1642 send(Client->write, "\010\025\027", 3, 0);
1643 recv(Client->read, CP(Client->talkchars), 3, 0);
1644 Client->bytes_read = Client->bytes_sent = 3;
1645 put_info("DCC: TALK connection to %s@%s:%d established.", Client->user,
1649 s = Client->buffer;
1660 switch(bytesread = dgets(bufptr, (int)len - (BIG_BUFFER_SIZE/2), Client->read,
1661 Client->talkchars))
1666 add_to_dcc_buffer(Client, bufptr);
1667 if (Client->buffer && (my_strlen(Client->buffer) > BIG_BUFFER_SIZE/2))
1669 dma_Free(&Client->buffer);
1670 put_info("DCC: dropping long TALK message from %s", Client->user);
1675 put_info("DCC: TALK connection to %s lost", Client->user);
1676 new_close(Client->read);
1677 Client->read=Client->write = -1;
1678 Client->flags |= DCC_DELETE;
1682 dma_Free(&Client->buffer);
1687 Client->bytes_read += len;
1689 add_to_awaylog("@%s@ %s", Client->user, tmp);
1690 if (do_hook(TALK_LIST, "%s %s", Client->user, tmp))
1691 put_it("@%s@ %s", Client->user, tmp);
1692 add_tab_key(0, "msg @", Client->user);
1700 process_outgoing_file(Client) in process_outgoing_file() argument
1701 DCC_list *Client; in process_outgoing_file()
1711 message_from(Client->user, LOG_DCC);
1712 if (Client->flags & DCC_WAIT)
1715 Client->write = accept(Client->read,
1718 mark_socket(Client->write);
1720 new_close(Client->read);
1721 Client->read = Client->write;
1722 Client->flags &= ~DCC_WAIT;
1723 Client->flags |= DCC_ACTIVE;
1728 Client->starttime = time(NULL);
1729 if (Client->bytes_sent)
1730 put_info("DCC: SEND connection to %s[%s:%d] established, resuming at %s.", Client->user,
1731 ninja_host(remaddr.sin_addr), ntohs(remaddr.sin_port), ninja_size(Client->bytes_sent));
1733 put_info("DCC: SEND connection to %s[%s:%d] established.", Client->user,
1737 if ((Client->file = open(Client->description, O_RDONLY)) == -1)
1739 …put_error("DCC: Unable to open %s: %s", Client->description, errno ? strerror(errno) : "Unknown er…
1740 close(Client->read);
1741 Client->read = Client->write = (-1);
1742 Client->flags |= DCC_DELETE;
1746 if (Client->bytes_sent)
1747 lseek(Client->file, Client->bytes_sent, SEEK_SET);
1751 if ((bytesread = recv(Client->read, (char *) &bytesrecvd, sizeof(u_32int), 0)) < sizeof(u_32int))
1763 …put_error("DCC: SEND: of %s to %s lost: %s", strip_path(Client->description), Client->user, strerr…
1764 new_close(Client->read);
1765 Client->read = Client->write = (-1);
1766 Client->flags |= DCC_DELETE;
1767 new_close(Client->file);
1771 if (ntohl(bytesrecvd) != Client->bytes_sent)
1779 bytesread = read(Client->file, tmp, sizeof(tmp)-1);
1782 send(Client->write, CP(tmp), (size_t)bytesread, 0);
1783 Client->bytes_sent += bytesread;
1788 Client->flags |= DCC_DELETE;
1800 time_t xtime = time(NULL) - Client->starttime;
1801 double sent = (double)Client->bytes_sent;
1806 sent -= (double)Client->resume_offset;
1825 strip_path(Client->description), Client->user, ninja_etime(xtime), lame_ultrix, rate_unit);
1826 new_close(Client->read);
1827 Client->read = Client->write = -1;
1828 Client->flags |= DCC_DELETE;
1829 new_close(Client->file);
1836 process_incoming_file(Client) in process_incoming_file() argument
1837 DCC_list *Client; in process_incoming_file()
1850 if ((bytesread = recv(Client->read, CP(tmp), BlockSize, 0)) <= 0)
1860 time_t xtime = time(NULL) - Client->starttime;
1861 double sent = (double)Client->bytes_read;
1881 Client->flags |= DCC_DELETE;
1887 sent -= (double)Client->resume_offset;
1906 message_from(Client->user, LOG_DCC);
1908 strip_path(Client->description), Client->user, ninja_etime(xtime), lame_ultrix, rate_unit);
1910 new_close(Client->read);
1911 new_close(Client->file);
1912 Client->read = Client->write = (-1);
1913 Client->flags |= DCC_DELETE;
1916 write(Client->file, tmp, (size_t)bytesread);
1917 Client->bytes_read += bytesread;
1918 bytestemp = htonl(Client->bytes_read);
1919 send(Client->write, (char *)&bytestemp, sizeof(u_32int), 0);
1931 DCC_list *Client; local
1967 …if (!(Client = dcc_searchlist(host, user, type, 0, (u_char *) 0, 0)) || !(Client->flags&DCC_ACTIVE…
1977 if (Client->flags & DCC_CNCT_PEND)
1991 add_tab_key(0, "msg =", Client->user);
1994 add_tab_key(0, "msg @", Client->user);
2006 (void)writev(Client->write, iov, 2);
2013 (void)send(Client->write, line, len, 0);
2015 Client->bytes_sent += len;
2017 if (do_hook(list, "%s %s", Client->user, text))
2018 put_it("=> %c%s%c %s", thing, Client->user, thing, text);
2117 DCC_list *Client; local
2143 for (Client = ClientList ; Client != NULL ; Client = Client->next, count++)
2147 if (Client->flags & DCC_WAIT)
2148 …, sizeof(outstr)-1, wait_fmt, count, dcc_types[Client->flags & DCC_TYPES], Client->user, strip_pat…
2149 else if (Client->flags & DCC_OFFER)
2150 …, sizeof(outstr)-1, wait_fmt, count, dcc_types[Client->flags & DCC_TYPES], Client->user, strip_pat…
2152 else if (Client->flags & DCC_CNCT_PEND)
2153 …, sizeof(outstr)-1, wait_fmt, count, dcc_types[Client->flags & DCC_TYPES], Client->user, strip_pat…
2155 else if (Client->flags & DCC_ACTIVE)
2157 time_t eltime = (time(NULL) - Client->starttime);
2159 … if ((Client->flags & DCC_TYPES) == DCC_FILEREAD || (Client->flags & DCC_TYPES) == DCC_FILEOFFER)
2164 if ((Client->flags & DCC_TYPES) == DCC_FILEOFFER)
2165 bytes = (double)Client->bytes_sent;
2167 bytes = (double)Client->bytes_read;
2170 ratio = 100 * ((double)bytes / (double)Client->filesize);
2173 rate = (double)(bytes - Client->resume_offset);
2195 …, sizeof(outstr)-1, file_fmt, count, dcc_types[Client->flags & DCC_TYPES], Client->user, strip_pat…
2201 dma_strcpy(&this_sucks, ninja_size(Client->bytes_sent));
2203 ofmt, count, dcc_types[Client->flags & DCC_TYPES], Client->user,
2204 strip_path(Client->description), ninja_etime(eltime),
2205 this_sucks, ninja_size(Client->bytes_read));
2219 DCC_list *Client; local
2269 if (0 == (Client = dcc_searchlist(description, user, CType, 0, description, 0)))
2276 dcc_closebyptr(Client);
2302 DCC_list *Client; local
2317 if ((Client = dcc_searchlist(UP("chat"), user, DCC_CHAT, 0, (u_char *) 0, 0)))
2319 dma_Free(&(Client->user));
2320 dma_strcpy(&(Client->user), temp);
2332 DCC_list *Client; local
2358 if ((Client = dcc_searchlist(description, user, DCC_FILEREAD, 0, (u_char *) 0, 0)))
2360 if (!(Client->flags & DCC_OFFER))
2365 dma_Free(&(Client->description));
2366 dma_strcpy(&(Client->description), newdesc);
2386 DCC_list *Client; in close_all_dcc() local
2388 while ((Client = ClientList)) in close_all_dcc()
2389 dcc_erase(Client); in close_all_dcc()
2393 add_to_dcc_buffer(Client, buf) in add_to_dcc_buffer() argument
2394 DCC_list *Client; in add_to_dcc_buffer()
2399 if (Client->buffer)
2400 dma_strcat(&Client->buffer, buf);
2402 dma_strcpy(&Client->buffer, buf);
2425 dcc_getbyptr(Client) in dcc_getbyptr() argument
2426 DCC_list *Client; in dcc_getbyptr()
2428 if ((Client->flags & DCC_ACTIVE) || (Client->flags & DCC_WAIT))
2430 put_info("DCC: You're already getting \"%s\" from %s.", Client->description, Client->user);
2433 if (!(Client->flags & DCC_OFFER))
2443 Client->flags |= DCC_TWOCLIENTS;
2444 if (!dcc_open(Client))
2453 DCC_list *Client; local
2455 for (Client = ClientList; Client != NULL; Client = Client->next)
2456 if (((Client->flags & DCC_TYPES) == DCC_FILEREAD) && (Client->flags & DCC_OFFER))
2459 dcc_getbyptr(Client);
2460 else if (my_stricmp(user, Client->user) == 0)
2461 dcc_getbyptr(Client);
2474 DCC_list *Client; local
2488 if (!(Client = dcc_searchlist(filename, user, DCC_FILEREAD, 0, NULL, 0)))
2497 if (stat(Client->description, &sb) == -1)
2508 if ((Client->flags & DCC_ACTIVE) || (Client->flags & DCC_WAIT))
2514 Client->bytes_sent = 0L;
2515 Client->bytes_read = sb.st_size;
2519 Client->description, Client->remport, sb.st_size);
2530 DCC_list *Client; local
2532 if ((Client = dcc_searchlist(filename, user, DCC_FILEOFFER, 0, port, 0)) == NULL || !offset)
2537 Client->bytes_sent = atoi(offset);
2538 Client->resume_offset = atoi(offset);
2539 Client->bytes_read = 0L;
2554 DCC_list *Client; local
2557 if (!(Client = dcc_searchlist(filename, nick, DCC_FILEREAD, 0, port, 0)))
2559 Client->flags |= DCC_TWOCLIENTS;
2562 if (!dcc_open(Client))
2566 if (*Client->description == '~')
2568 fullname = expand_twiddle(Client->description);
2571 put_error("Unable to expand %s", Client->description);
2572 close(Client->read);
2573 Client->read = -1;
2574 Client->flags |= DCC_DELETE;
2579 dma_strcpy(&fullname, Client->description);
2581 Client->resume_offset = atoi(offset);
2582 if (!(Client->file = open(fullname ? fullname : Client->description, O_WRONLY | O_APPEND, 0644)))
2584 put_error("Unable to open %s: %s", Client->description, errno ? strerror(errno) : "<No Error>");
2585 close(Client->read);
2586 Client->read = -1;
2587 Client->flags |= DCC_DELETE;
2770 DCC_list *Client; in dcc_filesend2() local
2793 Client = dcc_searchlist(filename, ptr, DCC_FILEOFFER, 1, filename, stat_buf.st_size); in dcc_filesend2()
2794 if ((Client->flags & DCC_ACTIVE) || (Client->flags & DCC_WAIT)) in dcc_filesend2()
2799 Client->flags |= DCC_TWOCLIENTS; in dcc_filesend2()
2804 dcc_open(Client); in dcc_filesend2()
2818 DCC_list *Client; local
2821 for (count = 1, Client = ClientList; Client != NULL; Client = Client->next, count++)
2825 dcc_closebyptr(Client);
2829 if (Client == NULL)
2837 dcc_closebyptr(Client) in dcc_closebyptr() argument
2838 DCC_list *Client; in dcc_closebyptr()
2840 char *type = dcc_types[Client->flags & DCC_TYPES];
2843 message_from(Client->user, LOG_DCC);
2844 if (Client->flags & DCC_DELETE)
2846 …put_error("DCC: %s session (%s) with %s is already marked for deletion.", type, strip_path(Client-…
2847 Client->user);
2851 …put_info("DCC: %s session (%s) with %s closed.", type, strip_path(Client->description), Client->us…
2852 dcc_erase(Client);
2859 DCC_list *Client; in dcc_closeall() local
2861 for (Client = ClientList; Client != NULL; Client = Client->next) in dcc_closeall()
2862 dcc_closebyptr(Client); in dcc_closeall()