comparison src/rvous.c @ 202:bcc54ee34531

[gaim-migrate @ 212] uh huh committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 30 Apr 2000 22:25:48 +0000
parents d9a5f7b1d500
children 4fa63e83406b
comparison
equal deleted inserted replaced
201:d9a5f7b1d500 202:bcc54ee34531
321 321
322 static void do_send_file(GtkWidget *w, struct file_transfer *ft) { 322 static void do_send_file(GtkWidget *w, struct file_transfer *ft) {
323 char *send = g_malloc(256); 323 char *send = g_malloc(256);
324 char *file = g_strdup(gtk_file_selection_get_filename(GTK_FILE_SELECTION(ft->window))); 324 char *file = g_strdup(gtk_file_selection_get_filename(GTK_FILE_SELECTION(ft->window)));
325 char *buf; 325 char *buf;
326 char *header;
327 short hdrlen;
328 int read_rv; 326 int read_rv;
329 char bmagic[7]; 327 char bmagic[7];
330 struct file_header *fhdr = g_new0(struct file_header, 1); 328 struct file_header *fhdr = g_new0(struct file_header, 1);
331 struct sockaddr_in sin; 329 struct sockaddr_in sin;
332 guint32 rcv; 330 guint32 rcv;
333 char *c;
334 GtkWidget *fw = NULL, *fbar = NULL, *label; 331 GtkWidget *fw = NULL, *fbar = NULL, *label;
335 struct stat st; 332 struct stat st;
336 333
337 stat(file, &st); 334 stat(file, &st);
338 if (!(ft->f = fopen(file, "r"))) { 335 if (!(ft->f = fopen(file, "r"))) {
376 */ 373 */
377 374
378 /* 1. build/send header */ 375 /* 1. build/send header */
379 buf = frombase64(ft->cookie); 376 buf = frombase64(ft->cookie);
380 sprintf(debug_buff, "Building header to send %s (cookie: %s)\n", file, buf); 377 sprintf(debug_buff, "Building header to send %s (cookie: %s)\n", file, buf);
378 printf("%s", buf); fflush(stdout);
381 debug_print(debug_buff); 379 debug_print(debug_buff);
382 fhdr->hdrtype = 0x1108; 380 fhdr->hdrtype = 0x1108;
383 snprintf(fhdr->bcookie, 9, "%s", buf); 381 snprintf(fhdr->bcookie, 8, "%s", buf);
384 g_free(buf); 382 g_free(buf);
385 fhdr->encrypt = 0; 383 fhdr->encrypt = 0;
386 fhdr->compress = 0; 384 fhdr->compress = 0;
387 fhdr->totfiles = 1; 385 fhdr->totfiles = 1;
388 fhdr->filesleft = 1; 386 fhdr->filesleft = 1;
389 fhdr->totparts = 1; 387 fhdr->totparts = 1;
390 fhdr->partsleft = 1; 388 fhdr->partsleft = 1;
391 fhdr->totsize = (long)st.st_size; 389 fhdr->totsize = (long)st.st_size; /* ? */
392 fhdr->size = htonl((long)(st.st_size)); 390 fhdr->size = (long)st.st_size; /* size of listing.txt */ /* FIXME */
393 fhdr->modtime = htonl(0); 391 fhdr->modtime = 0; /* time since UNIX epoch */ /* FIXME */
394 fhdr->checksum = htonl(0); /* FIXME? */ 392 fhdr->checksum = 0; /* ? */
395 fhdr->rfrcsum = 0; 393 fhdr->rfrcsum = 0;
396 fhdr->rfsize = 0; 394 fhdr->rfsize = 0;
397 fhdr->cretime = 0; 395 fhdr->cretime = 0;
398 fhdr->rfcsum = 0; 396 fhdr->rfcsum = 0;
399 fhdr->nrecvd = 0; 397 fhdr->nrecvd = 0;
400 fhdr->recvcsum = 0; 398 fhdr->recvcsum = 0;
401 snprintf(fhdr->idstring, 32, "Gaim"); 399 snprintf(fhdr->idstring, 32, "Gaim");
402 fhdr->flags = 0x20; /* don't ask me why */ 400 fhdr->flags = 0x20; /* don't ask me why */
403 fhdr->lnameoffset = 0x1A; 401 fhdr->lnameoffset = 0x1A; /* ? still no clue */
404 fhdr->lsizeoffset = 0x10; 402 fhdr->lsizeoffset = 0x10; /* whatever */
405 fhdr->dummy[0] = 0; 403 fhdr->dummy[0] = 0;
406 fhdr->macfileinfo[0] = 0; 404 fhdr->macfileinfo[0] = 0;
407 fhdr->nencode = 0; 405 fhdr->nencode = 0;
408 fhdr->nlanguage = 0; 406 fhdr->nlanguage = 0;
409 snprintf(fhdr->name, 64, "listing.txt"); 407 snprintf(fhdr->name, 64, "listing.txt");