comparison src/protocols/oscar/txqueue.c @ 10267:9cafe038c95e

[gaim-migrate @ 11413] This is some white-space cleanup for oscar, and send an empty channel 4 FLAP when disconnecting. This would have hopefully fixed the problem Luke was seeing where his AIM account wasn't being signed offline for a few hours. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 26 Nov 2004 03:52:00 +0000
parents 14bffb758b34
children ccb38cf22483
comparison
equal deleted inserted replaced
10266:2a9ec10e0c4c 10267:9cafe038c95e
49 } 49 }
50 50
51 if (!(fr = (aim_frame_t *)calloc(1, sizeof(aim_frame_t)))) 51 if (!(fr = (aim_frame_t *)calloc(1, sizeof(aim_frame_t))))
52 return NULL; 52 return NULL;
53 53
54 fr->conn = conn; 54 fr->conn = conn;
55 fr->hdrtype = framing; 55 fr->hdrtype = framing;
56 if (fr->hdrtype == AIM_FRAMETYPE_FLAP) 56 if (fr->hdrtype == AIM_FRAMETYPE_FLAP)
57 fr->hdr.flap.channel = chan; 57 fr->hdr.flap.channel = chan;
58 else if (fr->hdrtype == AIM_FRAMETYPE_OFT) 58 else if (fr->hdrtype == AIM_FRAMETYPE_OFT)
59 fr->hdr.rend.type = chan; 59 fr->hdr.rend.type = chan;
60 else 60 else
61 faimdprintf(sess, 0, "tx_new: unknown framing\n"); 61 faimdprintf(sess, 0, "tx_new: unknown framing\n");
62 62
63 if (datalen > 0) { 63 if (datalen > 0) {
64 fu8_t *data; 64 fu8_t *data;
65 65
81 * before enqueuement (in aim_tx_enqueue()). 81 * before enqueuement (in aim_tx_enqueue()).
82 */ 82 */
83 static flap_seqnum_t aim_get_next_txseqnum(aim_conn_t *conn) 83 static flap_seqnum_t aim_get_next_txseqnum(aim_conn_t *conn)
84 { 84 {
85 flap_seqnum_t ret; 85 flap_seqnum_t ret;
86 86
87 ret = ++conn->seqnum; 87 ret = ++conn->seqnum;
88 88
89 return ret; 89 return ret;
90 } 90 }
91 91
159 return ret; 159 return ret;
160 } 160 }
161 161
162 faim_export int aim_tx_setenqueue(aim_session_t *sess, int what, int (*func)(aim_session_t *, aim_frame_t *)) 162 faim_export int aim_tx_setenqueue(aim_session_t *sess, int what, int (*func)(aim_session_t *, aim_frame_t *))
163 { 163 {
164 164
165 if (what == AIM_TX_QUEUED) 165 if (what == AIM_TX_QUEUED)
166 sess->tx_enqueue = &aim_tx_enqueue__queuebased; 166 sess->tx_enqueue = &aim_tx_enqueue__queuebased;
167 else if (what == AIM_TX_IMMEDIATE) 167 else if (what == AIM_TX_IMMEDIATE)
168 sess->tx_enqueue = &aim_tx_enqueue__immediate; 168 sess->tx_enqueue = &aim_tx_enqueue__immediate;
169 else if (what == AIM_TX_USER) { 169 else if (what == AIM_TX_USER) {
176 return 0; 176 return 0;
177 } 177 }
178 178
179 faim_internal int aim_tx_enqueue(aim_session_t *sess, aim_frame_t *fr) 179 faim_internal int aim_tx_enqueue(aim_session_t *sess, aim_frame_t *fr)
180 { 180 {
181 181
182 /* 182 /*
183 * If we want to send on a connection that is in progress, we have to force 183 * If we want to send on a connection that is in progress, we have to force
184 * them to use the queue based version. Otherwise, use whatever they 184 * them to use the queue based version. Otherwise, use whatever they
185 * want. 185 * want.
186 */ 186 */
229 * I need to rewrite this. "Updating the UI" doesn't make sense. The program is 229 * I need to rewrite this. "Updating the UI" doesn't make sense. The program is
230 * blocked and the UI can't redraw. We're blocking all of Gaim. We need to set 230 * blocked and the UI can't redraw. We're blocking all of Gaim. We need to set
231 * up an actual txqueue and a GAIM_INPUT_WRITE callback and only write when we 231 * up an actual txqueue and a GAIM_INPUT_WRITE callback and only write when we
232 * can. Why is this file called txqueue anyway? Lets rename it to txblock. 232 * can. Why is this file called txqueue anyway? Lets rename it to txblock.
233 */ 233 */
234 if ((conn->type == AIM_CONN_TYPE_RENDEZVOUS) && 234 if ((conn->type == AIM_CONN_TYPE_RENDEZVOUS) &&
235 (conn->subtype == AIM_CONN_SUBTYPE_OFT_DIRECTIM)) { 235 (conn->subtype == AIM_CONN_SUBTYPE_OFT_DIRECTIM)) {
236 const char *sn = aim_odc_getsn(conn); 236 const char *sn = aim_odc_getsn(conn);
237 aim_rxcallback_t userfunc; 237 aim_rxcallback_t userfunc;
238 238
239 while (count - wrote > 1024) { 239 while (count - wrote > 1024) {
284 284
285 bslen = aim_bstream_curpos(&bs); 285 bslen = aim_bstream_curpos(&bs);
286 aim_bstream_rewind(&bs); 286 aim_bstream_rewind(&bs);
287 if (aim_bstream_send(&bs, fr->conn, bslen) != bslen) 287 if (aim_bstream_send(&bs, fr->conn, bslen) != bslen)
288 err = -errno; 288 err = -errno;
289 289
290 free(bs_raw); /* XXX aim_bstream_free */ 290 free(bs_raw); /* XXX aim_bstream_free */
291 291
292 fr->handled = 1; 292 fr->handled = 1;
293 fr->conn->lastactivity = time(NULL); 293 fr->conn->lastactivity = time(NULL);
294 294