Mercurial > pidgin.yaz
changeset 4646:440d3d870b84
[gaim-migrate @ 4956]
This is a fix for the whole "The Dude received a file but it
doesn't agree with original thing." Now it agrees with the
original even if it doesn't agree with the original. I should
fix it. I'll do it later, cutie. I realized that I want to
store a bunch of this stuff in libfaim rather than oscar.
And I'm going to outsource development and try to synergize
with a group of wood nymphs.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 04 Mar 2003 06:40:20 +0000 |
parents | 8cae36606111 |
children | ba87412b1a57 |
files | src/gtkft.c src/protocols/oscar/aim.h src/protocols/oscar/ft.c src/protocols/oscar/oscar.c |
diffstat | 4 files changed, 15 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gtkft.c Tue Mar 04 02:31:05 2003 +0000 +++ b/src/gtkft.c Tue Mar 04 06:40:20 2003 +0000 @@ -161,7 +161,7 @@ *time_remaining = g_strdup("Unknown"); } else if (gaim_xfer_is_completed(xfer)) { - *time_remaining = g_strdup("Done."); + *time_remaining = g_strdup("Finished"); } else { int h, m, s; @@ -878,7 +878,7 @@ gtk_list_store_set(GTK_LIST_STORE(xfer_dialog->model), &data->iter, COLUMN_STATUS, pixbuf, - COLUMN_REMAINING, "Finished.", + COLUMN_REMAINING, "Finished", -1); g_object_unref(pixbuf);
--- a/src/protocols/oscar/aim.h Tue Mar 04 02:31:05 2003 +0000 +++ b/src/protocols/oscar/aim.h Tue Mar 04 06:40:20 2003 +0000 @@ -1005,7 +1005,7 @@ faim_export aim_conn_t *aim_odc_initiate(aim_session_t *sess, const char *sn); faim_export aim_conn_t *aim_odc_connect(aim_session_t *sess, const char *sn, const char *addr, const fu8_t *cookie); faim_export aim_conn_t *aim_sendfile_listen(aim_session_t *sess, const fu8_t *cookie, const fu8_t *ip, fu16_t port); -faim_export int aim_oft_sendheader(aim_session_t *sess, aim_conn_t *conn, fu16_t type, const fu8_t *cookie, const char *filename, fu16_t filesdone, fu16_t numfiles, fu32_t size, fu32_t totsize, fu32_t modtime, fu32_t checksum, fu8_t flags); +faim_export int aim_oft_sendheader(aim_session_t *sess, aim_conn_t *conn, fu16_t type, const fu8_t *cookie, const char *filename, fu16_t filesdone, fu16_t numfiles, fu32_t size, fu32_t totsize, fu32_t modtime, fu32_t checksum, fu8_t flags, fu32_t bytesreceived, fu32_t recvcsum);
--- a/src/protocols/oscar/ft.c Tue Mar 04 02:31:05 2003 +0000 +++ b/src/protocols/oscar/ft.c Tue Mar 04 06:40:20 2003 +0000 @@ -739,7 +739,7 @@ * "AIM_CB_OFT_DONE" message, and "0x02" for everything else. * @return Return 0 if no errors, otherwise return the error number. */ -faim_export int aim_oft_sendheader(aim_session_t *sess, aim_conn_t *conn, fu16_t type, const fu8_t *cookie, const char *filename, fu16_t filesdone, fu16_t numfiles, fu32_t size, fu32_t totsize, fu32_t modtime, fu32_t checksum, fu8_t flags) +faim_export int aim_oft_sendheader(aim_session_t *sess, aim_conn_t *conn, fu16_t type, const fu8_t *cookie, const char *filename, fu16_t filesdone, fu16_t numfiles, fu32_t size, fu32_t totsize, fu32_t modtime, fu32_t checksum, fu8_t flags, fu32_t bytesreceived, fu32_t recvcsum) { aim_frame_t *newoft; struct aim_fileheader_t *fh; @@ -765,9 +765,11 @@ fh->size = size; fh->modtime = modtime; fh->checksum = checksum; + fh->nrecvd = bytesreceived; + fh->recvcsum = recvcsum; strncpy(fh->idstring, "OFT_Windows ICBMFT V1.1 32", sizeof(fh->idstring)); - fh->flags = 0x02; + fh->flags = flags; fh->lnameoffset = 0x1a; fh->lsizeoffset = 0x10; memset(fh->dummy, 0, sizeof(fh->dummy));
--- a/src/protocols/oscar/oscar.c Tue Mar 04 02:31:05 2003 +0000 +++ b/src/protocols/oscar/oscar.c Tue Mar 04 06:40:20 2003 +0000 @@ -180,8 +180,8 @@ /* BBB */ struct oscar_xfer_data { fu8_t cookie[8]; - fu16_t modtime; - fu16_t checksum; + fu32_t modtime; + fu32_t checksum; aim_conn_t *conn; struct gaim_xfer *xfer; struct gaim_connection *gc; @@ -360,8 +360,8 @@ xfer->watcher = gaim_input_add(xfer_data->conn->fd, GAIM_INPUT_READ, oscar_callback, xfer_data->conn); aim_im_sendch2_sendfile_ask(od->sess, xfer_data->cookie, xfer->who, ip, xfer->local_port, xfer->filename, 1, xfer->size); aim_conn_addhandler(od->sess, xfer_data->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_ESTABLISHED, oscar_sendfile_established, 0); - /* Calculate a checksum thingy. This is ugly. - if ((fd = open(xfer->local_filename, O_RDONLY))) { + /* Calculate a checksum thingy. This is ugly. */ + /* if ((fd = open(xfer->local_filename, O_RDONLY))) { int bytes; char buf[1024]; xfer_data->checksum = 0xffff0000; @@ -433,7 +433,7 @@ return; if (gaim_xfer_get_type(xfer) == GAIM_XFER_RECEIVE) - aim_oft_sendheader(xfer_data->conn->sessv, xfer_data->conn, AIM_CB_OFT_DONE, xfer_data->cookie, xfer->filename, 1, 1, xfer->size, xfer->size, xfer_data->modtime, xfer_data->checksum, 0x21); + aim_oft_sendheader(xfer_data->conn->sessv, xfer_data->conn, AIM_CB_OFT_DONE, xfer_data->cookie, xfer->filename, 1, 1, xfer->size, xfer->size, xfer_data->modtime, xfer_data->checksum, 0x02, xfer->size, xfer_data->checksum); if ((gc = xfer_data->gc)) { if ((od = gc->proto_data)) @@ -479,7 +479,7 @@ if (!(xfer_data = xfer->data)) return; - aim_oft_checksum(buffer, size, xfer_data->checksum); + /* xfer_data->checksum = aim_oft_checksum(buffer, size, xfer_data->checksum); */ } static struct gaim_xfer * @@ -1755,7 +1755,7 @@ xfer->watcher = gaim_input_add(xfer_data->conn->fd, GAIM_INPUT_READ, oscar_callback, xfer_data->conn); /* Inform the other user that we are connected and ready to transfer */ - aim_oft_sendheader(sess, xfer_data->conn, AIM_CB_OFT_PROMPT, NULL, xfer->filename, 0, 1, xfer->size, xfer->size, time(NULL), xfer_data->checksum, 0x02); + aim_oft_sendheader(sess, xfer_data->conn, AIM_CB_OFT_PROMPT, NULL, xfer->filename, 0, 1, xfer->size, xfer->size, time(NULL), xfer_data->checksum, 0x02, 0, 0); return 0; } @@ -1829,7 +1829,7 @@ xfer->watcher = 0; /* XXX - convert the name from UTF-8 to UCS-2 if necessary, and pass the encoding to the call below */ - aim_oft_sendheader(xfer_data->conn->sessv, xfer_data->conn, AIM_CB_OFT_ACK, xfer_data->cookie, xfer->filename, 0, 1, xfer->size, xfer->size, fh->modtime, fh->checksum, 0x02); + aim_oft_sendheader(xfer_data->conn->sessv, xfer_data->conn, AIM_CB_OFT_ACK, xfer_data->cookie, xfer->filename, 0, 1, xfer->size, xfer->size, fh->modtime, fh->checksum, 0x02, 0, 0); gaim_xfer_start(xfer, xfer->fd, NULL, 0); return 0;