Mercurial > pidgin
changeset 5494:d557a53e35c5
[gaim-migrate @ 5890]
Fix for file transfer on windows. Renamed gaim_xfer read
and write to ft_read and ft_write. This avoids macro expansion of these funcs
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Thu, 22 May 2003 23:12:10 +0000 |
parents | 3e8487580024 |
children | 5b678994929b |
files | src/ft.c src/ft.h |
diffstat | 2 files changed, 12 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ft.c Thu May 22 20:50:30 2003 +0000 +++ b/src/ft.c Thu May 22 23:12:10 2003 +0000 @@ -35,6 +35,10 @@ #include "proxy.h" #include "notify.h" +#ifdef _WIN32 +#include "win32dep.h" +#endif + static struct gaim_xfer_ui_ops *xfer_ui_ops = NULL; struct gaim_xfer * @@ -378,7 +382,7 @@ if (xfer == NULL) return; - xfer->ops.read = fnc; + xfer->ops.ft_read = fnc; } void @@ -389,7 +393,7 @@ if (xfer == NULL) return; - xfer->ops.write = fnc; + xfer->ops.ft_write = fnc; } void @@ -455,13 +459,12 @@ else s = MIN(gaim_xfer_get_bytes_remaining(xfer), 4096); - if (xfer->ops.read != NULL) - r = xfer->ops.read(buffer, xfer); + if (xfer->ops.ft_read != NULL) + r = xfer->ops.ft_read(buffer, xfer); else { *buffer = g_malloc0(s); r = read(xfer->fd, *buffer, s); - if ((gaim_xfer_get_size > 0) && ((gaim_xfer_get_bytes_sent(xfer)+r) >= gaim_xfer_get_size(xfer))) gaim_xfer_set_completed(xfer, TRUE); @@ -480,8 +483,8 @@ s = MIN(gaim_xfer_get_bytes_remaining(xfer), size); - if (xfer->ops.write != NULL) - r = xfer->ops.write(buffer, s, xfer); + if (xfer->ops.ft_write != NULL) + r = xfer->ops.ft_write(buffer, s, xfer); else r = write(xfer->fd, buffer, s); @@ -498,7 +501,6 @@ if (condition & GAIM_INPUT_READ) { r = gaim_xfer_read(xfer, &buffer); - if (r > 0) fwrite(buffer, 1, r, xfer->dest_fp); }
--- a/src/ft.h Thu May 22 20:50:30 2003 +0000 +++ b/src/ft.h Thu May 22 23:12:10 2003 +0000 @@ -96,8 +96,8 @@ void (*end)(struct gaim_xfer *xfer); void (*cancel_send)(struct gaim_xfer *xfer); void (*cancel_recv)(struct gaim_xfer *xfer); - size_t (*read)(char **buffer, struct gaim_xfer *xfer); - size_t (*write)(const char *buffer, size_t size, + size_t (*ft_read)(char **buffer, struct gaim_xfer *xfer); + size_t (*ft_write)(const char *buffer, size_t size, struct gaim_xfer *xfer); void (*ack)(struct gaim_xfer *xfer, const char *buffer, size_t size);