gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r10422: Strip Expect header also whe


From: Sandro Santilli
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10422: Strip Expect header also when sending custom headers
Date: Sun, 14 Dec 2008 13:44:29 +0100
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10422
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Sun 2008-12-14 13:44:29 +0100
message:
  Strip Expect header also when sending custom headers
modified:
  libbase/curl_adapter.cpp
=== modified file 'libbase/curl_adapter.cpp'
--- a/libbase/curl_adapter.cpp  2008-12-12 23:29:08 +0000
+++ b/libbase/curl_adapter.cpp  2008-12-14 12:44:29 +0000
@@ -920,8 +920,6 @@
         }
     }
 
-
-
        CURLMcode mcode = curl_multi_add_handle(_mhandle, _handle);
        if ( mcode != CURLM_OK ) {
                throw gnash::GnashException(curl_multi_strerror(mcode));
@@ -978,6 +976,21 @@
                throw gnash::GnashException(curl_easy_strerror(ccode));
        }
 
+    // Disable sending an Expect: header, as some older HTTP/1.1
+    // don't implement them, and some (namely lighttpd/1.4.19,
+    // running on openstreetmap.org at time of writing) return
+    // a '417 Expectance Failure' response on getting that.
+    {
+        if ( ! _customHeaders ) {
+            // Initialize only once
+            _customHeaders = curl_slist_append(_customHeaders, "Expect:");
+        }
+        ccode = curl_easy_setopt(_handle, CURLOPT_HTTPHEADER, _customHeaders);
+        if ( ccode != CURLE_OK ) {
+            throw gnash::GnashException(curl_easy_strerror(ccode));
+        }
+    }
+
        CURLMcode mcode = curl_multi_add_handle(_mhandle, _handle);
        if ( mcode != CURLM_OK ) {
                throw gnash::GnashException(curl_multi_strerror(mcode));


reply via email to

[Prev in Thread] Current Thread [Next in Thread]