comparison src/protocols/oscar/txqueue.c @ 11253:7d31d61e6438

[gaim-migrate @ 13422] Get rid of faimdprintf and use gaim_debug functions instead committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 13 Aug 2005 06:43:45 +0000
parents ccb38cf22483
children ab0fa7cd61cc
comparison
equal deleted inserted replaced
11252:55356a29cdd1 11253:7d31d61e6438
29 faim_internal aim_frame_t *aim_tx_new(aim_session_t *sess, aim_conn_t *conn, fu8_t framing, fu16_t chan, int datalen) 29 faim_internal aim_frame_t *aim_tx_new(aim_session_t *sess, aim_conn_t *conn, fu8_t framing, fu16_t chan, int datalen)
30 { 30 {
31 aim_frame_t *fr; 31 aim_frame_t *fr;
32 32
33 if (!sess || !conn) { 33 if (!sess || !conn) {
34 faimdprintf(sess, 0, "aim_tx_new: No session or no connection specified!\n"); 34 gaim_debug_misc("oscar", "aim_tx_new: No session or no connection specified!\n");
35 return NULL; 35 return NULL;
36 } 36 }
37 37
38 /* For sanity... */ 38 /* For sanity... */
39 if ((conn->type == AIM_CONN_TYPE_RENDEZVOUS) || (conn->type == AIM_CONN_TYPE_LISTENER)) { 39 if ((conn->type == AIM_CONN_TYPE_RENDEZVOUS) || (conn->type == AIM_CONN_TYPE_LISTENER)) {
40 if (framing != AIM_FRAMETYPE_OFT) { 40 if (framing != AIM_FRAMETYPE_OFT) {
41 faimdprintf(sess, 0, "aim_tx_new: attempted to allocate inappropriate frame type for rendezvous connection\n"); 41 gaim_debug_misc("oscar", "aim_tx_new: attempted to allocate inappropriate frame type for rendezvous connection\n");
42 return NULL; 42 return NULL;
43 } 43 }
44 } else { 44 } else {
45 if (framing != AIM_FRAMETYPE_FLAP) { 45 if (framing != AIM_FRAMETYPE_FLAP) {
46 faimdprintf(sess, 0, "aim_tx_new: attempted to allocate inappropriate frame type for FLAP connection\n"); 46 gaim_debug_misc("oscar", "aim_tx_new: attempted to allocate inappropriate frame type for FLAP connection\n");
47 return NULL; 47 return NULL;
48 } 48 }
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))))
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 gaim_debug_misc("oscar", "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
66 if (!(data = (unsigned char *)malloc(datalen))) { 66 if (!(data = (unsigned char *)malloc(datalen))) {
103 */ 103 */
104 static int aim_tx_enqueue__queuebased(aim_session_t *sess, aim_frame_t *fr) 104 static int aim_tx_enqueue__queuebased(aim_session_t *sess, aim_frame_t *fr)
105 { 105 {
106 106
107 if (!fr->conn) { 107 if (!fr->conn) {
108 faimdprintf(sess, 1, "aim_tx_enqueue: WARNING: enqueueing packet with no connecetion\n"); 108 gaim_debug_warning("oscar", "aim_tx_enqueue: enqueueing packet with no connecetion\n");
109 fr->conn = aim_getconn_type(sess, AIM_CONN_TYPE_BOS); 109 fr->conn = aim_getconn_type(sess, AIM_CONN_TYPE_BOS);
110 } 110 }
111 111
112 if (fr->hdrtype == AIM_FRAMETYPE_FLAP) { 112 if (fr->hdrtype == AIM_FRAMETYPE_FLAP) {
113 /* assign seqnum -- XXX should really not assign until hardxmit */ 113 /* assign seqnum -- XXX should really not assign until hardxmit */
132 * Parallel to aim_tx_enqueue__queuebased, however, this bypasses 132 * Parallel to aim_tx_enqueue__queuebased, however, this bypasses
133 * the whole queue mess when you want immediate writes to happen. 133 * the whole queue mess when you want immediate writes to happen.
134 * 134 *
135 * Basically the same as its __queuebased couterpart, however 135 * Basically the same as its __queuebased couterpart, however
136 * instead of doing a list append, it just calls aim_tx_sendframe() 136 * instead of doing a list append, it just calls aim_tx_sendframe()
137 * right here. 137 * right here.
138 * 138 *
139 */ 139 */
140 static int aim_tx_enqueue__immediate(aim_session_t *sess, aim_frame_t *fr) 140 static int aim_tx_enqueue__immediate(aim_session_t *sess, aim_frame_t *fr)
141 { 141 {
142 int ret; 142 int ret;
143 143
144 if (!fr->conn) { 144 if (!fr->conn) {
145 faimdprintf(sess, 1, "aim_tx_enqueue: ERROR: packet has no connection\n"); 145 gaim_debug_error("oscar", "aim_tx_enqueue: packet has no connection\n");
146 aim_frame_destroy(fr); 146 aim_frame_destroy(fr);
147 return 0; 147 return 0;
148 } 148 }
149 149
150 if (fr->hdrtype == AIM_FRAMETYPE_FLAP) 150 if (fr->hdrtype == AIM_FRAMETYPE_FLAP)