From d0022402aea1a05e940c0a6c78fb02ed897bc01f Mon Sep 17 00:00:00 2001 From: nick Date: Wed, 14 Aug 2013 15:29:24 +0100 Subject: [PATCH] mirror: Start our timeout watcher from the first, not second, transfer --- src/mirror.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mirror.c b/src/mirror.c index 85b6b48..422b48e 100644 --- a/src/mirror.c +++ b/src/mirror.c @@ -710,6 +710,9 @@ void mirror_run( struct server *serve ) /* Start by writing xfer 0 to the listener */ ev_io_start( ctrl.ev_loop, &ctrl.write_watcher ); + /* We want to timeout during the first write as well as subsequent ones */ + ev_timer_again( ctrl.ev_loop, &ctrl.timeout_watcher ); + /* Everything up to here is blocking. We switch to non-blocking so we * can handle rate-limiting and weird error conditions better. TODO: We * should expand the event loop upwards so we can do the same there too */