aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-05-15 07:21:13 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-05-15 07:21:13 +0000
commit8526fa97ce02e55e480c8d29e50e1d0ac31934ee (patch)
treef5636086423f3ec2c13fcf24981075c4aad9422a
parentf85c29aad81d686dc490923cafd9a59f03b06aab (diff)
Pawel A. Gajda fixed resumed transfers on persistent connections
-rw-r--r--lib/url.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/url.c b/lib/url.c
index 2e8b8b695..364e10881 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2043,6 +2043,21 @@ static CURLcode Connect(struct UrlData *data,
free(old_conn); /* we don't need this anymore */
+ /*
+ * If we're doing a resumed transfer, we need to setup our stuff
+ * properly.
+ */
+ conn->resume_from = data->set_resume_from;
+ if (conn->resume_from) {
+ snprintf(resumerange, sizeof(resumerange), "%d-", conn->resume_from);
+ if (conn->bits.rangestringalloc == TRUE)
+ free(conn->range);
+
+ /* tell ourselves to fetch this range */
+ conn->range = strdup(resumerange);
+ conn->bits.rangestringalloc = TRUE; /* mark range string allocated */
+ }
+
*in_connect = conn; /* return this instead! */
infof(data, "Re-using existing connection! (#%d)\n", conn->connectindex);