Changeset 7869e48 for libfaim/txqueue.c
- Timestamp:
- Jan 12, 2013, 1:43:13 PM (11 years ago)
- Children:
- e3a0d71, 4485285
- Parents:
- 4626016
- git-author:
- Jason Gross <jgross@mit.edu> (01/12/13 13:13:18)
- git-committer:
- Jason Gross <jgross@mit.edu> (01/12/13 13:43:13)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfaim/txqueue.c
rcf02dd6 r7869e48 53 53 memset(fr, 0, sizeof(aim_frame_t)); 54 54 55 fr->conn = conn; 55 fr->conn = conn; 56 56 57 57 fr->hdrtype = framing; … … 65 65 fr->hdr.rend.type = chan; 66 66 67 } else 67 } else 68 68 faimdprintf(sess, 0, "tx_new: unknown framing\n"); 69 69 … … 133 133 * Basically the same as its __queuebased couterpart, however 134 134 * instead of doing a list append, it just calls aim_tx_sendframe() 135 * right here. 136 * 135 * right here. 136 * 137 137 */ 138 138 static int aim_tx_enqueue__immediate(aim_session_t *sess, aim_frame_t *fr) … … 159 159 faim_export int aim_tx_setenqueue(aim_session_t *sess, int what, int (*func)(aim_session_t *, aim_frame_t *)) 160 160 { 161 161 162 162 if (what == AIM_TX_QUEUED) 163 163 sess->tx_enqueue = &aim_tx_enqueue__queuebased; 164 else if (what == AIM_TX_IMMEDIATE) 164 else if (what == AIM_TX_IMMEDIATE) 165 165 sess->tx_enqueue = &aim_tx_enqueue__immediate; 166 166 else if (what == AIM_TX_USER) { … … 176 176 faim_internal int aim_tx_enqueue(aim_session_t *sess, aim_frame_t *fr) 177 177 { 178 178 179 179 /* 180 180 * If we want to send a connection thats inprogress, we have to force … … 182 182 * want. 183 183 */ 184 if (fr && fr->conn && 184 if (fr && fr->conn && 185 185 (fr->conn->status & AIM_CONN_STATUS_INPROGRESS)) { 186 186 return aim_tx_enqueue__queuebased(sess, fr); … … 190 190 } 191 191 192 /* 192 /* 193 193 * aim_get_next_txseqnum() 194 194 * … … 202 202 { 203 203 flap_seqnum_t ret; 204 204 205 205 ret = ++conn->seqnum; 206 206 … … 238 238 239 239 if (count) { 240 if ((conn->type == AIM_CONN_TYPE_RENDEZVOUS) && 240 if ((conn->type == AIM_CONN_TYPE_RENDEZVOUS) && 241 241 (conn->subtype == AIM_CONN_SUBTYPE_OFT_DIRECTIM)) { 242 242 /* I strongly suspect that this is a horrible thing to do … … 246 246 while (count - wrote > 1024) { 247 247 wrote = wrote + aim_send(conn->fd, bs->data + bs->offset + wrote, 1024); 248 if ((userfunc=aim_callhandler(conn->sessv, conn, 249 AIM_CB_FAM_SPECIAL, 248 if ((userfunc=aim_callhandler(conn->sessv, conn, 249 AIM_CB_FAM_SPECIAL, 250 250 AIM_CB_SPECIAL_IMAGETRANSFER))) 251 userfunc(conn->sessv, NULL, sn, 251 userfunc(conn->sessv, NULL, sn, 252 252 count-wrote>1024 ? ((double)wrote / count) : 1); 253 253 } … … 265 265 faimdprintf(sess, 2, "\nOutgoing data: (%d bytes)", wrote); 266 266 for (i = 0; i < wrote; i++) { 267 if (!(i % 8)) 267 if (!(i % 8)) 268 268 faimdprintf(sess, 2, "\n\t"); 269 269 faimdprintf(sess, 2, "0x%02x ", *(bs->data + bs->offset + i)); … … 304 304 if (aim_bstream_send(&obs, fr->conn, obslen) != obslen) 305 305 err = -errno; 306 306 307 307 free(obs_raw); /* XXX aim_bstream_free */ 308 308 … … 372 372 */ 373 373 if ((cur->conn->lastactivity + cur->conn->forcedlatency) >= time(NULL)) { 374 /* 375 * XXX should be a break! we dont want to block the 374 /* 375 * XXX should be a break! we dont want to block the 376 376 * upper layers 377 377 * … … 394 394 /* 395 395 * aim_tx_purgequeue() 396 * 397 * This is responsable for removing sent commands from the transmit 396 * 397 * This is responsable for removing sent commands from the transmit 398 398 * queue. This is not a required operation, but it of course helps 399 * reduce memory footprint at run time! 399 * reduce memory footprint at run time! 400 400 * 401 401 */
Note: See TracChangeset
for help on using the changeset viewer.