]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_range: remove conn->data
authorDaniel Stenberg <daniel@haxx.se>
Wed, 20 Jan 2021 08:29:45 +0000 (09:29 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 20 Jan 2021 13:59:11 +0000 (14:59 +0100)
Closes #6496

lib/curl_range.c
lib/curl_range.h
lib/file.c
lib/ftp.c

index 0a87b1ca52a141d0472671f6966f6b14353c0552..f7fb7c0824cbc56526aad643d8a1f32f80043070 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
   Check if this is a range download, and if so, set the internal variables
   properly.
  */
-CURLcode Curl_range(struct connectdata *conn)
+CURLcode Curl_range(struct Curl_easy *data)
 {
   curl_off_t from, to;
   char *ptr;
   char *ptr2;
-  struct Curl_easy *data = conn->data;
 
   if(data->state.use_range && data->state.range) {
     CURLofft from_t;
index d1f2c6d55f74be55b25ba09abaa17db16bef7009..0a07baf146000c4dffa1581423236fe35c09d747 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -25,6 +25,5 @@
 #include "curl_setup.h"
 #include "urldata.h"
 
-CURLcode Curl_range(struct connectdata *conn);
-
+CURLcode Curl_range(struct Curl_easy *data);
 #endif /* HEADER_CURL_RANGE_H */
index a90dc4b8e2e5bb62aae07070507c191646453a8f..dd8a1fd12ac36f1cc0c6edbe910a46cbca95b599 100644 (file)
@@ -372,7 +372,6 @@ static CURLcode file_do(struct Curl_easy *data, bool *done)
   curl_off_t expected_size = -1;
   bool size_known;
   bool fstated = FALSE;
-  struct connectdata *conn = data->conn;
   char *buf = data->state.buffer;
   curl_off_t bytecount = 0;
   int fd;
@@ -451,7 +450,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done)
   }
 
   /* Check whether file range has been specified */
-  result = Curl_range(conn);
+  result = Curl_range(data);
   if(result)
     return result;
 
index 63bf3f30a3929d39b6be2513534b7ed1524c5532..9014ae4d409dced1e8e4dc38290cd0d7622e1d3e 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3633,7 +3633,7 @@ static CURLcode ftp_do_more(struct Curl_easy *data, int *completep)
       /* download */
       ftp->downloadsize = -1; /* unknown as of yet */
 
-      result = Curl_range(conn);
+      result = Curl_range(data);
 
       if(result == CURLE_OK && data->req.maxdownload >= 0) {
         /* Don't check for successful transfer */