summaryrefslogtreecommitdiff
path: root/src/htsback.c
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2013-04-14 13:49:05 +0000
committerXavier Roche <xroche@users.noreply.github.com>2013-04-14 13:49:05 +0000
commit9f9e5f2221777f956663cfe24459b5f450113198 (patch)
treef7a501e7226792137b874968bf53401e6d7c9684 /src/htsback.c
parent68270ec277050b164a32142179b4b7df08366829 (diff)
Fixed file descriptor resurrection inside back_unserialize() leading to close randomly files or sockets
This really annoying bug may be the root cause of various related issues while updating of continuing a mirror: * zip_zipWriteInFileInZip_failed assertion failures * random garbage in downloaded files * random "bogus state" error messages * connection unexpectedly closed Probably closes issue 5 (http://code.google.com/p/httrack/issues/detail?id=5)
Diffstat (limited to 'src/htsback.c')
-rw-r--r--src/htsback.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/htsback.c b/src/htsback.c
index 4276b9b..87df61e 100644
--- a/src/htsback.c
+++ b/src/htsback.c
@@ -906,6 +906,7 @@ int back_unserialize(FILE *fp, lien_back** dst) {
(*dst)->r.out = NULL;
(*dst)->r.location = (*dst)->location_buffer;
(*dst)->r.fp = NULL;
+ (*dst)->r.soc = INVALID_SOCKET;
#if HTS_USEOPENSSL
(*dst)->r.ssl_con = NULL;
#endif