Lines 4-12
Link Here
|
4 |
* libcurl backend for the URI plug-in |
4 |
* libcurl backend for the URI plug-in |
5 |
* Copyright (C) 2006 Mukund Sivaraman <muks@mukund.org> |
5 |
* Copyright (C) 2006 Mukund Sivaraman <muks@mukund.org> |
6 |
* |
6 |
* |
7 |
* This program is free software; you can redistribute it and/or modify |
7 |
* This program is free software: you can redistribute it and/or modify |
8 |
* it under the terms of the GNU General Public License as published by |
8 |
* it under the terms of the GNU General Public License as published by |
9 |
* the Free Software Foundation; either version 2 of the License, or |
9 |
* the Free Software Foundation; either version 3 of the License, or |
10 |
* (at your option) any later version. |
10 |
* (at your option) any later version. |
11 |
* |
11 |
* |
12 |
* This program is distributed in the hope that it will be useful, |
12 |
* This program is distributed in the hope that it will be useful, |
Lines 15-22
Link Here
|
15 |
* GNU General Public License for more details. |
15 |
* GNU General Public License for more details. |
16 |
* |
16 |
* |
17 |
* You should have received a copy of the GNU General Public License |
17 |
* You should have received a copy of the GNU General Public License |
18 |
* along with this program; if not, write to the Free Software |
18 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
|
20 |
*/ |
19 |
*/ |
21 |
|
20 |
|
22 |
#include "config.h" |
21 |
#include "config.h" |
Lines 24-30
Link Here
|
24 |
#include <errno.h> |
23 |
#include <errno.h> |
25 |
|
24 |
|
26 |
#include <curl/curl.h> |
25 |
#include <curl/curl.h> |
27 |
#include <curl/types.h> |
|
|
28 |
#include <curl/easy.h> |
26 |
#include <curl/easy.h> |
29 |
|
27 |
|
30 |
#include <glib/gstdio.h> |
28 |
#include <glib/gstdio.h> |
Lines 63-69
Link Here
|
63 |
|
61 |
|
64 |
vinfo = curl_version_info (CURLVERSION_NOW); |
62 |
vinfo = curl_version_info (CURLVERSION_NOW); |
65 |
|
63 |
|
66 |
protocols = g_string_new ("http:,ftp:"); |
64 |
protocols = g_string_new ("http:,ftp:,gopher:"); |
67 |
|
65 |
|
68 |
if (vinfo->features & CURL_VERSION_SSL) |
66 |
if (vinfo->features & CURL_VERSION_SSL) |
69 |
{ |
67 |
{ |
Lines 153-159
Link Here
|
153 |
FILE *out_file; |
151 |
FILE *out_file; |
154 |
CURL *curl_handle; |
152 |
CURL *curl_handle; |
155 |
CURLcode result; |
153 |
CURLcode result; |
156 |
gint response_code; |
154 |
glong response_code; |
157 |
|
155 |
|
158 |
gimp_progress_init (_("Connecting to server")); |
156 |
gimp_progress_init (_("Connecting to server")); |
159 |
|
157 |
|
Lines 195-206
Link Here
|
195 |
|
193 |
|
196 |
curl_easy_getinfo (curl_handle, CURLINFO_RESPONSE_CODE, &response_code); |
194 |
curl_easy_getinfo (curl_handle, CURLINFO_RESPONSE_CODE, &response_code); |
197 |
|
195 |
|
198 |
if (response_code != 200) |
196 |
if (response_code != 200 && response_code != 226 && response_code != 0) |
199 |
{ |
197 |
{ |
200 |
fclose (out_file); |
198 |
fclose (out_file); |
201 |
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, |
199 |
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, |
202 |
_("Opening '%s' for reading resulted in HTTP " |
200 |
_("Opening '%s' for reading resulted in HTTP " |
203 |
"response code: %d"), |
201 |
"response code: %ld"), |
204 |
uri, response_code); |
202 |
uri, response_code); |
205 |
curl_easy_cleanup (curl_handle); |
203 |
curl_easy_cleanup (curl_handle); |
206 |
return FALSE; |
204 |
return FALSE; |
Lines 224-226
Link Here
|
224 |
|
222 |
|
225 |
return FALSE; |
223 |
return FALSE; |
226 |
} |
224 |
} |
|
|
225 |
|
226 |
gchar * |
227 |
uri_backend_map_image (const gchar *uri, |
228 |
GimpRunMode run_mode) |
229 |
{ |
230 |
return NULL; |
231 |
} |