This commit is contained in:
parent
a322e66d7c
commit
16a56af88e
88
curl-ftp-httpproxy.patch
Normal file
88
curl-ftp-httpproxy.patch
Normal file
@ -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=<a|i> 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:.*
|
||||||
|
</strip>
|
||||||
|
<protocol>
|
||||||
|
-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:.*
|
||||||
|
</strip>
|
||||||
|
<protocol>
|
||||||
|
-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: */*
|
@ -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
|
Wed Aug 29 12:25:59 CEST 2007 - mmarek@suse.cz
|
||||||
|
|
||||||
|
11
curl.spec
11
curl.spec
@ -13,15 +13,16 @@
|
|||||||
Name: curl
|
Name: curl
|
||||||
BuildRequires: libidn-devel libopenssl-devel zlib-devel
|
BuildRequires: libidn-devel libopenssl-devel zlib-devel
|
||||||
Version: 7.16.4
|
Version: 7.16.4
|
||||||
Release: 9
|
Release: 11
|
||||||
Autoreqprov: on
|
AutoReqProv: on
|
||||||
License: BSD 3-Clause, X11/MIT
|
License: BSD 3-Clause, X11/MIT
|
||||||
Group: Productivity/Networking/Web/Utilities
|
Group: Productivity/Networking/Web/Utilities
|
||||||
Summary: A Tool for Transferring Data from URLs
|
Summary: A Tool for Transferring Data from URLs
|
||||||
URL: http://curl.haxx.se/
|
Url: http://curl.haxx.se/
|
||||||
Source: curl-%{version}.tar.bz2
|
Source: curl-%{version}.tar.bz2
|
||||||
Patch2: curl-ipv6tests.patch
|
Patch2: curl-ipv6tests.patch
|
||||||
Patch3: curl-strict-aliasing.patch
|
Patch3: curl-strict-aliasing.patch
|
||||||
|
Patch4: curl-ftp-httpproxy.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -87,6 +88,7 @@ Authors:
|
|||||||
%setup -q
|
%setup -q
|
||||||
%patch2
|
%patch2
|
||||||
%patch3
|
%patch3
|
||||||
|
%patch4
|
||||||
|
|
||||||
%build
|
%build
|
||||||
autoreconf -fi
|
autoreconf -fi
|
||||||
@ -158,6 +160,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%doc %{_mandir}/man3/*
|
%doc %{_mandir}/man3/*
|
||||||
|
|
||||||
%changelog
|
%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
|
* Wed Aug 29 2007 - mmarek@suse.cz
|
||||||
- s/openssl-devel/libopenssl-devel/ [#305815]
|
- s/openssl-devel/libopenssl-devel/ [#305815]
|
||||||
* Fri Aug 03 2007 - mmarek@suse.cz
|
* Fri Aug 03 2007 - mmarek@suse.cz
|
||||||
|
Loading…
x
Reference in New Issue
Block a user