From d37e0d902f6a4e8de256c0db78b30fa3890b88eb Mon Sep 17 00:00:00 2001 From: dtiedy Date: Tue, 21 Aug 2012 10:13:42 -0700 Subject: [PATCH 1/4] Added SSH support to curl (sftp) Signed-off-by: dtiedy --- Src/modules.jambuild/lua-curl.jam | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Src/modules.jambuild/lua-curl.jam b/Src/modules.jambuild/lua-curl.jam index b1daaa7e8..0b4702b04 100644 --- a/Src/modules.jambuild/lua-curl.jam +++ b/Src/modules.jambuild/lua-curl.jam @@ -286,10 +286,13 @@ ActiveProject cURL ; SourceGroup : libcurl : $(CURL_LIB_SRCS) ; SourceGroup : zlib : $(ZLIB_SRCS) ; -if $(MSVCNT) && $(PLATFORM) in win32 win64 { +#if $(MSVCNT) && $(PLATFORM) in win32 win64 { C.Defines : __WIN32__ CURL_STATICLIB CURL_DISABLE_LDAP ; C.Defines : HAVE_ZLIB_H HAVE_ZLIB HAVE_LIBZ ; + C.Defines : USE_LIBSSH2 HAVE_LIBSSH2 HAVE_LIBSSH2_H LIBSSH2_WIN32 LIBSSH2_LIBRARY ; + C.IncludeDirectories : ../zlib ; + C.IncludeDirectories : d:/libssh2/include ; C.Defines : USE_SSLEAY ; if $(PLATFORM) = win32 { @@ -300,13 +303,14 @@ if $(MSVCNT) && $(PLATFORM) in win32 win64 { C.LinkDirectories : c:/OpenSSL-Win64/lib/VC/static ; } + C.LinkDirectories : d:/libssh2/win32/lib ; #C.LinkPrebuiltLibraries : libeay32 ssleay32 ; - C.LinkPrebuiltLibraries : libeay32MT ssleay32MT advapi32 gdi32 user32 ; + C.LinkPrebuiltLibraries : libeay32MT ssleay32MT libssh2 advapi32 gdi32 user32 ; C.IncludeDirectories : src/curl-7.21.6/include ; C.LinkPrebuiltLibraries : ws2_32 ; Lua.CModule : : $(CURL_LIB_SRCS) $(SRCS) ; -} +#} } From 96465f20012b9ca4b898caac38f88bc62587cde4 Mon Sep 17 00:00:00 2001 From: dtiedy Date: Thu, 23 Aug 2012 15:41:10 -0700 Subject: [PATCH 2/4] Added a few curl options to luacURL * CURLOPT_FTP_CREATE_MISSING_DIRS * CURLOPT_DIRLISTONLY * CURLOPT_PREQUOTE * CURLOPT_QUOTE * CURLOPT_POSTQUOTE Signed-off-by: dtiedy --- Src/Modules/lua-curl/src/Lua-cURL-setopt.c | 6 ++++++ Src/modules.jambuild/lbuffer.jam | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Src/Modules/lua-curl/src/Lua-cURL-setopt.c b/Src/Modules/lua-curl/src/Lua-cURL-setopt.c index 7e44f0967..6f6362e88 100644 --- a/Src/Modules/lua-curl/src/Lua-cURL-setopt.c +++ b/Src/Modules/lua-curl/src/Lua-cURL-setopt.c @@ -196,6 +196,7 @@ static struct { {P"http_transfer_decoding ", CURLOPT_HTTP_TRANSFER_DECODING , l_easy_setopt_long}, #endif /* ftp options */ + {P"ftpcreatemissingdirs", CURLOPT_FTP_CREATE_MISSING_DIRS, l_easy_setopt_long}, /* protocol options */ {P"transfertext", CURLOPT_TRANSFERTEXT, l_easy_setopt_long}, {P"crlf", CURLOPT_CRLF, l_easy_setopt_long}, @@ -227,6 +228,11 @@ static struct { {P"port", CURLOPT_PORT, l_easy_setopt_long}, {P"TCP_nodelay", CURLOPT_TCP_NODELAY, l_easy_setopt_long}, {P"ssl_verifypeer", CURLOPT_SSL_VERIFYPEER, l_easy_setopt_long}, + {P"dirlistonly", CURLOPT_DIRLISTONLY, l_easy_setopt_long}, + {P"prequote", CURLOPT_PREQUOTE, l_easy_setopt_strings}, + {P"quote", CURLOPT_QUOTE, l_easy_setopt_strings}, + {P"postquote", CURLOPT_POSTQUOTE, l_easy_setopt_strings}, + /* ssl options */ {P"sslcert", CURLOPT_SSLCERT, l_easy_setopt_string}, {P"sslcerttype", CURLOPT_SSLCERTTYPE, l_easy_setopt_string}, diff --git a/Src/modules.jambuild/lbuffer.jam b/Src/modules.jambuild/lbuffer.jam index 86a20833b..4ef861b4b 100644 --- a/Src/modules.jambuild/lbuffer.jam +++ b/Src/modules.jambuild/lbuffer.jam @@ -1 +1 @@ -Lua.CModule lbuffer : buffer : lbuffer.c lbuffer.h lb_interface.c ; +# Lua.CModule lbuffer : buffer : lbuffer.c lbuffer.h lb_interface.c ; From 0781c6b6f1e170dbee40a1ecfdf87663e2b85548 Mon Sep 17 00:00:00 2001 From: dtiedy Date: Fri, 24 Aug 2012 10:37:44 -0700 Subject: [PATCH 3/4] Added some ssh options to luaCurl Signed-off-by: dtiedy --- Src/Modules/lua-curl/src/Lua-cURL-setopt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Src/Modules/lua-curl/src/Lua-cURL-setopt.c b/Src/Modules/lua-curl/src/Lua-cURL-setopt.c index 6f6362e88..a59600334 100644 --- a/Src/Modules/lua-curl/src/Lua-cURL-setopt.c +++ b/Src/Modules/lua-curl/src/Lua-cURL-setopt.c @@ -232,6 +232,10 @@ static struct { {P"prequote", CURLOPT_PREQUOTE, l_easy_setopt_strings}, {P"quote", CURLOPT_QUOTE, l_easy_setopt_strings}, {P"postquote", CURLOPT_POSTQUOTE, l_easy_setopt_strings}, + /* ssh options */ + {P"ssh_auth_types", CURLOPT_SSH_AUTH_TYPES, l_easy_setopt_long}, + {P"ssh_public_keyfile", CURLOPT_SSH_PUBLIC_KEYFILE, l_easy_setopt_string}, + {P"ssh_private_keyfile", CURLOPT_SSH_PRIVATE_KEYFILE, l_easy_setopt_string}, /* ssl options */ {P"sslcert", CURLOPT_SSLCERT, l_easy_setopt_string}, From 41ea911e9beb67b1ca295934f33af02dbe29da19 Mon Sep 17 00:00:00 2001 From: dtiedy Date: Tue, 4 Sep 2012 16:41:51 -0700 Subject: [PATCH 4/4] changed to curl 7.27.0 added CURLDEBUG define to fix debug crash --- Src/Modules/.gitignore | 1 + Src/modules.jambuild/getlibcurl.bat | 10 +- Src/modules.jambuild/lua-curl.jam | 511 +++++++++++++++------------- 3 files changed, 275 insertions(+), 247 deletions(-) diff --git a/Src/Modules/.gitignore b/Src/Modules/.gitignore index 218cf41d5..64e4c4a3c 100644 --- a/Src/Modules/.gitignore +++ b/Src/Modules/.gitignore @@ -1,4 +1,5 @@ /lua-apr/ /lua-curl/src/curl-7.21.6/ +/lua-curl/src/curl-7.27.0/ diff --git a/Src/modules.jambuild/getlibcurl.bat b/Src/modules.jambuild/getlibcurl.bat index 93a356a3e..744f5046d 100644 --- a/Src/modules.jambuild/getlibcurl.bat +++ b/Src/modules.jambuild/getlibcurl.bat @@ -1,8 +1,8 @@ pushd cd ..\Modules\lua-curl\src -if exist curl-7.21.6.zip del curl-7.21.6.zip -if exist curl-7.21.6 rmdir /s /q curl-7.21.6 -wget http://curl.haxx.se/download/curl-7.21.6.zip -unzip curl-7.21.6.zip -del curl-7.21.6.zip +if exist curl-7.27.0.zip del curl-7.27.0.zip +if exist curl-7.27.0 rmdir /s /q curl-7.27.0 +wget http://curl.haxx.se/download/curl-7.27.0.zip +unzip curl-7.27.0.zip +del curl-7.27.0.zip popd diff --git a/Src/modules.jambuild/lua-curl.jam b/Src/modules.jambuild/lua-curl.jam index 0b4702b04..64e52e3ed 100644 --- a/Src/modules.jambuild/lua-curl.jam +++ b/Src/modules.jambuild/lua-curl.jam @@ -1,246 +1,265 @@ { local CURL_LIB_SRCS = - amigaos.c - amigaos.h - arpa_telnet.h - axtls.c - axtls.h - base64.c - CMakeLists.txt - config-amigaos.h - config-dos.h - config-mac.h - config-os400.h - config-riscos.h - config-symbian.h - config-tpf.h - config-vms.h - config-vxworks.h - config-win32.h - config-win32ce.h - connect.c - connect.h - content_encoding.c - content_encoding.h - cookie.c - cookie.h - curlx.h - curl_addrinfo.c - curl_addrinfo.h - curl_base64.h - curl_config.h.cmake - curl_config.h.in - curl_fnmatch.c - curl_fnmatch.h - curl_gethostname.c - curl_gethostname.h - curl_hmac.h - curl_ldap.h - curl_md4.h - curl_md5.h - curl_memory.h - curl_memrchr.c - curl_memrchr.h - curl_rand.c - curl_rand.h - curl_rtmp.c - curl_rtmp.h - curl_sspi.c - curl_sspi.h - curl_threads.c - curl_threads.h - cyassl.c - cyassl.h - dict.c - dict.h - easy.c - easyif.h - escape.c - escape.h - file.c - file.h - fileinfo.c - fileinfo.h - firefox-db2pem.sh - formdata.c - formdata.h - ftp.c - ftp.h - ftplistparser.c - ftplistparser.h - getenv.c - getinfo.c - getinfo.h - gopher.c - gopher.h - gtls.c - gtls.h - hash.c - hash.h - hmac.c - hostares.c - hostasyn.c - hostip.c - hostip.h - hostip4.c - hostip6.c - hostsyn.c - hostthre.c - http.c - http.h - http_chunks.c - http_chunks.h - http_digest.c - http_digest.h - http_negotiate.c - http_negotiate.h - http_negotiate_sspi - http_ntlm.c - http_ntlm.h - http_proxy.c - http_proxy.h - idn_win32.c - if2ip.c - if2ip.h - imap.c - imap.h - inet_ntop.c - inet_ntop.h - inet_pton.c - inet_pton.h - krb4.c - krb4.h - krb5.c - #ldap.c - libcurl.imp - libcurl.plist - libcurl.rc - libcurl.vcproj - llist.c - llist.h - Makefile.am - makefile.amiga - Makefile.b32 - makefile.dj - Makefile.in - Makefile.inc - Makefile.m32 - Makefile.netware - Makefile.vc6 - Makefile.vc8 - Makefile.vc9 - Makefile.vc10 - Makefile.vxworks - Makefile.Watcom - md4.c - md5.c - memdebug.c - memdebug.h - mk-ca-bundle.pl - mk-ca-bundle.vbs - mprintf.c - msvcproj.foot - msvcproj.head - multi.c - multiif.h - netrc.c - netrc.h - non-ascii.c - non-ascii.h - nonblock.c - nonblock.h - nss.c - nssg.h - nwlib.c - nwos.c - openldap.c - parsedate.c - parsedate.h - pingpong.c - pingpong.h - polarssl.c - polarssl.h - pop3.c - pop3.h - progress.c - progress.h - qssl.c - qssl.h - rawstr.c - rawstr.h - README.ares - README.curlx - README.curl_off_t - README.encoding - README.hostip - README.httpauth - README.memoryleak - README.multi_socket - README.pingpong - README.pipelining - rtsp.c - rtsp.h - security.c - select.c - select.h - sendf.c - sendf.h - setup-os400.h - setup.h - setup_once.h - share.c - share.h - slist.c - slist.h - smtp.c - smtp.h - sockaddr.h - socks.c - socks.h - socks_gssapi.c - socks_sspi.c - speedcheck.c - speedcheck.h - splay.c - splay.h - ssh.c - ssh.h - sslgen.c - sslgen.h - ssluse.c - ssluse.h - strdup.c - strdup.h - strequal.c - strequal.h - strerror.c - strerror.h - strtok.c - strtok.h - strtoofft.c - strtoofft.h - telnet.c - telnet.h - tftp.c - tftp.h - timeval.c - timeval.h - transfer.c - transfer.h - url.c - url.h - urldata.h - vc6libcurl.dsp - vc6libcurl.dsw - version.c - warnless.c - warnless.h - wildcard.c - wildcard.h + amigaos.c + amigaos.h + arpa_telnet.h + asyn-ares.c + asyn-thread.c + asyn.h + axtls.c + axtls.h + base64.c + checksrc.pl + CMakeLists.txt + config-amigaos.h + config-dos.h + config-mac.h + config-os400.h + config-riscos.h + config-symbian.h + config-tpf.h + config-vms.h + config-vxworks.h + config-win32.h + config-win32ce.h + connect.c + connect.h + content_encoding.c + content_encoding.h + cookie.c + cookie.h + curlx.h + curl_addrinfo.c + curl_addrinfo.h + curl_base64.h + curl_config.h.cmake + curl_config.h.in + curl_darwinssl.c + curl_darwinssl.h + curl_fnmatch.c + curl_fnmatch.h + curl_gethostname.c + curl_gethostname.h + curl_gssapi.c + curl_gssapi.h + curl_hmac.h + curl_ldap.h + curl_md4.h + curl_md5.h + curl_memory.h + curl_memrchr.c + curl_memrchr.h + curl_multibyte.c + curl_multibyte.h + curl_ntlm.c + curl_ntlm.h + curl_ntlm_core.c + curl_ntlm_core.h + curl_ntlm_msgs.c + curl_ntlm_msgs.h + curl_ntlm_wb.c + curl_ntlm_wb.h + curl_rand.c + curl_rand.h + curl_rtmp.c + curl_rtmp.h + curl_sasl.c + curl_sasl.h + curl_schannel.c + curl_schannel.h + curl_sspi.c + curl_sspi.h + curl_threads.c + curl_threads.h + cyassl.c + cyassl.h + dict.c + dict.h + easy.c + easyif.h + escape.c + escape.h + file.c + file.h + fileinfo.c + fileinfo.h + firefox-db2pem.sh + formdata.c + formdata.h + ftp.c + ftp.h + ftplistparser.c + ftplistparser.h + getenv.c + getinfo.c + getinfo.h + gopher.c + gopher.h + gtls.c + gtls.h + hash.c + hash.h + hmac.c + hostasyn.c + hostip.c + hostip.h + hostip4.c + hostip6.c + hostsyn.c + http.c + http.h + http_chunks.c + http_chunks.h + http_digest.c + http_digest.h + http_negotiate.c + http_negotiate.h + http_negotiate_sspi.c + http_proxy.c + http_proxy.h + idn_win32.c + if2ip.c + if2ip.h + imap.c + imap.h + inet_ntop.c + inet_ntop.h + inet_pton.c + inet_pton.h + krb4.c + krb4.h + krb5.c + ldap.c + libcurl.plist + libcurl.rc + libcurl.vcproj + libcurl.vers.in + llist.c + llist.h + Makefile.am + makefile.amiga + Makefile.b32 + makefile.dj + Makefile.in + Makefile.inc + Makefile.m32 + Makefile.netware + Makefile.vc10 + Makefile.vc6 + Makefile.vc8 + Makefile.vc9 + Makefile.vxworks + Makefile.Watcom + md4.c + md5.c + memdebug.c + memdebug.h + mk-ca-bundle.pl + mk-ca-bundle.vbs + mprintf.c + msvcproj.foot + msvcproj.head + multi.c + multiif.h + mydir.txt + netrc.c + netrc.h + non-ascii.c + non-ascii.h + nonblock.c + nonblock.h + nss.c + nssg.h + nwlib.c + nwos.c + openldap.c + parsedate.c + parsedate.h + pingpong.c + pingpong.h + polarssl.c + polarssl.h + pop3.c + pop3.h + progress.c + progress.h + qssl.c + qssl.h + rawstr.c + rawstr.h + README.ares + README.curlx + README.curl_off_t + README.encoding + README.hostip + README.httpauth + README.memoryleak + README.multi_socket + README.pingpong + README.pipelining + rtsp.c + rtsp.h + security.c + select.c + select.h + sendf.c + sendf.h + setup-os400.h + setup.h + setup_once.h + share.c + share.h + slist.c + slist.h + smtp.c + smtp.h + sockaddr.h + socks.c + socks.h + socks_gssapi.c + socks_sspi.c + speedcheck.c + speedcheck.h + splay.c + splay.h + ssh.c + ssh.h + sslgen.c + sslgen.h + ssluse.c + ssluse.h + strdup.c + strdup.h + strequal.c + strequal.h + strerror.c + strerror.h + strtok.c + strtok.h + strtoofft.c + strtoofft.h + telnet.c + telnet.h + tftp.c + tftp.h + timeval.c + timeval.h + transfer.c + transfer.h + url.c + url.h + urldata.h + vc6libcurl.dsp + vc6libcurl.dsw + version.c + warnless.c + warnless.h + wildcard.c + wildcard.h ; -CURL_LIB_SRCS = src/curl-7.21.6/lib/$(CURL_LIB_SRCS) ; +CURL_LIB_SRCS = src/curl-7.27.0/lib/$(CURL_LIB_SRCS) ; local ZLIB_SRCS = ../zlib/adler32.c @@ -291,9 +310,13 @@ SourceGroup : zlib : $(ZLIB_SRCS) ; C.Defines : HAVE_ZLIB_H HAVE_ZLIB HAVE_LIBZ ; C.Defines : USE_LIBSSH2 HAVE_LIBSSH2 HAVE_LIBSSH2_H LIBSSH2_WIN32 LIBSSH2_LIBRARY ; + if $(CONFIG) = debug { + C.Defines : CURLDEBUG ; + } + C.IncludeDirectories : ../zlib ; C.IncludeDirectories : d:/libssh2/include ; - C.Defines : USE_SSLEAY ; + C.Defines : USE_SSLEAY USE_OPENSSL ; if $(PLATFORM) = win32 { C.IncludeDirectories : c:/OpenSSL-Win32/include c:/OpenSSL-Win32/include/openssl ; @@ -304,10 +327,14 @@ SourceGroup : zlib : $(ZLIB_SRCS) ; } C.LinkDirectories : d:/libssh2/win32/lib ; - #C.LinkPrebuiltLibraries : libeay32 ssleay32 ; - C.LinkPrebuiltLibraries : libeay32MT ssleay32MT libssh2 advapi32 gdi32 user32 ; + C.LinkPrebuiltLibraries : libeay32MT ssleay32MT advapi32 gdi32 user32 ; - C.IncludeDirectories : src/curl-7.21.6/include ; + if $(CONFIG) = debug { + C.LinkPrebuiltLibraries : libssh2d ; + } else { + C.LinkPrebuiltLibraries : libssh2 ; + } + C.IncludeDirectories : src/curl-7.27.0/include ; C.LinkPrebuiltLibraries : ws2_32 ; Lua.CModule : : $(CURL_LIB_SRCS) $(SRCS) ;