summaryrefslogtreecommitdiff
path: root/extra/gimp-devel/uri-backend-libcurl.patch
blob: d3217a292df1be67be0de03993ee96e01f99e357 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
diff -aur gimp-2.6.11/plug-ins/file-uri/uri-backend-libcurl.c gimp-2.6.11.patched/plug-ins/file-uri/uri-backend-libcurl.c
--- gimp-2.6.11/plug-ins/file-uri/uri-backend-libcurl.c	2010-07-03 00:51:59.000000000 +0200
+++ gimp-2.6.11.patched/plug-ins/file-uri/uri-backend-libcurl.c	2011-06-23 19:15:30.000000000 +0200
@@ -24,7 +23,6 @@
 #include <errno.h>
 
 #include <curl/curl.h>
-#include <curl/types.h>
 #include <curl/easy.h>
 
 #include <glib/gstdio.h>
@@ -63,7 +61,7 @@
 
   vinfo = curl_version_info (CURLVERSION_NOW);
 
-  protocols = g_string_new ("http:,ftp:");
+  protocols = g_string_new ("http:,ftp:,gopher:");
 
   if (vinfo->features & CURL_VERSION_SSL)
     {
@@ -153,7 +151,7 @@
   FILE      *out_file;
   CURL      *curl_handle;
   CURLcode   result;
-  gint       response_code;
+  glong      response_code;
 
   gimp_progress_init (_("Connecting to server"));
 
@@ -195,12 +193,12 @@
 
   curl_easy_getinfo (curl_handle, CURLINFO_RESPONSE_CODE, &response_code);
 
-  if (response_code != 200)
+  if (response_code != 200 && response_code != 226 && response_code != 0)
     {
       fclose (out_file);
       g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                    _("Opening '%s' for reading resulted in HTTP "
-                     "response code: %d"),
+                     "response code: %ld"),
                    uri, response_code);
       curl_easy_cleanup (curl_handle);
       return FALSE;