[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 372/411: file: avoid duplicated code sequence
From: |
gnunet |
Subject: |
[gnurl] 372/411: file: avoid duplicated code sequence |
Date: |
Wed, 13 Jan 2021 01:23:07 +0100 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 12cb7a1fe0282cc0b1ef4faa6013a2de03028aac
Author: Emil Engler <me@emilengler.com>
AuthorDate: Wed Nov 25 18:26:56 2020 +0100
file: avoid duplicated code sequence
file_disconnect() is identical with file_do() except the function header
but as the arguments are unused anyway so why not just return file_do()
directly!
Reviewed-by: Daniel Stenberg
Closes #6249
---
lib/file.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/lib/file.c b/lib/file.c
index 5f06c4cca..a65eb7798 100644
--- a/lib/file.c
+++ b/lib/file.c
@@ -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.p.file;
(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
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnurl] 364/411: http3: use the master branch of GnuTLS for testing, (continued)
- [gnurl] 364/411: http3: use the master branch of GnuTLS for testing, gnunet, 2021/01/12
- [gnurl] 349/411: KNOWN_BUGS: cmake libcurl.pc uses absolute library paths, gnunet, 2021/01/12
- [gnurl] 278/411: CURLOPT_DNS_USE_GLOBAL_CACHE.3: fix typo, gnunet, 2021/01/12
- [gnurl] 329/411: Revert "libcurl.pc: make it relocatable", gnunet, 2021/01/12
- [gnurl] 327/411: Curl_pgrsStartNow: init speed limit time stamps at start, gnunet, 2021/01/12
- [gnurl] 310/411: KNOWN_BUGS: FTPS with Schannel times out file list operation, gnunet, 2021/01/12
- [gnurl] 295/411: travis: use valgrind when running tests for debug builds, gnunet, 2021/01/12
- [gnurl] 342/411: CURLOPT_HSTS.3: document the file format, gnunet, 2021/01/12
- [gnurl] 290/411: http: pass correct header size to debug callback for chunked post, gnunet, 2021/01/12
- [gnurl] 377/411: socks: check for DNS entries with the right port number, gnunet, 2021/01/12
- [gnurl] 372/411: file: avoid duplicated code sequence,
gnunet <=
- [gnurl] 376/411: curl_setup: USE_RESOLVE_ON_IPS is for Apple native resolver use, gnunet, 2021/01/12
- [gnurl] 292/411: tests: add missing global_init/cleanup calls, gnunet, 2021/01/12
- [gnurl] 356/411: openssl: guard against OOM on context creation, gnunet, 2021/01/12
- [gnurl] 280/411: mailmap: set Viktor Szakats's email, gnunet, 2021/01/12
- [gnurl] 269/411: CI/appveyor: disable test 571 in two cmake builds, gnunet, 2021/01/12
- [gnurl] 326/411: ngtcp2: adapt to recent nghttp3 updates, gnunet, 2021/01/12
- [gnurl] 411/411: add lowercase curl, gnunet, 2021/01/12
- [gnurl] 393/411: SECURITY-PROCESS: disclose on hackerone, gnunet, 2021/01/12
- [gnurl] 385/411: openssl: free mem_buf in error path, gnunet, 2021/01/12
- [gnurl] 397/411: ftp: retry getpeername for FTP with TCP_FASTOPEN, gnunet, 2021/01/12