tizen 2.4 release accepted/tizen_2.4_mobile tizen_2.4 accepted/tizen/2.4/mobile/20151029.040517 submit/tizen_2.4/20151028.062926 tizen_2.4_mobile_release
authorjk7744.park <jk7744.park@samsung.com>
Sat, 24 Oct 2015 06:56:24 +0000 (15:56 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Sat, 24 Oct 2015 06:56:24 +0000 (15:56 +0900)
docs/libcurl/opts/CURLOPT_HEADEROPT.3
lib/http.c
lib/http_proxy.c
lib/smb.c
lib/url.c
packaging/curl.spec
tests/data/test1527
tests/data/test287
tests/libtest/lib1527.c

index be96d7d..7776b92 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -31,10 +31,10 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HEADEROPT, long bitmask);
 Pass a long that is a bitmask of options of how to deal with headers. The two
 mutually exclusive options are:
 
-\fBCURLHEADER_UNIFIED\fP - keep working as before. This means
-\fICURLOPT_HTTPHEADER(3)\fP headers will be used in requests both to servers
-and proxies. With this option enabled, \fICURLOPT_PROXYHEADER(3)\fP will not
-have any effect.
+\fBCURLHEADER_UNIFIED\fP - the headers specified in
+\fICURLOPT_HTTPHEADER(3)\fP will be used in requests both to servers and
+proxies. With this option enabled, \fICURLOPT_PROXYHEADER(3)\fP will not have
+any effect.
 
 \fBCURLHEADER_SEPARATE\fP - makes \fICURLOPT_HTTPHEADER(3)\fP headers only get
 sent to a server and not to a proxy. Proxy headers must be set with
@@ -44,7 +44,7 @@ headers. When doing CONNECT, libcurl will send \fICURLOPT_PROXYHEADER(3)\fP
 headers only to the proxy and then \fICURLOPT_HTTPHEADER(3)\fP headers only to
 the server.
 .SH DEFAULT
-CURLHEADER_UNIFIED
+CURLHEADER_SEPARATE (changed in 7.42.1, ased CURLHEADER_UNIFIED before then)
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
index c74746c..c34b46d 100644 (file)
@@ -2333,20 +2333,12 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
                      te
       );
 
-  /*
-   * Free userpwd for Negotiate/NTLM. Cannot reuse as it is associated with
-   * the connection and shouldn't be repeated over it either.
-   */
-  switch (data->state.authhost.picked) {
-  case CURLAUTH_NEGOTIATE:
-  case CURLAUTH_NTLM:
-  case CURLAUTH_NTLM_WB:
-    Curl_safefree(conn->allocptr.userpwd);
-    break;
-  }
+  /* clear userpwd to avoid re-using credentials from re-used connections */
+  Curl_safefree(conn->allocptr.userpwd);
 
   /*
-   * Same for proxyuserpwd
+   * Free proxyuserpwd for Negotiate/NTLM. Cannot reuse as it is associated
+   * with the connection and shouldn't be repeated over it either.
    */
   switch (data->state.authproxy.picked) {
   case CURLAUTH_NEGOTIATE:
index 72123ed..1828f4c 100644 (file)
@@ -193,7 +193,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
                            useragent,
                            proxyconn);
 
-        if(host && *host)
+        if(host)
           free(host);
         free(hostheader);
 
index e66427b..3fadecd 100644 (file)
--- a/lib/smb.c
+++ b/lib/smb.c
@@ -783,9 +783,15 @@ static CURLcode smb_request_state(struct connectdata *conn, bool *done)
     off = Curl_read16_le(((unsigned char *) msg) +
                          sizeof(struct smb_header) + 13);
     if(len > 0) {
-      result = Curl_client_write(conn, CLIENTWRITE_BODY,
-                                 (char *)msg + off + sizeof(unsigned int),
-                                 len);
+      struct smb_conn *smbc = &conn->proto.smbc;
+      if(off + sizeof(unsigned int) + len > smbc->got) {
+        failf(conn->data, "Invalid input packet");
+        result = CURLE_RECV_ERROR;
+      }
+      else
+        result = Curl_client_write(conn, CLIENTWRITE_BODY,
+                                   (char *)msg + off + sizeof(unsigned int),
+                                   len);
       if(result) {
         req->result = result;
         next_state = SMB_CLOSE;
index ac95567..6245d82 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -605,6 +605,7 @@ CURLcode Curl_init_userdefined(struct UserDefined *set)
   set->ssl_enable_alpn = TRUE;
 
   set->expect_100_timeout = 1000L; /* Wait for a second by default. */
+  set->sep_headers = TRUE; /* separated header lists by default */
   return result;
 }
 
index 352f6a7..3b37b6e 100644 (file)
@@ -1,6 +1,6 @@
 Name:       curl
 Summary:    A utility for getting files from remote servers (FTP, HTTP, and others)
-Version:    7.40.1_2
+Version:    7.40.1_6
 Release:    1
 Group:      Applications/Internet
 License:    MIT
@@ -12,6 +12,7 @@ BuildRequires:  pkgconfig(openssl)
 BuildRequires:  pkgconfig(libidn)
 BuildRequires:  pkgconfig(zlib)
 BuildRequires:  pkgconfig(libcares)
+BuildRequires: pkgconfig(libnghttp2)
 Provides:   webclient
 
 
@@ -27,6 +28,7 @@ user authentication, FTP upload, HTTP post, and file transfer resume.
 %package -n libcurl
 Summary:    A library for getting files from web servers
 Group:      System/Libraries
+License:    MIT
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
@@ -38,6 +40,7 @@ other servers for getting files.
 %package -n libcurl-devel
 Summary:    Files needed for building applications with libcurl
 Group:      Development/Libraries
+License:    MIT
 Requires:   libcurl = %{version}-%{release}
 Requires:   libidn-devel
 Provides:   curl-devel = %{version}-%{release}
@@ -67,6 +70,7 @@ export CPPFLAGS="-DHAVE_PK11_CREATEGENERICOBJECT"
 --with-lber-lib=lber \
 --enable-manual --enable-versioned-symbols --enable-ares --enable-debug --enable-curldebug \
 --disable-static \
+--with-nghttp2=/usr/lib/pkgconfig \
 
 #--with-ca-bundle=%{_sysconfdir}/pki/tls/certs/ca-bundle.crt 
 
index ee4887a..751133e 100644 (file)
@@ -12,26 +12,26 @@ proxytunnel
 # Server-side
 <reply>
 <connect>
-HTTP/1.1 200 OK\r
-We-are: good\r
-\r
+HTTP/1.1 200 OK
+We-are: good
+
 </connect>
 <data>
-HTTP/1.1 200 OK swsclose\r
-Date: Thu, 09 Nov 2010 14:49:00 GMT\r
-Server: test-server/fake\r
-Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT\r
-ETag: "21025-dc7-39462498"\r
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
 </data>
 <datacheck>
-HTTP/1.1 200 OK\r
-We-are: good\r
-\r
-HTTP/1.1 200 OK swsclose\r
-Date: Thu, 09 Nov 2010 14:49:00 GMT\r
-Server: test-server/fake\r
-Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT\r
-ETag: "21025-dc7-39462498"\r
+HTTP/1.1 200 OK
+We-are: good
+
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
 </datacheck>
 
 </reply>
@@ -45,7 +45,7 @@ http-proxy
 lib1527
 </tool>
  <name>
-Check same headers are generated without CURLOPT_PROXYHEADER
+Check same headers are generated with CURLOPT_HEADEROPT == CURLHEADER_UNIFIED
  </name>
  <command>
  http://the.old.moo.1527:%HTTPPORT/1527 %HOSTIP:%PROXYPORT
@@ -55,21 +55,21 @@ Check same headers are generated without CURLOPT_PROXYHEADER
 # Verify data after the test has been "shot"
 <verify>
 <proxy>
-CONNECT the.old.moo.1527:%HTTPPORT HTTP/1.1\r
-Host: the.old.moo.1527:%HTTPPORT\r
-Proxy-Connection: Keep-Alive\r
-User-Agent: Http Agent\r
-Expect: 100-continue\r
-\r
+CONNECT the.old.moo.1527:%HTTPPORT HTTP/1.1
+Host: the.old.moo.1527:%HTTPPORT
+Proxy-Connection: Keep-Alive
+User-Agent: Http Agent
+Expect: 100-continue
+
 </proxy>
 <protocol>
-PUT /1527 HTTP/1.1\r
-Host: the.old.moo.1527:%HTTPPORT\r
-Accept: */*\r
-User-Agent: Http Agent\r
-Expect: 100-continue\r
-Content-Length: 13\r
-\r
+PUT /1527 HTTP/1.1
+Host: the.old.moo.1527:%HTTPPORT
+Accept: */*
+User-Agent: Http Agent
+Expect: 100-continue
+Content-Length: 13
+
 Hello Cloud!
 </protocol>
 </verify>
index ec4dfeb..6b0bf6e 100644 (file)
@@ -12,8 +12,8 @@ proxytunnel
 <reply>
 
 <connect nocheck="yes">
-HTTP/1.1 405 Method Not Allowed swsclose\r
-\r
+HTTP/1.1 405 Method Not Allowed swsclose
+
 And you should ignore this data.
 </connect>
 
@@ -28,26 +28,26 @@ http
 HTTP proxy CONNECT with custom User-Agent header
  </name>
  <command>
-http://test.remote.example.com.287:%HTTPPORT/path/287 -H "User-Agent: looser/2007" --proxy http://%HOSTIP:%HTTPPORT --proxytunnel
+http://test.remote.example.com.287:%HTTPPORT/path/287 -H "User-Agent: looser/2015" --proxy http://%HOSTIP:%HTTPPORT --proxytunnel --proxy-header "User-Agent: looser/2007"
 </command>
 </client>
 
 # Verify data after the test has been "shot"
 <verify>
 <protocol>
-CONNECT test.remote.example.com.287:%HTTPPORT HTTP/1.1\r
-Host: test.remote.example.com.287:%HTTPPORT\r
-Proxy-Connection: Keep-Alive\r
-User-Agent: looser/2007\r
-\r
+CONNECT test.remote.example.com.287:%HTTPPORT HTTP/1.1
+Host: test.remote.example.com.287:%HTTPPORT
+Proxy-Connection: Keep-Alive
+User-Agent: looser/2007
+
 </protocol>
 # CURLE_RECV_ERROR
 <errorcode>
 56
 </errorcode>
 <stdout>
-HTTP/1.1 405 Method Not Allowed swsclose\r
-\r
+HTTP/1.1 405 Method Not Allowed swsclose
+
 </stdout>
 </verify>
 </testcase>
index 280c947..1122d8e 100644 (file)
@@ -83,6 +83,7 @@ int test(char *URL)
   test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
   test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
   test_setopt(curl, CURLOPT_INFILESIZE, strlen(data));
+  test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
 
   res = curl_easy_perform(curl);