| 410 ret = write(tdt->toc_fd, obuf, slen); |
410 ret = write(tdt->toc_fd, obuf, slen); |
| 411 free(obuf); |
411 free(obuf); |
| 412 g_free(escaped); |
412 g_free(escaped); |
| 413 |
413 |
| 414 return ret; |
414 return ret; |
| |
415 } |
| |
416 |
| |
417 static int toc_send_raw(GaimConnection *gc, const char *buf, int len) |
| |
418 { |
| |
419 return sflap_send(gc, buf, len, 2); |
| 415 } |
420 } |
| 416 |
421 |
| 417 static int wait_reply(GaimConnection *gc, char *buffer, size_t buflen) |
422 static int wait_reply(GaimConnection *gc, char *buffer, size_t buflen) |
| 418 { |
423 { |
| 419 struct toc_data *tdt = (struct toc_data *)gc->proto_data; |
424 struct toc_data *tdt = (struct toc_data *)gc->proto_data; |
| 2066 |
2071 |
| 2067 hdr = (struct file_header *)ft; |
2072 hdr = (struct file_header *)ft; |
| 2068 hdr->magic[0] = 'O'; hdr->magic[1] = 'F'; hdr->magic[2] = 'T'; hdr->magic[3] = '2'; |
2073 hdr->magic[0] = 'O'; hdr->magic[1] = 'F'; hdr->magic[2] = 'T'; hdr->magic[3] = '2'; |
| 2069 hdr->hdrlen = htons(256); |
2074 hdr->hdrlen = htons(256); |
| 2070 hdr->hdrtype = htons(0x1108); |
2075 hdr->hdrtype = htons(0x1108); |
| 2071 frombase64(ft->cookie, &buf, NULL); |
2076 rombase64(ft->cookie, &buf, NULL); |
| 2072 g_snprintf(hdr->bcookie, 8, "%s", buf); |
2077 g_snprintf(hdr->bcookie, 8, "%s", buf); |
| 2073 g_free(buf); |
2078 g_free(buf); |
| 2074 hdr->totfiles = htons(1); hdr->filesleft = htons(1); |
2079 hdr->totfiles = htons(1); hdr->filesleft = htons(1); |
| 2075 hdr->totparts = htons(1); hdr->partsleft = htons(1); |
2080 hdr->totparts = htons(1); hdr->partsleft = htons(1); |
| 2076 hdr->totsize = htonl((long)ft->st.st_size); /* combined size of all files */ |
2081 hdr->totsize = htonl((long)ft->st.st_size); /* combined size of all files */ |
| 2298 NULL, /* can_receive_file */ |
2303 NULL, /* can_receive_file */ |
| 2299 NULL, /* send_file */ |
2304 NULL, /* send_file */ |
| 2300 NULL, /* new_xfer */ |
2305 NULL, /* new_xfer */ |
| 2301 NULL, /* offline_message */ |
2306 NULL, /* offline_message */ |
| 2302 NULL, /* whiteboard_prpl_ops */ |
2307 NULL, /* whiteboard_prpl_ops */ |
| |
2308 toc_send_raw, /* send_raw */ |
| 2303 }; |
2309 }; |
| 2304 |
2310 |
| 2305 static GaimPluginInfo info = |
2311 static GaimPluginInfo info = |
| 2306 { |
2312 { |
| 2307 GAIM_PLUGIN_MAGIC, |
2313 GAIM_PLUGIN_MAGIC, |