[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 74/208: socks: deduplicate the code for auth reques
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 74/208: socks: deduplicate the code for auth request |
Date: |
Wed, 09 Aug 2017 17:34:31 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.55.0
in repository gnurl.
commit cd1c9f08078d4a8566ed10f6df9ae9a729f3290b
Author: Kamil Dudka <address@hidden>
AuthorDate: Wed Mar 8 12:16:01 2017 +0100
socks: deduplicate the code for auth request
---
lib/socks.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/lib/socks.c b/lib/socks.c
index b55fa9b8c..968b720b7 100644
--- a/lib/socks.c
+++ b/lib/socks.c
@@ -375,6 +375,7 @@ CURLcode Curl_SOCKS5(const char *proxy_user,
*/
unsigned char socksreq[600]; /* room for large user/pw (255 max each) */
+ int idx;
ssize_t actualread;
ssize_t written;
int result;
@@ -426,17 +427,17 @@ CURLcode Curl_SOCKS5(const char *proxy_user,
return CURLE_COULDNT_CONNECT;
}
- socksreq[0] = 5; /* version */
+ idx = 0;
+ socksreq[idx++] = 5; /* version */
+ idx++; /* reserve for the number of authentication methods */
+ socksreq[idx++] = 0; /* no authentication */
#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
- socksreq[1] = (char)(proxy_user ? 3 : 2); /* number of methods (below) */
- socksreq[2] = 0; /* no authentication */
- socksreq[3] = 1; /* GSS-API */
- socksreq[4] = 2; /* username/password */
-#else
- socksreq[1] = (char)(proxy_user ? 2 : 1); /* number of methods (below) */
- socksreq[2] = 0; /* no authentication */
- socksreq[3] = 2; /* username/password */
+ socksreq[idx++] = 1; /* GSS-API */
#endif
+ if(proxy_user)
+ socksreq[idx++] = 2; /* username/password */
+ /* write the number of authentication methods */
+ socksreq[1] = (unsigned char) (idx - 2);
(void)curlx_nonblock(sock, FALSE);
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 40/208: http_proxy: fix build with http and proxy, (continued)
- [GNUnet-SVN] [gnurl] 40/208: http_proxy: fix build with http and proxy, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 51/208: travis: do the distcheck test build out-of-tree as well, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 43/208: PIPELINING_SERVER_BL: cleanup the internal list use, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 37/208: TODO: implement support for CURLOPT_PREQUOTE with SFTP, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 73/208: socks: use proxy_user instead of proxy_name, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 70/208: test1537: fixed memory leak on OOM, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 22/208: url: refactor the check for Windows drive letter in path, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 54/208: ci: whitelist branches to avoid testing feature branches twice, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 49/208: test1521: test getinfo's OFF_T types too, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 29/208: http-proxy: fix chunked-encoded CONNECT responses, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 74/208: socks: deduplicate the code for auth request,
gnunet <=
- [GNUnet-SVN] [gnurl] 69/208: test1521: fix compiler warnings, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 44/208: getinfo: return sizes as curl_off_t, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 31/208: curl-compilers.m4: enable double-promotion warning, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 50/208: http: add --strip-path-slash and CURLOPT_STRIP_PATH_SLASH, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 35/208: curl: prevent binary output spewed to terminal, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 86/208: make: build the docs subdir only from within src, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 84/208: test1450: add simple testing for DICT, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 99/208: configure: try ldap/lber in reversed order first, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 93/208: tool_sleep: typecast to avoid macos compiler warning, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 97/208: dist: add SMB python deps into the tarball, gnunet, 2017/08/09