Mercurial > audlegacy-plugins
annotate src/curl/curl.c @ 428:37b3f45b3a68 trunk
[svn] Add code for a plugin to use CURL for http. Needs some build-system
stuff before it will actually get built and installed.
author | iabervon |
---|---|
date | Sun, 14 Jan 2007 22:34:57 -0800 |
parents | |
children | ed94145472df |
rev | line source |
---|---|
428
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
1 /* Audacious |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
2 * Copyright (c) 2007 Daniel Barkalow |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
3 * |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
4 * This program is free software; you can redistribute it and/or modify |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
7 * (at your option) any later version. |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
8 * |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
9 * This program is distributed in the hope that it will be useful, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
12 * GNU General Public License for more details. |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
13 * |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
14 * You should have received a copy of the GNU General Public License |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
15 * along with this program; if not, write to the Free Software |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
17 */ |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
18 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
19 #include <audacious/vfs.h> |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
20 #include <audacious/plugin.h> |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
21 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
22 #include <curl/curl.h> |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
23 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
24 #include <string.h> |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
25 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
26 #define BUFFER_SIZE 256 * 1024 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
27 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
28 typedef struct _CurlHandle CurlHandle; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
29 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
30 struct _CurlHandle { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
31 CURL *curl; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
32 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
33 gsize length; // the length of the file |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
34 gsize rd_abs; // the absolute position for reading from the stream |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
35 gsize wr_abs; // the absolute position where the input connection is |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
36 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
37 gsize buffer_length; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
38 gchar *buffer; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
39 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
40 gsize rd_index; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
41 gsize wr_index; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
42 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
43 gboolean no_data; // true if we're only looking for length currently |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
44 gboolean cancel; // true if the thread should be cancelled |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
45 GThread *thread; // the thread that's reading from the connection |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
46 }; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
47 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
48 /* TODO: |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
49 * - Icecast |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
50 * - Clever buffer stuff when you read a bit of the beginning and a bit of the |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
51 * end of a file |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
52 */ |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
53 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
54 /* The goal here is to have a buffering system which handles the following: |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
55 * 1) open, seek, read (without fetching the beginning of the file) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
56 * 2) open, seek END, tell (using HEAD only) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
57 * 3) open, read, seek 0, read (without restarting fetch) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
58 */ |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
59 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
60 static size_t buf_space(CurlHandle *handle) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
61 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
62 size_t rd_edge = handle->rd_abs - 2048; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
63 if (rd_edge < 0) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
64 rd_edge = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
65 size_t buffer_limit = handle->buffer_length - |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
66 (handle->wr_abs - rd_edge); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
67 size_t cont_limit = handle->buffer_length - handle->wr_index; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
68 return buffer_limit < cont_limit ? buffer_limit : cont_limit; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
69 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
70 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
71 static size_t buf_available(CurlHandle *handle) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
72 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
73 size_t buffer_limit = handle->wr_abs - handle->rd_abs; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
74 size_t cont_limit = handle->buffer_length - handle->rd_index; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
75 if (buffer_limit <= 0) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
76 return 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
77 return buffer_limit < cont_limit ? buffer_limit : cont_limit; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
78 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
79 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
80 static void check(CurlHandle *handle) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
81 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
82 if (!((handle->wr_abs - handle->wr_index) % handle->buffer_length == |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
83 (handle->rd_abs - handle->rd_index) % handle->buffer_length)) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
84 printf("%p Not aligned! wr %d rd %d\n", handle, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
85 (handle->wr_abs - handle->wr_index) % handle->buffer_length, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
86 (handle->rd_abs - handle->rd_index) % handle->buffer_length); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
87 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
88 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
89 static void update_length(CurlHandle *handle) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
90 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
91 if (handle->length == -1) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
92 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
93 double value; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
94 int retcode = |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
95 curl_easy_getinfo(handle->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
96 &value); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
97 if (retcode == CURLE_OK) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
98 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
99 handle->length = value; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
100 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
101 else |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
102 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
103 g_print("getinfo gave error\n"); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
104 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
105 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
106 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
107 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
108 #define PROBE 262140 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
109 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
110 static size_t curl_writecb(void *ptr, size_t size, size_t nmemb, void *stream) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
111 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
112 CurlHandle *handle = stream; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
113 gint sz = size * nmemb; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
114 gint ret = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
115 gint trans; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
116 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
117 update_length(handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
118 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
119 while (ret < sz) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
120 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
121 while (!(trans = buf_space(handle)) && !handle->cancel) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
122 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
123 g_usleep(10000); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
124 //g_print("Wait for free space\n"); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
125 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
126 if (handle->cancel) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
127 break; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
128 if (trans > sz - ret) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
129 trans = sz - ret; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
130 memcpy(handle->buffer + handle->wr_index, ptr + ret, trans); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
131 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
132 handle->wr_abs += trans; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
133 handle->wr_index = (handle->wr_index + trans) % handle->buffer_length; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
134 ret += trans; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
135 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
136 return ret; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
137 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
138 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
139 static gpointer |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
140 curl_manage_request(gpointer arg) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
141 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
142 CurlHandle *handle = arg; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
143 //g_print("Connect %p\n", handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
144 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
145 if (handle->no_data) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
146 curl_easy_setopt(handle->curl, CURLOPT_NOBODY, 1); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
147 else |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
148 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
149 //g_print("Start from %d\n", handle->wr_abs); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
150 curl_easy_setopt(handle->curl, CURLOPT_RESUME_FROM, handle->wr_abs); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
151 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
152 curl_easy_setopt(handle->curl, CURLOPT_NOBODY, 0); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
153 curl_easy_setopt(handle->curl, CURLOPT_HTTPGET, 1); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
154 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
155 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
156 curl_easy_perform(handle->curl); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
157 update_length(handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
158 //g_print("Done %p%s", handle, handle->cancel ? " (aborted)\n" : "\n"); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
159 handle->cancel = 1; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
160 return NULL; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
161 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
162 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
163 static void curl_req_xfer(CurlHandle *handle) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
164 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
165 if (!handle->thread) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
166 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
167 handle->cancel = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
168 handle->wr_index = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
169 handle->rd_index = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
170 handle->wr_abs = handle->rd_abs; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
171 //g_print("Starting connection %p at %d\n", handle, handle->wr_abs); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
172 handle->thread = g_thread_create(curl_manage_request, handle, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
173 TRUE, NULL); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
174 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
175 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
176 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
177 static void curl_req_sync_xfer(CurlHandle *handle, size_t old_rd_abs) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
178 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
179 handle->rd_index = (handle->rd_index + handle->rd_abs - old_rd_abs + |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
180 handle->buffer_length) % handle->buffer_length; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
181 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
182 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
183 static void curl_req_no_xfer(CurlHandle *handle) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
184 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
185 if (handle->thread) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
186 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
187 handle->cancel = 1; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
188 g_thread_join(handle->thread); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
189 handle->thread = NULL; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
190 handle->cancel = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
191 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
192 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
193 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
194 VFSFile * |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
195 curl_vfs_fopen_impl(const gchar * path, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
196 const gchar * mode) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
197 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
198 gchar *url = g_malloc(strlen(path) + strlen("http://") + 1); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
199 CurlHandle *handle; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
200 VFSFile *file; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
201 if (!path || !mode) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
202 return NULL; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
203 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
204 sprintf(url, "http://%s", path); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
205 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
206 file = g_new(VFSFile, 1); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
207 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
208 handle = g_new(CurlHandle, 1); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
209 handle->curl = curl_easy_init(); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
210 handle->rd_index = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
211 handle->wr_index = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
212 handle->rd_abs = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
213 handle->wr_abs = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
214 handle->buffer_length = BUFFER_SIZE; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
215 handle->buffer = g_malloc(handle->buffer_length); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
216 handle->thread = NULL; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
217 handle->length = -1; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
218 handle->cancel = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
219 handle->no_data = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
220 curl_easy_setopt(handle->curl, CURLOPT_URL, url); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
221 curl_easy_setopt(handle->curl, CURLOPT_WRITEFUNCTION, curl_writecb); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
222 curl_easy_setopt(handle->curl, CURLOPT_WRITEDATA, handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
223 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
224 file->handle = handle; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
225 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
226 //g_print("Open %s with curl => %p\n", url, handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
227 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
228 return file; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
229 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
230 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
231 gint |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
232 curl_vfs_fclose_impl(VFSFile * file) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
233 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
234 gint ret = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
235 if (file == NULL) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
236 return -1; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
237 //g_print("Close %p\n", file->handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
238 if (file->handle) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
239 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
240 CurlHandle *handle = file->handle; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
241 //g_print("Cancel transfer\n"); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
242 curl_req_no_xfer(handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
243 //g_print("Okay\n"); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
244 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
245 g_free(handle->buffer); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
246 curl_easy_cleanup(handle->curl); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
247 g_free(handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
248 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
249 return ret; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
250 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
251 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
252 size_t |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
253 curl_vfs_fread_impl(gpointer ptr, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
254 size_t size, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
255 size_t nmemb, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
256 VFSFile * file) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
257 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
258 CurlHandle *handle = file->handle; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
259 ssize_t sz = size * nmemb; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
260 size_t ret = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
261 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
262 if (sz < 0) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
263 return 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
264 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
265 //g_print("Reading %d*%d=%d from %p\n", size, nmemb, sz, handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
266 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
267 curl_req_xfer(handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
268 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
269 check(handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
270 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
271 while (ret < sz) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
272 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
273 size_t available; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
274 while (!(available = buf_available(handle)) && |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
275 (handle->length == -1 || handle->rd_abs < handle->length) && |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
276 !handle->cancel) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
277 g_usleep(10000); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
278 if (available > sz - ret) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
279 available = sz - ret; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
280 memcpy(ptr + ret, handle->buffer + handle->rd_index, available); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
281 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
282 handle->rd_index = |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
283 (handle->rd_index + available) % handle->buffer_length; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
284 handle->rd_abs += available; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
285 ret += available; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
286 if (!available) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
287 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
288 //g_print("EOF reading from %p\n", handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
289 break; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
290 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
291 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
292 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
293 //g_print("Read %d from %p\n", ret, handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
294 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
295 return ret; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
296 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
297 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
298 size_t |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
299 curl_vfs_fwrite_impl(gconstpointer ptr, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
300 size_t size, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
301 size_t nmemb, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
302 VFSFile * file) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
303 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
304 return 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
305 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
306 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
307 gint |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
308 curl_vfs_getc_impl(VFSFile *stream) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
309 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
310 gchar c; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
311 if (curl_vfs_fread_impl(&c, 1, 1, stream) != 1) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
312 return -1; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
313 return c; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
314 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
315 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
316 gint |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
317 curl_vfs_ungetc_impl(gint c, VFSFile *stream) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
318 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
319 g_print("Tried ungetc\n"); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
320 return -1; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
321 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
322 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
323 gint |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
324 curl_vfs_fseek_impl(VFSFile * file, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
325 glong offset, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
326 gint whence) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
327 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
328 size_t posn; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
329 CurlHandle *handle = file->handle; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
330 //g_print("Seek %p to %d %d\n", handle, offset, whence); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
331 if (whence == SEEK_END && handle->length == -1) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
332 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
333 if (!handle->thread) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
334 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
335 // We need a HEAD to find out the length |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
336 handle->no_data = 1; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
337 //g_print("Request for head info\n"); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
338 curl_manage_request(handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
339 //g_print("Completed\n"); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
340 handle->no_data = 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
341 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
342 else |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
343 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
344 // Wait a bit? |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
345 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
346 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
347 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
348 if (whence == SEEK_END && handle->length == -1) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
349 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
350 //g_print("Tried to seek to the end of a file with unknown length\n"); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
351 // don't know how long it is... |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
352 return -1; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
353 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
354 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
355 posn = handle->rd_abs; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
356 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
357 if (whence == SEEK_SET) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
358 handle->rd_abs = offset; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
359 else if (whence == SEEK_END) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
360 handle->rd_abs = handle->length + offset; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
361 else |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
362 handle->rd_abs = handle->rd_abs + offset; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
363 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
364 // XXXX |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
365 // There's a race here between finding available space and |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
366 // allocating it and the check below. |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
367 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
368 if (handle->thread) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
369 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
370 if (handle->rd_abs + handle->buffer_length < handle->wr_abs || |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
371 handle->rd_abs > handle->wr_abs) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
372 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
373 //g_print("Stop transfer\n"); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
374 curl_req_no_xfer(handle); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
375 //g_print("Okay\n"); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
376 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
377 else |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
378 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
379 //g_print("Continue transfer\n"); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
380 curl_req_sync_xfer(handle, posn); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
381 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
382 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
383 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
384 //g_print("Seeked %p from %d to %d\n", handle, posn, handle->rd_abs); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
385 return 0; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
386 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
387 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
388 void |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
389 curl_vfs_rewind_impl(VFSFile * file) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
390 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
391 curl_vfs_fseek_impl(file, 0, SEEK_SET); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
392 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
393 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
394 glong |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
395 curl_vfs_ftell_impl(VFSFile * file) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
396 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
397 CurlHandle *handle = file->handle; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
398 return handle->rd_abs; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
399 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
400 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
401 gboolean |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
402 curl_vfs_feof_impl(VFSFile * file) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
403 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
404 CurlHandle *handle = file->handle; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
405 return handle->rd_abs == handle->length; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
406 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
407 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
408 gint |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
409 curl_vfs_truncate_impl(VFSFile * file, glong size) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
410 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
411 return -1; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
412 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
413 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
414 VFSConstructor curl_const = { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
415 "http://", |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
416 curl_vfs_fopen_impl, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
417 curl_vfs_fclose_impl, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
418 curl_vfs_fread_impl, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
419 curl_vfs_fwrite_impl, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
420 curl_vfs_getc_impl, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
421 curl_vfs_ungetc_impl, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
422 curl_vfs_fseek_impl, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
423 curl_vfs_rewind_impl, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
424 curl_vfs_ftell_impl, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
425 curl_vfs_feof_impl, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
426 curl_vfs_truncate_impl |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
427 }; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
428 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
429 static void init(void) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
430 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
431 vfs_register_transport(&curl_const); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
432 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
433 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
434 static void cleanup(void) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
435 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
436 #if 0 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
437 vfs_unregister_transport(&curl_const); |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
438 #endif |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
439 } |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
440 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
441 LowlevelPlugin llp_curl = { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
442 NULL, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
443 NULL, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
444 "http:// URI Transport", |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
445 init, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
446 cleanup, |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
447 }; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
448 |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
449 LowlevelPlugin *get_lplugin_info(void) |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
450 { |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
451 return &llp_curl; |
37b3f45b3a68
[svn] Add code for a plugin to use CURL for http. Needs some build-system
iabervon
parents:
diff
changeset
|
452 } |