From 56d1891db6d8056a70f1b7bf437b1ba387cbc079 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 20 Jan 2021 09:29:45 +0100 Subject: curl_range: remove conn->data Closes #6496 --- lib/curl_range.c | 5 ++--- lib/curl_range.h | 5 ++--- lib/file.c | 3 +-- lib/ftp.c | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/curl_range.c b/lib/curl_range.c index 0a87b1ca5..f7fb7c082 100644 --- a/lib/curl_range.c +++ b/lib/curl_range.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -33,12 +33,11 @@ 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; diff --git a/lib/curl_range.h b/lib/curl_range.h index d1f2c6d55..0a07baf14 100644 --- a/lib/curl_range.h +++ b/lib/curl_range.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, , 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 */ diff --git a/lib/file.c b/lib/file.c index a90dc4b8e..dd8a1fd12 100644 --- a/lib/file.c +++ b/lib/file.c @@ -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; diff --git a/lib/ftp.c b/lib/ftp.c index 63bf3f30a..9014ae4d4 100644 --- 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 */ -- cgit v1.2.1 From ba4808d53ce062863b36be580ffc41d3495b32ee Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 20 Jan 2021 09:30:10 +0100 Subject: ftp: remove conn->data leftover --- lib/ftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ftp.c b/lib/ftp.c index 9014ae4d4..29566fb2f 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -830,7 +830,7 @@ static int ftp_domore_getsock(struct Curl_easy *data, connect on the secondary connection */ socks[0] = conn->sock[FIRSTSOCKET]; - if(!conn->data->set.ftp_use_port) { + if(!data->set.ftp_use_port) { int s; int i; /* PORT is used to tell the server to connect to us, and during that we -- cgit v1.2.1