| 2337 |
2337 |
| 2338 /* write pkt to the source */ |
2338 /* write pkt to the source */ |
| 2339 static void yahoo_p2p_write_pkt(gint source, struct yahoo_packet *pkt) |
2339 static void yahoo_p2p_write_pkt(gint source, struct yahoo_packet *pkt) |
| 2340 { |
2340 { |
| 2341 size_t pkt_len; |
2341 size_t pkt_len; |
| |
2342 gssize written; |
| 2342 guchar *raw_packet; |
2343 guchar *raw_packet; |
| 2343 |
2344 |
| 2344 /*build the raw packet and send it to the host*/ |
2345 /*build the raw packet and send it to the host*/ |
| 2345 pkt_len = yahoo_packet_build(pkt, 0, 0, 0, &raw_packet); |
2346 pkt_len = yahoo_packet_build(pkt, 0, 0, 0, &raw_packet); |
| 2346 if(write(source, raw_packet, pkt_len) != pkt_len) |
2347 written = write(source, raw_packet, pkt_len); |
| |
2348 if (written < 0 || (gsize)written != pkt_len) |
| 2347 purple_debug_warning("yahoo","p2p: couldn't write to the source\n"); |
2349 purple_debug_warning("yahoo","p2p: couldn't write to the source\n"); |
| 2348 g_free(raw_packet); |
2350 g_free(raw_packet); |
| 2349 } |
2351 } |
| 2350 |
2352 |
| 2351 static void yahoo_p2p_keepalive_cb(gpointer key, gpointer value, gpointer user_data) |
2353 static void yahoo_p2p_keepalive_cb(gpointer key, gpointer value, gpointer user_data) |