From 05e44d9eab9941095dac034505a4efef30734498 Mon Sep 17 00:00:00 2001 From: Sven Hoexter Date: Sat, 17 Oct 2015 22:14:29 +0200 Subject: [PATCH] Imported Upstream version 7.22.0+hg20151017 --- .hg_archival.txt | 5 +++ configure | 11 ++++++- configure.in | 11 ++++++- doc/tclcurl.html | 2 +- doc/tclcurl.n | 64 +++++++++++++++++++++---------------- doc/tclcurl_multi.html | 2 +- doc/tclcurl_multi.n | 4 +-- doc/tclcurl_share.html | 2 +- doc/tclcurl_share.n | 2 +- generic/tclcurl.c | 18 +++++++++-- generic/tclcurl.h | 2 +- tests/multi/auto.tcl | 2 +- tests/multi/autoGUI.tcl | 2 +- tests/multi/cancelTrans.tcl | 2 +- 14 files changed, 88 insertions(+), 41 deletions(-) create mode 100644 .hg_archival.txt diff --git a/.hg_archival.txt b/.hg_archival.txt new file mode 100644 index 0000000..98a7ef7 --- /dev/null +++ b/.hg_archival.txt @@ -0,0 +1,5 @@ +repo: 11ea73a1b3c3793635669d40e602ff7f52f53e3a +node: b5bc0662447d3c92cc8d30e637e5a25457eac077 +branch: default +latesttag: null +latesttagdistance: 13 diff --git a/configure b/configure index e7d6656..40ae6ce 100755 --- a/configure +++ b/configure @@ -4939,7 +4939,16 @@ fi $as_echo "yes" >&6; } - vars="`$curlpath/curl-config --libs`" +# We need to modify this original line to strip a few things +# See: http://lists.debian.org/debian-devel-announce/2006/09/msg00018.html + + vars="`$curlpath/curl-config --libs|sed \ + -e 's/\-lkrb5\>//g' \ + -e 's/\-lgssapi_krb5//g' \ + -e 's/\-lk5crypto//g' \ + -e 's/\-lkrb5support//g' \ + `" + for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib diff --git a/configure.in b/configure.in index 6f1a6ee..951d9b6 100755 --- a/configure.in +++ b/configure.in @@ -134,7 +134,16 @@ if test "${CURL_VERSION}" != "" ; then fi AC_MSG_RESULT(yes) -TEA_ADD_LIBS([`$curlpath/curl-config --libs`]) +# We need to modify this original line to strip a few things +# See: http://lists.debian.org/debian-devel-announce/2006/09/msg00018.html + +TEA_ADD_LIBS([`$curlpath/curl-config --libs|sed \ + -e 's/\-lkrb5\>//g' \ + -e 's/\-lgssapi_krb5//g' \ + -e 's/\-lk5crypto//g' \ + -e 's/\-lkrb5support//g' \ + `]) + #-------------------------------------------------------------------- # __CHANGE__ diff --git a/doc/tclcurl.html b/doc/tclcurl.html index f74d42a..5758241 100755 --- a/doc/tclcurl.html +++ b/doc/tclcurl.html @@ -1,7 +1,7 @@ Manpage of TclCurl

TclCurl

-Section: Easy inteface (n)
Updated: 03 October 2011
+Section: Easy inteface (3)
Updated: 03 October 2011
 

NAME

diff --git a/doc/tclcurl.n b/doc/tclcurl.n index 482689a..6e7227a 100755 --- a/doc/tclcurl.n +++ b/doc/tclcurl.n @@ -1,7 +1,7 @@ .\" You can view this file with: .\" nroff -man [file] .\" Adapted from libcurl docs by fandom@telefonica.net -.TH TclCurl n "3 October 2011" "TclCurl 7.22.0 "TclCurl Easy Interface" +.TH TclCurl 3 "3 October 2011" "TclCurl 7.22.0 "TclCurl Easy Interface" .SH NAME TclCurl: - get a URL with FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE, LDAP, LDAPS, IMAP, IMAPS, POP, POP3, SMTP, SMTPS and gopher syntax. @@ -19,7 +19,7 @@ LDAPS, IMAP, IMAPS, POP, POP3, SMTP, SMTPS and gopher syntax. .sp .IB curlhandle " reset" .sp -.IB curlHandle " duhandle" +.IB curlHandle " duphandle" .sp .IB curlHandle " pause" .sp @@ -52,7 +52,7 @@ curl and this call MUST have a corresponding call to .I cleanup when the operation is completed. You should perform all your sequential file transfers using the same -curlHandle. This enables TclCurl to use persistant connections when +curlHandle. This enables TclCurl to use persistent connections when possible. .sp .B RETURN VALUE @@ -347,7 +347,7 @@ allows you to have a TclCurl built to support a wide range of protocols but stil specific transfers to only be allowed to use a subset of them. Accepted protocols are 'http', 'https', 'ftp', 'ftps', 'scp', 'sftp', 'telnet', 'ldap', -'ldaps','dict', 'file','tftp', 'imap', 'imaps', 'pop', 'pop3', 'smtp', 'smtps', 'gopher' +\&'ldaps', 'dict', 'file','tftp', 'imap', 'imaps', 'pop', 'pop3', 'smtp', 'smtps', 'gopher' and 'all'. .TP @@ -397,12 +397,12 @@ HTTP proxies. .B -proxyport Use this option to set the proxy port to use unless it is specified in the proxy string by \fB-proxy\fP. If not specified, TclCurl will default --to using port 1080 for proxies. +to using port 1080 for proxies. .TP .B -proxytype Pass the type of the proxy. Available options are 'http', 'http1.0', 'socks4', 'socks4a', -'socks5' and 'socks5h', with the HTTP one being the default. +\&'socks5' and 'socks5h', with the HTTP one being the default. If you set it to \fIhttp1.0\fP, it will only affect how libcurl speaks to a proxy when CONNECT is used. The HTTP version used for "regular" HTTP requests is instead @@ -460,7 +460,7 @@ too low might cause unnecessary connection setup failures. .TP .B -dnscachetimeout Pass the timeout in seconds. Name resolves will be kept in memory for this number -of seconds. Set to '0' to completely disable caching, or '-1' to make the +of seconds. Set to '0' to completely disable caching, or '\-1' to make the cached entries remain forever. By default, TclCurl caches this info for 60 seconds. The name resolve functions of various libc implementations don't re-read name @@ -479,7 +479,7 @@ to using the share interface instead! See \fItclcurl_share\fP. .TP .B -buffersize -Pass your prefered size for the receive buffer in TclCurl. The main point of this +Pass your preferred size for the receive buffer in TclCurl. The main point of this would be that the write callback gets called more often and with smaller chunks. This is just treated as a request, not an order. You cannot be guaranteed to actually get the given size. @@ -657,11 +657,12 @@ TclCurl will automatically select the one it finds most secure. .TP .B anysafe -It may use anything but basic, TclCurl will automaticly select the +It may use anything but basic, TclCurl will automatically select the one it finds most secure. .RE -.TP -tlsauthtype +.TP +.B -tlsauthtype Use it to tell TclCurl which authentication method(s) you want it to use for TLS authentication. .RS .TP 5 @@ -761,7 +762,7 @@ is meaningful only when setting \fB-followlocation\fP. Sets the redirection limit. If that many redirections have been followed, the next redirect will cause an error. This option only makes sense if the \fB-followlocation\fP option is used at the same time. Setting the limit -to 0 will make libcurl refuse any redirect. Set it to -1 for an infinite +to 0 will make libcurl refuse any redirect. Set it to \-1 for an infinite number of redirects (which is the default) .TP @@ -961,17 +962,17 @@ response will be treated as a valid HTTP header line such as "HTTP/1.0 200 OK". .TP .B -cookie -Pass a string as parameter. It will be used to -set a cookie in the http request. The format of the string should be -'[NAME]=[CONTENTS];'. Where NAME is the cookie name and CONTENTS is -what the cookie should contain. +Pass a string as parameter. +It will be used to set a cookie in the http request. The format of +the string should be '[NAME]=[CONTENTS];'. Where NAME is the cookie +name and CONTENTS is what the cookie should contain. If you need to set mulitple cookies, you need to set them all using a single option and thus you need to concatenate them all in one single string. Set multiple cookies in one string like this: "name1=content1; name2=content2;" etc. -This option sets the cookie header explictly in the outgoing request(s). +This option sets the cookie header explicitly in the outgoing request(s). If multiple requests are done due to authentication, followed redirections or similar, they will all get this cookie passed on. @@ -1341,7 +1342,7 @@ Pass the offset in number of bytes that you want the transfer to start from. Set this option to 0 to make the transfer start from the beginning (effectively disabling resume). -For FTP, set this option to -1 to make the transfer start from the end of the +For FTP, set this option to \-1 to make the transfer start from the end of the target file (useful to continue an interrupted upload). When doing uploads with FTP, the resume position is where in the local/source @@ -1467,7 +1468,7 @@ than or equal to the parameter value. Defaults to unlimited speed. .TP .B -maxconnects -Sets the persistant connection cache size in all the protocols that support +Sets the persistent connection cache size in all the protocols that support persistent conecctions. The set amount will be the maximum amount of simultaneous connections that TclCurl may cache in this easy handle. Default is 5, and there isn't much point in changing this value unless you are perfectly aware of how this @@ -1536,7 +1537,7 @@ HOST+PORT will instead use your provided ADDRESS. You can remove names from the DNS cache again, to stop providing these fake resolves, by including a string in the linked list that uses the format -"-HOST:PORT". The host name must be prefixed with a dash, and the host name +"\-HOST:PORT". The host name must be prefixed with a dash, and the host name and port number must exactly match what was already added previously. .TP @@ -1636,6 +1637,15 @@ Force SSLv2 .TP .B sslv3 Force SSLv3 +.TP +.B tlsv1_0 +Force TLSv1.0 +.TP +.B tlsv1_1 +Force TLSv1.1 +.TP +.B tlsv1_2 +Force TLSv1.2 .RE .TP @@ -1771,7 +1781,7 @@ are also acceptable separators but colons are normally used, , - and + can be used as operators. For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA', 'SHA1+DES', -'TLSv1' and 'DEFAULT'. The default list is normally set when you compile OpenSSL. +\&'TLSv1' and 'DEFAULT'. The default list is normally set when you compile OpenSSL. You will find more details about cipher lists on this URL: http://www.openssl.org/docs/apps/ciphers.html @@ -1781,7 +1791,7 @@ etc. With NSS you don't add/remove ciphers. If you use this option then all know ciphers are disabled and only those passed in are enabled. You'll find more details about the NSS cipher lists on this URL: - http://directory.fedora.redhat.com/docs/mod_nss.html + .TP .B -sslsessionidcache @@ -1976,7 +1986,7 @@ same handle. Let it return first before invoking it another time. If you want parallel transfers, you must use several curl handles. .TP .B RETURN VALUE -'0' if all went well, non-zero if it didn't. In case of error, if the +\&'0' if all went well, non-zero if it didn't. In case of error, if the .I errorbuffer was set with .I configure @@ -2077,7 +2087,7 @@ Internal error. A function was called with a bad parameter. Interface error. A specified outgoing interface could not be used. .IP 47 Too many redirects. When following redirects, TclCurl hit the maximum amount, set -your limit with --maxredirs +your limit with \-\-maxredirs .IP 48 An option passed to TclCurl is not recognized/known. Refer to the appropriate documentation. This is most likely a problem in the program that uses @@ -2186,7 +2196,7 @@ Returns the last received proxy response code to a CONNECT request. .TP .B filetime Returns the remote time of the retrieved document (in number of seconds -since 1 jan 1970 in the GMT/UTC time zone). If you get -1, +since 1 jan 1970 in the GMT/UTC time zone). If you get \-1, it can be because of many reasons (unknown, the server hides it or the server doesn't support the command that tells document time etc) and the time of the document is unknown. @@ -2303,7 +2313,7 @@ requests. Note that this may be more than one request if followLocation is true. .TP .B sslverifyresult Returns the result of the certification verification that was requested -(using the -sslverifypeer option to configure). +(using the \-sslverifypeer option to configure). .TP .B sslengines @@ -2315,7 +2325,7 @@ engines may be available at run-time. .B contentlengthdownload Returns the content-length of the download. This is the value read from the .B Content-Length: -field. If the size isn't known, it returns -1. +field. If the size isn't known, it returns \-1. .TP .B contentlengthupload @@ -2412,7 +2422,7 @@ to pause the transfer. Resumes a transfer paused with \fBcurlhandle pause\fP .SH curl::transfer -In case you do not want to use persistant connections you can use this +In case you do not want to use persistent connections you can use this command, it takes the same arguments as the \fIcurlHandle\fP \fBconfigure\fP and will init, configure, perform and cleanup a connection for you. diff --git a/doc/tclcurl_multi.html b/doc/tclcurl_multi.html index 82a35db..51c40ae 100755 --- a/doc/tclcurl_multi.html +++ b/doc/tclcurl_multi.html @@ -1,7 +1,7 @@ Manpage of TclCurl

TclCurl

-Section: TclCurl Multi Interface (n)
Updated: 03 September 2011

+Section: TclCurl Multi Interface (3)
Updated: 03 September 2011

 

NAME

diff --git a/doc/tclcurl_multi.n b/doc/tclcurl_multi.n index 7bf2014..e43795f 100755 --- a/doc/tclcurl_multi.n +++ b/doc/tclcurl_multi.n @@ -1,7 +1,7 @@ .\" You can view this file with: .\" nroff -man [file] .\" Adapted from libcurl docs by fandom@telefonica.net -.TH TclCurl n "3 October 2011" "TclCurl 7.22.0 "TclCurl Easy Interface" +.TH TclCurl 3 "3 October 2011" "TclCurl 7.22.0 "TclCurl Easy Interface" .SH NAME TclCurl: - get a URL with FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE, LDAP, LDAPS, IMAP, IMAPS, POP, POP3, SMTP, SMTPS and gopher syntax. @@ -186,7 +186,7 @@ you can use the command, it will return the number of transfers currently active. .sp .B RETURN VALUE -The number of active transfers or '-1' in case of error. +The number of active transfers or '\-1' in case of error. .SH multiHandle getinfo This procedure returns very simple information about the transfers, you diff --git a/doc/tclcurl_share.html b/doc/tclcurl_share.html index 12549ae..685e7f9 100755 --- a/doc/tclcurl_share.html +++ b/doc/tclcurl_share.html @@ -1,7 +1,7 @@ Manpage of TclCurl

TclCurl

-Section: TclCurl share data api (n)
Updated: 03 October 2011

+Section: TclCurl share data api (3)
Updated: 03 October 2011

 

NAME

diff --git a/doc/tclcurl_share.n b/doc/tclcurl_share.n index 8eea8bf..6cd1d97 100755 --- a/doc/tclcurl_share.n +++ b/doc/tclcurl_share.n @@ -1,7 +1,7 @@ .\" You can view this file with: .\" nroff -man [file] .\" Adapted from libcurl docs by fandom@telefonica.net -.TH TclCurl n "3 October 2011" "TclCurl 7.22.0 "TclCurl Easy Interface" +.TH TclCurl 3 "3 October 2011" "TclCurl 7.22.0 "TclCurl Easy Interface" .SH NAME TclCurl: - get a URL with FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE, LDAP, LDAPS, IMAP, IMAPS, POP, POP3, SMTP, SMTPS and gopher syntax. diff --git a/generic/tclcurl.c b/generic/tclcurl.c index 8185c30..21c947c 100755 --- a/generic/tclcurl.c +++ b/generic/tclcurl.c @@ -748,8 +748,13 @@ curlSetOpts(Tcl_Interp *interp, struct curlObjData *curlData, /* fprintf(stdout,"Section contents: %s\n",Tcl_GetString(httpPostData[i+1]));*/ tmpStr=Tcl_GetStringFromObj(httpPostData[i+1],&curlformBufferSize); formArray[formArrayIndex].option = CURLFORM_COPYCONTENTS; - formArray[formArrayIndex].value = (char *) - memcpy(Tcl_Alloc(curlformBufferSize), tmpStr, curlformBufferSize); + + formArray[formArrayIndex].value = Tcl_Alloc((curlformBufferSize > 0) ? curlformBufferSize : 1); + if (curlformBufferSize > 0) { + memcpy((char *)formArray[formArrayIndex].value,tmpStr,curlformBufferSize); + } else { + memset((char *)formArray[formArrayIndex].value,0,1); + } formArrayIndex++; formArray[formArrayIndex].option = CURLFORM_CONTENTSLENGTH; @@ -854,6 +859,15 @@ curlSetOpts(Tcl_Interp *interp, struct curlObjData *curlData, break; case 3: longNumber=CURL_SSLVERSION_SSLv3; + break; + case 4: + longNumber=CURL_SSLVERSION_TLSv1_0; + break; + case 5: + longNumber=CURL_SSLVERSION_TLSv1_1; + break; + case 6: + longNumber=CURL_SSLVERSION_TLSv1_2; } tmpObjPtr=Tcl_NewLongObj(longNumber); if (SetoptLong(interp,curlHandle,CURLOPT_SSLVERSION, diff --git a/generic/tclcurl.h b/generic/tclcurl.h index 4223b39..acbee1f 100755 --- a/generic/tclcurl.h +++ b/generic/tclcurl.h @@ -344,7 +344,7 @@ CONST static char *ftpsslccc[] = { }; CONST static char *sslversion[] = { - "default", "tlsv1", "sslv2", "sslv3", (char *)NULL + "default", "tlsv1", "sslv2", "sslv3", "tlsv1_0", "tlsv1_1", "tlsv1_2", (char *)NULL }; CONST static char *ftpfilemethod[] = { diff --git a/tests/multi/auto.tcl b/tests/multi/auto.tcl index 7c69cd8..c8b5b9f 100755 --- a/tests/multi/auto.tcl +++ b/tests/multi/auto.tcl @@ -1,4 +1,4 @@ -#!/usr/local/bin/wish8.4 +#!/usr/bin/wish package require TclCurl diff --git a/tests/multi/autoGUI.tcl b/tests/multi/autoGUI.tcl index ace2423..09ef3dd 100755 --- a/tests/multi/autoGUI.tcl +++ b/tests/multi/autoGUI.tcl @@ -1,4 +1,4 @@ -#!/usr/local/bin/wish8.4 +#!/usr/bin/wish package require TclCurl diff --git a/tests/multi/cancelTrans.tcl b/tests/multi/cancelTrans.tcl index 6dad215..1375dd5 100755 --- a/tests/multi/cancelTrans.tcl +++ b/tests/multi/cancelTrans.tcl @@ -1,4 +1,4 @@ -#!/usr/local/bin/wish8.4 +#!/usr/bin/wish package require TclCurl -- 2.39.5