Mercurial > pidgin.yaz
comparison plugins/icq/tcplink.c @ 1309:0a766047b4fd
[gaim-migrate @ 1319]
Yay, new icqlib
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 19 Dec 2000 10:08:29 +0000 |
parents | 201ec77f3a60 |
children | 4c510ca3563f |
comparison
equal
deleted
inserted
replaced
1308:4741b5a75b9f | 1309:0a766047b4fd |
---|---|
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* | 2 /* |
3 $Id: tcplink.c 1162 2000-11-28 02:22:42Z warmenhoven $ | 3 $Id: tcplink.c 1319 2000-12-19 10:08:29Z warmenhoven $ |
4 $Log$ | 4 $Log$ |
5 Revision 1.1 2000/11/28 02:22:42 warmenhoven | 5 Revision 1.2 2000/12/19 10:08:29 warmenhoven |
6 icq. whoop de doo | 6 Yay, new icqlib |
7 | |
8 Revision 1.40 2000/12/19 06:00:07 bills | |
9 moved members from ICQLINK to ICQLINK_private struct | |
10 | |
11 Revision 1.39 2000/12/03 21:57:15 bills | |
12 fixed bug #105068 | |
7 | 13 |
8 Revision 1.38 2000/07/09 22:19:35 bills | 14 Revision 1.38 2000/07/09 22:19:35 bills |
9 added new *Close functions, use *Close functions instead of *Delete | 15 added new *Close functions, use *Close functions instead of *Delete |
10 where correct, and misc cleanup | 16 where correct, and misc cleanup |
11 | 17 |
194 p->remote_version=0; | 200 p->remote_version=0; |
195 p->flags=0; | 201 p->flags=0; |
196 p->proxy_status = 0; | 202 p->proxy_status = 0; |
197 | 203 |
198 if(p) | 204 if(p) |
199 list_enqueue(link->icq_TCPLinks, p); | 205 list_enqueue(link->d->icq_TCPLinks, p); |
200 | 206 |
201 return p; | 207 return p; |
202 } | 208 } |
203 | 209 |
204 int _icq_TCPLinkDelete(void *pv, va_list data) | 210 int _icq_TCPLinkDelete(void *pv, va_list data) |
265 free(p); | 271 free(p); |
266 } | 272 } |
267 | 273 |
268 void icq_TCPLinkClose(icq_TCPLink *plink) | 274 void icq_TCPLinkClose(icq_TCPLink *plink) |
269 { | 275 { |
270 list_remove(plink->icqlink->icq_TCPLinks, plink); | 276 list_remove(plink->icqlink->d->icq_TCPLinks, plink); |
271 icq_TCPLinkDelete(plink); | 277 icq_TCPLinkDelete(plink); |
272 } | 278 } |
273 | 279 |
274 int icq_TCPLinkProxyConnect(icq_TCPLink *plink, DWORD uin, int port) | 280 int icq_TCPLinkProxyConnect(icq_TCPLink *plink, DWORD uin, int port) |
275 { | 281 { |
774 if(packet_size>icq_TCPLinkBufferSize-sizeof(WORD)) | 780 if(packet_size>icq_TCPLinkBufferSize-sizeof(WORD)) |
775 { | 781 { |
776 icq_FmtLog(plink->icqlink, ICQ_LOG_WARNING, "tcplink buffer " | 782 icq_FmtLog(plink->icqlink, ICQ_LOG_WARNING, "tcplink buffer " |
777 "overflow, packet size = %d, buffer size = %d, closing link\n", | 783 "overflow, packet size = %d, buffer size = %d, closing link\n", |
778 packet_size, icq_TCPLinkBufferSize); | 784 packet_size, icq_TCPLinkBufferSize); |
779 icq_TCPLinkClose(plink); | |
780 return 0; | 785 return 0; |
781 } | 786 } |
782 | 787 |
783 if(packet_size+sizeof(WORD) <= (unsigned)plink->buffer_count) | 788 if(packet_size+sizeof(WORD) <= (unsigned)plink->buffer_count) |
784 { | 789 { |
922 unsigned long icq_TCPLinkSendSeq(icq_TCPLink *plink, icq_Packet *p, | 927 unsigned long icq_TCPLinkSendSeq(icq_TCPLink *plink, icq_Packet *p, |
923 unsigned long sequence) | 928 unsigned long sequence) |
924 { | 929 { |
925 /* append the next sequence number on the packet */ | 930 /* append the next sequence number on the packet */ |
926 if (!sequence) | 931 if (!sequence) |
927 sequence=plink->icqlink->icq_TCPSequence--; | 932 sequence=plink->icqlink->d->icq_TCPSequence--; |
928 p->id=sequence; | 933 p->id=sequence; |
929 icq_PacketEnd(p); | 934 icq_PacketEnd(p); |
930 icq_PacketAppend32(p, sequence); | 935 icq_PacketAppend32(p, sequence); |
931 | 936 |
932 /* if the link is currently connecting, queue the packets for | 937 /* if the link is currently connecting, queue the packets for |
1008 return ( (plink->remote_uin == uin ) && (plink->type == type) ); | 1013 return ( (plink->remote_uin == uin ) && (plink->type == type) ); |
1009 } | 1014 } |
1010 | 1015 |
1011 icq_TCPLink *icq_FindTCPLink(ICQLINK *link, unsigned long uin, int type) | 1016 icq_TCPLink *icq_FindTCPLink(ICQLINK *link, unsigned long uin, int type) |
1012 { | 1017 { |
1013 return list_traverse(link->icq_TCPLinks, _icq_FindTCPLink, uin, type); | 1018 return list_traverse(link->d->icq_TCPLinks, _icq_FindTCPLink, uin, type); |
1014 } | 1019 } |