[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 121/282: ftp: convert 'sock_accepted' to a plain boolean
From: |
gnunet |
Subject: |
[gnurl] 121/282: ftp: convert 'sock_accepted' to a plain boolean |
Date: |
Wed, 01 Apr 2020 14:29:46 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit c188391a9fad6dcfa4b77b6180c19e0538e25caa
Author: Daniel Stenberg <address@hidden>
AuthorDate: Sat Feb 15 00:00:45 2020 +0100
ftp: convert 'sock_accepted' to a plain boolean
This was an array indexed with sockindex but it was only ever used for
the secondary socket.
Closes #4929
---
lib/connect.c | 5 ++---
lib/ftp.c | 2 +-
lib/urldata.h | 4 ++--
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/lib/connect.c b/lib/connect.c
index 611d6d2f0..9baadb565 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -1428,12 +1428,11 @@ int Curl_closesocket(struct connectdata *conn,
curl_socket_t sock)
{
if(conn && conn->fclosesocket) {
- if((sock == conn->sock[SECONDARYSOCKET]) &&
- conn->sock_accepted[SECONDARYSOCKET])
+ if((sock == conn->sock[SECONDARYSOCKET]) && conn->sock_accepted)
/* if this socket matches the second socket, and that was created with
accept, then we MUST NOT call the callback but clear the accepted
status */
- conn->sock_accepted[SECONDARYSOCKET] = FALSE;
+ conn->sock_accepted = FALSE;
else {
int rc;
Curl_multi_closed(conn->data, sock);
diff --git a/lib/ftp.c b/lib/ftp.c
index c3efdc4e9..537fd82d1 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -291,7 +291,7 @@ static CURLcode AcceptServerConnect(struct connectdata
*conn)
conn->sock[SECONDARYSOCKET] = s;
(void)curlx_nonblock(s, TRUE); /* enable non-blocking */
- conn->sock_accepted[SECONDARYSOCKET] = TRUE;
+ conn->sock_accepted = TRUE;
if(data->set.fsockopt) {
int error = 0;
diff --git a/lib/urldata.h b/lib/urldata.h
index e2afc6406..e1c3e181b 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -925,8 +925,6 @@ struct connectdata {
curl_socket_t sock[2]; /* two sockets, the second is used for the data
transfer when doing FTP */
curl_socket_t tempsock[2]; /* temporary sockets for happy eyeballs */
- bool sock_accepted[2]; /* TRUE if the socket on this index was created with
- accept() */
Curl_recv *recv[2];
Curl_send *send[2];
@@ -1081,6 +1079,8 @@ struct connectdata {
handle */
BIT(writechannel_inuse); /* whether the write channel is in use by an easy
handle */
+ BIT(sock_accepted); /* TRUE if the SECONDARYSOCKET was created with
+ accept() */
};
/* The end of connectdata. */
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 98/282: ftp: remove superfluous checking for crlf in user or pwd, (continued)
- [gnurl] 98/282: ftp: remove superfluous checking for crlf in user or pwd, gnunet, 2020/04/01
- [gnurl] 105/282: url: Include the failure reason when curl_win32_idn_to_ascii() fails, gnunet, 2020/04/01
- [gnurl] 100/282: digest: Do not quote algorithm in HTTP authorisation, gnunet, 2020/04/01
- [gnurl] 106/282: altsvc: keep a copy of the file name to survive handle reset, gnunet, 2020/04/01
- [gnurl] 112/282: multi: fix outdated comment, gnunet, 2020/04/01
- [gnurl] 113/282: strerror: Increase STRERROR_LEN 128 -> 256, gnunet, 2020/04/01
- [gnurl] 107/282: smtp: Simplify the MAIL command and avoid a duplication of send strings, gnunet, 2020/04/01
- [gnurl] 111/282: easy: remove dead code, gnunet, 2020/04/01
- [gnurl] 108/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 120/282: CURLINFO_COOKIELIST.3: Fix example, gnunet, 2020/04/01
- [gnurl] 121/282: ftp: convert 'sock_accepted' to a plain boolean,
gnunet <=
- [gnurl] 116/282: tool_home: Fix the copyright year being out of date, gnunet, 2020/04/01
- [gnurl] 114/282: strerror.h: Copyright year out of date, gnunet, 2020/04/01
- [gnurl] 115/282: tool_homedir: Change GetEnv() to use libcurl's curl_getenv(), gnunet, 2020/04/01
- [gnurl] 118/282: TODO: CURLOPT_SSL_CTX_FUNCTION for LDAPS, gnunet, 2020/04/01
- [gnurl] 126/282: rename: a new file for Curl_rename(), gnunet, 2020/04/01
- [gnurl] 124/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 110/282: create-dirs.d: mention the mode, gnunet, 2020/04/01
- [gnurl] 109/282: CURLOPT_ALTSVC_CTRL.3: fix the DEFAULT wording, gnunet, 2020/04/01
- [gnurl] 117/282: azure: disable brotli on the macos debug-builds, gnunet, 2020/04/01
- [gnurl] 125/282: cookies: make saving atomic with a rename, gnunet, 2020/04/01