libfaim/aim_txqueue.c

changeset 1081
0fb24c9d4c7d
parent 960
c4012584334f
child 1184
e475cddf904d
equal deleted inserted replaced
1080:793beadd30c1 1081:0fb24c9d4c7d
147 if (newpacket->data) 147 if (newpacket->data)
148 free(newpacket->data); 148 free(newpacket->data);
149 free(newpacket); 149 free(newpacket);
150 150
151 return 0; 151 return 0;
152 }
153
154 faim_internal int aim_tx_enqueue(struct aim_session_t *sess, struct command_tx_struct *command)
155 {
156 /*
157 * If we want to send a connection thats inprogress, we have to force
158 * them to use the queue based version. Otherwise, use whatever they
159 * want.
160 */
161 if (command && command->conn && (command->conn->status & AIM_CONN_STATUS_INPROGRESS)) {
162 return aim_tx_enqueue__queuebased(sess, command);
163 }
164 return (*sess->tx_enqueue)(sess, command);
152 } 165 }
153 166
154 /* 167 /*
155 * aim_get_next_txseqnum() 168 * aim_get_next_txseqnum()
156 * 169 *
345 faimdprintf(2, "beginning txflush...\n"); 358 faimdprintf(2, "beginning txflush...\n");
346 for (cur = sess->queue_outgoing; cur; cur = cur->next) { 359 for (cur = sess->queue_outgoing; cur; cur = cur->next) {
347 /* only process if its unlocked and unsent */ 360 /* only process if its unlocked and unsent */
348 if (!cur->lock && !cur->sent) { 361 if (!cur->lock && !cur->sent) {
349 362
363 if (cur->conn && (cur->conn->status & AIM_CONN_STATUS_INPROGRESS))
364 continue;
365
350 /* 366 /*
351 * And now for the meager attempt to force transmit 367 * And now for the meager attempt to force transmit
352 * latency and avoid missed messages. 368 * latency and avoid missed messages.
353 */ 369 */
354 if ((cur->conn->lastactivity + cur->conn->forcedlatency) >= time(NULL)) { 370 if ((cur->conn->lastactivity + cur->conn->forcedlatency) >= time(NULL)) {

mercurial