Mercurial > pidgin.yaz
comparison plugins/icq/filesession.c @ 1432:4c510ca3563f
[gaim-migrate @ 1442]
icqlib 1.1.5
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sun, 28 Jan 2001 01:52:27 +0000 |
parents | 0a766047b4fd |
children | 0ef6603d986e |
comparison
equal
deleted
inserted
replaced
1431:0137bacd63c8 | 1432:4c510ca3563f |
---|---|
45 | 45 |
46 void icq_FileSessionDelete(void *pv) | 46 void icq_FileSessionDelete(void *pv) |
47 { | 47 { |
48 icq_FileSession *p=(icq_FileSession *)pv; | 48 icq_FileSession *p=(icq_FileSession *)pv; |
49 | 49 |
50 invoke_callback(p->icqlink, icq_FileNotify)(p, FILE_NOTIFY_CLOSE, 0, | |
51 NULL); | |
52 | |
50 if(p->files) { | 53 if(p->files) { |
51 char **p2=p->files; | 54 char **p2=p->files; |
52 while(*p2) | 55 while(*p2) |
53 free(*(p2++)); | 56 free(*(p2++)); |
54 free(p->files); | 57 free(p->files); |
82 void icq_FileSessionSetStatus(icq_FileSession *p, int status) | 85 void icq_FileSessionSetStatus(icq_FileSession *p, int status) |
83 { | 86 { |
84 if(status!=p->status) | 87 if(status!=p->status) |
85 { | 88 { |
86 p->status=status; | 89 p->status=status; |
87 if(p->id && p->icqlink->icq_RequestNotify) | 90 if(p->id) |
88 (*p->icqlink->icq_RequestNotify)(p->icqlink, p->id, ICQ_NOTIFY_FILE, | 91 invoke_callback(p->icqlink, icq_FileNotify)(p, FILE_NOTIFY_STATUS, |
89 status, 0); | 92 status, NULL); |
93 if (status == FILE_STATUS_SENDING) | |
94 icq_SocketSetHandler(p->tcplink->socket, ICQ_SOCKET_WRITE, | |
95 icq_FileSessionSendData, p); | |
96 else | |
97 icq_SocketSetHandler(p->tcplink->socket, ICQ_SOCKET_WRITE, NULL, NULL); | |
90 } | 98 } |
91 } | 99 } |
92 | 100 |
93 void icq_FileSessionSetHandle(icq_FileSession *p, const char *handle) | 101 void icq_FileSessionSetHandle(icq_FileSession *p, const char *handle) |
94 { | 102 { |
179 icq_Packet *p2=icq_TCPCreateFile06Packet(count, buffer); | 187 icq_Packet *p2=icq_TCPCreateFile06Packet(count, buffer); |
180 icq_TCPLinkSend(p->tcplink, p2); | 188 icq_TCPLinkSend(p->tcplink, p2); |
181 p->total_transferred_bytes+=count; | 189 p->total_transferred_bytes+=count; |
182 p->current_file_progress+=count; | 190 p->current_file_progress+=count; |
183 icq_FileSessionSetStatus(p, FILE_STATUS_SENDING); | 191 icq_FileSessionSetStatus(p, FILE_STATUS_SENDING); |
184 | 192 |
185 if (p->icqlink->icq_RequestNotify) | 193 invoke_callback(p->icqlink, icq_FileNotify)(p, FILE_NOTIFY_DATAPACKET, |
186 (*p->icqlink->icq_RequestNotify)(p->icqlink, p->id, | 194 count, buffer); |
187 ICQ_NOTIFY_FILEDATA, count, NULL); | |
188 } | 195 } |
189 | 196 |
190 /* done transmitting if read returns less that 2048 bytes */ | 197 /* done transmitting if read returns less that 2048 bytes */ |
191 if(count<2048) | 198 if(count<2048) |
192 icq_FileSessionClose(p); | 199 icq_FileSessionClose(p); |