On 13 Jun 2001, Wayne Davison <[EMAIL PROTECTED]> wrote:
> The CVS version of rsync outputs an error on exit after listing the
> modules from an rsync daemon (running "rsync host::").  The following
> patch fixes this.  (If you haven't applied my "nohang" patch, you'll see
> an offset for this patch hunk.)

So, the point is that if we get an EOF while we're trying to read a
line of text, that's OK: the server's allowed to close the connection
at that point.  But, if we're reading a binary section, then we must
not see an unexpected EOF.

That sounds reasonable -- I think it fits in with how the protocol
works, though the code you're patching is a little wierd.

I'm slightly concerned that this may cause some other failure modes to
falsely cause the client to return 0.  I can't see any particular case
where this would happen, though.

Anybody else?

> +++ io.c      Wed Jun 13 18:40:46 2001
> @@ -246,12 +246,12 @@
> 
> 
>               if (n == 0) {
> -                     if (eof_error) {
> -                             rprintf(FERROR,
> -                                        "%s: connection to server unexpectedly 
>closed"
> -                                        " (%.0f bytes read so far)\n",
> -                                        RSYNC_NAME, (double)stats.total_read);
> -                     }
> +                     if (!eof_error)
> +                             exit_cleanup(0);
> +                     rprintf(FERROR,
> +                             "%s: connection to server unexpectedly closed"
> +                             " (%.0f bytes read so far)\n",
> +                             RSYNC_NAME, (double)stats.total_read);
>                       exit_cleanup(RERR_STREAMIO);
>               }
> 
> 
> 

Reply via email to