summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/file.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2020-12-12 21:52:50 +0300
committerdartraiden <wowemuh@gmail.com>2020-12-12 21:52:50 +0300
commit3b96a0dcef3c7e1de852025cfea5a9e56486021c (patch)
treee0f3d4006a618993b1c70f507cc32c707db5e73b /libs/libcurl/src/file.c
parent346d20620a22103175778d0ae96299af9f93c7ea (diff)
libcurl: update to 7.74.0
Diffstat (limited to 'libs/libcurl/src/file.c')
-rw-r--r--libs/libcurl/src/file.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/libs/libcurl/src/file.c b/libs/libcurl/src/file.c
index 1872dfef0d..a65eb7798d 100644
--- a/libs/libcurl/src/file.c
+++ b/libs/libcurl/src/file.c
@@ -9,7 +9,7 @@
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -119,8 +119,8 @@ const struct Curl_handler Curl_handler_file = {
static CURLcode file_setup_connection(struct connectdata *conn)
{
/* allocate the FILE specific struct */
- conn->data->req.protop = calloc(1, sizeof(struct FILEPROTO));
- if(!conn->data->req.protop)
+ conn->data->req.p.file = calloc(1, sizeof(struct FILEPROTO));
+ if(!conn->data->req.p.file)
return CURLE_OUT_OF_MEMORY;
return CURLE_OK;
@@ -135,7 +135,7 @@ static CURLcode file_connect(struct connectdata *conn, bool *done)
{
struct Curl_easy *data = conn->data;
char *real_path;
- struct FILEPROTO *file = data->req.protop;
+ struct FILEPROTO *file = data->req.p.file;
int fd;
#ifdef DOS_FILESYSTEM
size_t i;
@@ -209,7 +209,7 @@ static CURLcode file_connect(struct connectdata *conn, bool *done)
static CURLcode file_done(struct connectdata *conn,
CURLcode status, bool premature)
{
- struct FILEPROTO *file = conn->data->req.protop;
+ struct FILEPROTO *file = conn->data->req.p.file;
(void)status; /* not used */
(void)premature; /* not used */
@@ -227,18 +227,8 @@ static CURLcode file_done(struct connectdata *conn,
static CURLcode file_disconnect(struct connectdata *conn,
bool dead_connection)
{
- struct FILEPROTO *file = conn->data->req.protop;
(void)dead_connection; /* not used */
-
- if(file) {
- Curl_safefree(file->freepath);
- file->path = NULL;
- if(file->fd != -1)
- close(file->fd);
- file->fd = -1;
- }
-
- return CURLE_OK;
+ return file_done(conn, 0, 0);
}
#ifdef DOS_FILESYSTEM
@@ -249,7 +239,7 @@ static CURLcode file_disconnect(struct connectdata *conn,
static CURLcode file_upload(struct connectdata *conn)
{
- struct FILEPROTO *file = conn->data->req.protop;
+ struct FILEPROTO *file = conn->data->req.p.file;
const char *dir = strchr(file->path, DIRSEP);
int fd;
int mode;
@@ -391,7 +381,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
if(data->set.upload)
return file_upload(conn);
- file = conn->data->req.protop;
+ file = conn->data->req.p.file;
/* get the fd from the connection phase */
fd = file->fd;