# HG changeset patch # User masneyb # Date 1041211939 0 # Node ID 759c7d019a8986ecdf1f9c82681a8eef3b72e8fc # Parent 1ee3c21c12911e76ddbfdf5e27f0b7a09e0b8653 2002-12-29 Brian Masney * lib/gftp.h - don't include sys/sysmacros.h * src/gtk/transfer.c - more GFTP_EFATAL checks diff -r 1ee3c21c1291 -r 759c7d019a89 ChangeLog --- a/ChangeLog Mon Dec 30 01:10:34 2002 +0000 +++ b/ChangeLog Mon Dec 30 01:32:19 2002 +0000 @@ -1,3 +1,8 @@ +2002-12-29 Brian Masney + * lib/gftp.h - don't include sys/sysmacros.h + + * src/gtk/transfer.c - more GFTP_EFATAL checks + 2002-12-29 Brian Masney * lib/ssh.c lib/config_file.c lib/Makefile.am lib/gftp.h lib/options.h - removed old legacy SSH protocol and option to enable this protocol @@ -409,7 +414,7 @@ * cvsclean - added this script - * *.[ch] - added $Id: ChangeLog,v 1.50 2002/12/29 15:16:26 masneyb Exp $ tags + * *.[ch] - added $Id: ChangeLog,v 1.51 2002/12/30 01:32:18 masneyb Exp $ tags * debian/* - updated files from Debian maintainer diff -r 1ee3c21c1291 -r 759c7d019a89 lib/gftp.h --- a/lib/gftp.h Mon Dec 30 01:10:34 2002 +0000 +++ b/lib/gftp.h Mon Dec 30 01:32:19 2002 +0000 @@ -35,7 +35,6 @@ #endif #include #include -#include #include #include #include diff -r 1ee3c21c1291 -r 759c7d019a89 src/gtk/transfer.c --- a/src/gtk/transfer.c Mon Dec 30 01:10:34 2002 +0000 +++ b/src/gtk/transfer.c Mon Dec 30 01:32:19 2002 +0000 @@ -605,6 +605,8 @@ { gftp_file * tempfle; struct timeval tv; + int ret1 = 0, + ret2 = 0; pthread_mutex_lock (tdata->structmutex); if (tdata->curfle == NULL) @@ -619,7 +621,10 @@ gftp_disconnect (tdata->toreq); if (num_read < 0 || tdata->skip_file) { - if (tdata->fromreq->retries != 0 && tdata->current_file_retries >= tdata->fromreq->retries) + if (num_read == GFTP_EFATAL) + return (-1); + else if (tdata->fromreq->retries != 0 && + tdata->current_file_retries >= tdata->fromreq->retries) { tdata->fromreq->logging_function (gftp_logging_error, tdata->fromreq->user_data, @@ -648,8 +653,8 @@ select (0, NULL, NULL, NULL, &tv); } - if (gftp_connect (tdata->fromreq) == 0 && - gftp_connect (tdata->toreq) == 0) + if ((ret1 = gftp_connect (tdata->fromreq)) == 0 && + (ret2 = gftp_connect (tdata->toreq)) == 0) { pthread_mutex_lock (tdata->structmutex); tdata->resumed_bytes = tdata->resumed_bytes + tdata->trans_bytes - tdata->curresumed - tdata->curtrans; @@ -681,6 +686,12 @@ pthread_mutex_unlock (tdata->structmutex); return (1); } + else if (ret1 == GFTP_EFATAL || ret2 == GFTP_EFATAL) + { + gftp_disconnect (tdata->fromreq); + gftp_disconnect (tdata->toreq); + return (-1); + } else tdata->current_file_retries++; } @@ -740,7 +751,7 @@ char *tempstr, buf[8192]; off_t fromsize, total; gftp_file * curfle; - ssize_t num_read; + ssize_t num_read, ret; pthread_detach (pthread_self ()); transfer = data; @@ -902,10 +913,10 @@ else tempstr = buf; - if (gftp_put_next_file_chunk (transfer->toreq, tempstr, - num_read) < 0) + if ((ret = gftp_put_next_file_chunk (transfer->toreq, tempstr, + num_read)) < 0) { - num_read = -1; + num_read = (int) ret; break; }