mirror: Ensure the mirror client socket is closed after a fail, and before a retry

This commit is contained in:
nick
2013-08-27 15:54:59 +01:00
parent 14fde0f2a1
commit 0494295705

View File

@@ -861,6 +861,16 @@ void* mirror_runner(void* serve_params_uncast)
}
mirror_run( serve );
/* On success, this is unnecessary, and harmless ( mirror_cleanup does it
* for us ). But if we've failed and are going to retry on the next run, we
* must close this socket here to have any chance of it succeeding.
*/
if ( !mirror->client < 0 ) {
sock_try_close( mirror->client );
mirror->client = -1;
}
abandon_mirror:
return NULL;
}