Changes in protocols/msn/gw.c [4e4616a:088b070]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/gw.c
r4e4616a r088b070 22 22 gw->ssl = (GATEWAY_PORT == 443); 23 23 gw->poll_timeout = -1; 24 gw->write_timeout = -1;25 24 gw->ic = ic; 26 25 gw->md = ic->proto_data; … … 35 34 b_event_remove(gw->poll_timeout); 36 35 } 37 38 if (gw->write_timeout != -1) {39 b_event_remove(gw->write_timeout);40 }41 42 36 g_byte_array_free(gw->in, TRUE); 43 37 g_byte_array_free(gw->out, TRUE); … … 195 189 } 196 190 197 static gboolean msn_gw_write_cb(gpointer data, gint source, b_input_condition cond)191 void msn_gw_write(struct msn_gw *gw, char *buf, size_t len) 198 192 { 199 struct msn_gw *gw; 200 201 if (!(gw = msn_gw_from_ic(data))) { 202 return FALSE; 203 } 204 193 g_byte_array_append(gw->out, (const guint8 *) buf, len); 205 194 if (!gw->open) { 206 195 msn_gw_open(gw); … … 208 197 msn_gw_dorequest(gw, NULL); 209 198 } 210 211 gw->write_timeout = -1;212 return FALSE;213 199 } 214 215 void msn_gw_write(struct msn_gw *gw, char *buf, size_t len)216 {217 g_byte_array_append(gw->out, (const guint8 *) buf, len);218 219 /* do a bit of buffering here to send several commands with a single request */220 if (gw->write_timeout == -1) {221 gw->write_timeout = b_timeout_add(1, msn_gw_write_cb, gw->ic);222 }223 }
Note: See TracChangeset
for help on using the changeset viewer.