From 16a56af88e223db9a2f552c1afc19a9b52565d2fa82971199b53aaef2e939964 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 14 Sep 2007 14:04:31 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/curl?expand=0&rev=14 --- curl-ftp-httpproxy.patch | 88 ++++++++++++++++++++++++++++++++++++++++ curl.changes | 6 +++ curl.spec | 11 +++-- 3 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 curl-ftp-httpproxy.patch diff --git a/curl-ftp-httpproxy.patch b/curl-ftp-httpproxy.patch new file mode 100644 index 0000000..359d937 --- /dev/null +++ b/curl-ftp-httpproxy.patch @@ -0,0 +1,88 @@ +Index: lib/http.c +=================================================================== +RCS file: /cvsroot/curl/curl/lib/http.c,v +retrieving revision 1.334 +diff -u -p -r1.334 http.c +--- lib/http.c 27 Aug 2007 06:31:28 -0000 1.334 ++++ lib/http.c 14 Sep 2007 08:22:31 -0000 +@@ -1740,6 +1740,7 @@ CURLcode Curl_http(struct connectdata *c + CURLcode result=CURLE_OK; + struct HTTP *http; + char *ppath = data->reqdata.path; ++ char ftp_typecode[sizeof(";type=?")] = ""; + char *host = conn->host.name; + const char *te = ""; /* transfer-encoding */ + char *ptr; +@@ -1950,6 +1951,23 @@ CURLcode Curl_http(struct connectdata *c + } + } + ppath = data->change.url; ++ /* when doing ftp, append ;type= if not present */ ++ if (checkprefix("ftp://", ppath) || checkprefix("ftps://", ppath)) { ++ char *p = strstr(ppath, ";type="); ++ if (p && p[6] && p[7] == 0) { ++ switch (toupper(p[6])) { ++ case 'A': ++ case 'D': ++ case 'I': ++ break; ++ default: ++ p = NULL; ++ } ++ } ++ if (!p) { ++ sprintf(ftp_typecode, ";type=%c", data->set.prefer_ascii ? 'a' : 'i'); ++ } ++ } + } + if(HTTPREQ_POST_FORM == httpreq) { + /* we must build the whole darned post sequence first, so that we have +@@ -2093,7 +2111,7 @@ CURLcode Curl_http(struct connectdata *c + result = + add_bufferf(req_buffer, + "%s " /* GET/HEAD/POST/PUT */ +- "%s HTTP/%s\r\n" /* path + HTTP version */ ++ "%s%s HTTP/%s\r\n" /* path + HTTP version */ + "%s" /* proxyuserpwd */ + "%s" /* userpwd */ + "%s" /* range */ +@@ -2108,6 +2126,7 @@ CURLcode Curl_http(struct connectdata *c + + request, + ppath, ++ ftp_typecode, + httpstring, + conn->allocptr.proxyuserpwd? + conn->allocptr.proxyuserpwd:"", +Index: tests/data/test208 +=================================================================== +RCS file: /cvsroot/curl/curl/tests/data/test208,v +retrieving revision 1.5 +diff -u -p -r1.5 test208 +--- tests/data/test208 9 Mar 2007 21:01:40 -0000 1.5 ++++ tests/data/test208 14 Sep 2007 08:22:31 -0000 +@@ -44,7 +44,7 @@ the + ^User-Agent:.* + + +-PUT ftp://daniel:mysecret@host.com/we/want/208 HTTP/1.1 ++PUT ftp://daniel:mysecret@host.com/we/want/208;type=i HTTP/1.1 + Authorization: Basic ZGFuaWVsOm15c2VjcmV0 + Host: host.com:21 + Pragma: no-cache +Index: tests/data/test79 +=================================================================== +RCS file: /cvsroot/curl/curl/tests/data/test79,v +retrieving revision 1.9 +diff -u -p -r1.9 test79 +--- tests/data/test79 9 Mar 2007 21:01:40 -0000 1.9 ++++ tests/data/test79 14 Sep 2007 08:22:31 -0000 +@@ -45,7 +45,7 @@ ftp://%HOSTIP:%HTTPPORT/we/want/that/pag + ^User-Agent:.* + + +-GET ftp://127.0.0.1:%HTTPPORT/we/want/that/page/79 HTTP/1.1 ++GET ftp://127.0.0.1:%HTTPPORT/we/want/that/page/79;type=i HTTP/1.1 + Host: 127.0.0.1:%HTTPPORT + Pragma: no-cache + Accept: */* diff --git a/curl.changes b/curl.changes index 18c316f..1394319 100644 --- a/curl.changes +++ b/curl.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Sep 14 09:20:35 CEST 2007 - mmarek@suse.cz + +- set transfer mode (binary/ascii) when retrieving ftp:// urls via + an http proxy (curl-ftp-httpproxy.patch) [#306272] + ------------------------------------------------------------------- Wed Aug 29 12:25:59 CEST 2007 - mmarek@suse.cz diff --git a/curl.spec b/curl.spec index e1c4650..eba4a5e 100644 --- a/curl.spec +++ b/curl.spec @@ -13,15 +13,16 @@ Name: curl BuildRequires: libidn-devel libopenssl-devel zlib-devel Version: 7.16.4 -Release: 9 -Autoreqprov: on +Release: 11 +AutoReqProv: on License: BSD 3-Clause, X11/MIT Group: Productivity/Networking/Web/Utilities Summary: A Tool for Transferring Data from URLs -URL: http://curl.haxx.se/ +Url: http://curl.haxx.se/ Source: curl-%{version}.tar.bz2 Patch2: curl-ipv6tests.patch Patch3: curl-strict-aliasing.patch +Patch4: curl-ftp-httpproxy.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -87,6 +88,7 @@ Authors: %setup -q %patch2 %patch3 +%patch4 %build autoreconf -fi @@ -158,6 +160,9 @@ rm -rf $RPM_BUILD_ROOT %doc %{_mandir}/man3/* %changelog +* Fri Sep 14 2007 - mmarek@suse.cz +- set transfer mode (binary/ascii) when retrieving ftp:// urls via + an http proxy (curl-ftp-httpproxy.patch) [#306272] * Wed Aug 29 2007 - mmarek@suse.cz - s/openssl-devel/libopenssl-devel/ [#305815] * Fri Aug 03 2007 - mmarek@suse.cz