]> granicus.if.org Git - curl/commitdiff
Pawel A. Gajda fixed resumed transfers on persistent connections
authorDaniel Stenberg <daniel@haxx.se>
Tue, 15 May 2001 07:21:13 +0000 (07:21 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 15 May 2001 07:21:13 +0000 (07:21 +0000)
lib/url.c

index 2e8b8b695be383618f8cc4ad6b9f26d4f573a48f..364e1088170d31b42266d3d0078f4da22085b087 100644 (file)
--- 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);