rhack 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gemtest +0 -0
- data/CURB-LICENSE +51 -0
- data/Gemfile +4 -0
- data/History.txt +4 -0
- data/LICENSE +51 -0
- data/License.txt +17 -0
- data/Manifest.txt +61 -0
- data/README.txt +12 -0
- data/Rakefile +34 -0
- data/ext/curb-original/curb.c +977 -0
- data/ext/curb-original/curb.h +52 -0
- data/ext/curb-original/curb_config.h +235 -0
- data/ext/curb-original/curb_easy.c +3455 -0
- data/ext/curb-original/curb_easy.h +90 -0
- data/ext/curb-original/curb_errors.c +647 -0
- data/ext/curb-original/curb_errors.h +129 -0
- data/ext/curb-original/curb_macros.h +159 -0
- data/ext/curb-original/curb_multi.c +704 -0
- data/ext/curb-original/curb_multi.h +26 -0
- data/ext/curb-original/curb_postfield.c +523 -0
- data/ext/curb-original/curb_postfield.h +40 -0
- data/ext/curb-original/curb_upload.c +80 -0
- data/ext/curb-original/curb_upload.h +30 -0
- data/ext/curb/Makefile +157 -0
- data/ext/curb/curb.c +977 -0
- data/ext/curb/curb.h +52 -0
- data/ext/curb/curb_config.h +235 -0
- data/ext/curb/curb_easy.c +3430 -0
- data/ext/curb/curb_easy.h +94 -0
- data/ext/curb/curb_errors.c +647 -0
- data/ext/curb/curb_errors.h +129 -0
- data/ext/curb/curb_macros.h +159 -0
- data/ext/curb/curb_multi.c +710 -0
- data/ext/curb/curb_multi.h +26 -0
- data/ext/curb/curb_postfield.c +523 -0
- data/ext/curb/curb_postfield.h +40 -0
- data/ext/curb/curb_upload.c +80 -0
- data/ext/curb/curb_upload.h +30 -0
- data/ext/curb/extconf.rb +399 -0
- data/lib/cache.rb +44 -0
- data/lib/curl-global.rb +151 -0
- data/lib/extensions/browser/env.js +697 -0
- data/lib/extensions/browser/jquery.js +7180 -0
- data/lib/extensions/browser/xmlsax.js +1564 -0
- data/lib/extensions/browser/xmlw3cdom_1.js +1444 -0
- data/lib/extensions/browser/xmlw3cdom_2.js +2744 -0
- data/lib/extensions/curb.rb +125 -0
- data/lib/extensions/declarative.rb +153 -0
- data/lib/extensions/johnson.rb +63 -0
- data/lib/frame.rb +766 -0
- data/lib/init.rb +36 -0
- data/lib/rhack.rb +16 -0
- data/lib/rhack.yml.template +19 -0
- data/lib/rhack/proxy/checker.rb +226 -0
- data/lib/rhack/proxy/list.rb +196 -0
- data/lib/rhack/services.rb +445 -0
- data/lib/rhack_in.rb +2 -0
- data/lib/scout.rb +591 -0
- data/lib/words.rb +37 -0
- data/test/test_frame.rb +107 -0
- data/test/test_rhack.rb +5 -0
- data/test/test_scout.rb +53 -0
- metadata +195 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
/* curb_postfield.h - Field class for POST method
|
2
|
+
* Copyright (c)2006 Ross Bamford.
|
3
|
+
* Licensed under the Ruby License. See LICENSE for details.
|
4
|
+
*
|
5
|
+
* $Id: curb_postfield.h 4 2006-11-17 18:35:31Z roscopeco $
|
6
|
+
*/
|
7
|
+
#ifndef __CURB_POSTFIELD_H
|
8
|
+
#define __CURB_POSTFIELD_H
|
9
|
+
|
10
|
+
#include "curb.h"
|
11
|
+
|
12
|
+
/*
|
13
|
+
* postfield doesn't actually wrap a curl_httppost - instead,
|
14
|
+
* it just holds together some ruby objects and has a C-side
|
15
|
+
* method to add it to a given form list during the perform.
|
16
|
+
*/
|
17
|
+
typedef struct {
|
18
|
+
/* Objects we associate */
|
19
|
+
VALUE name;
|
20
|
+
VALUE content;
|
21
|
+
VALUE content_type;
|
22
|
+
VALUE content_proc;
|
23
|
+
VALUE local_file;
|
24
|
+
VALUE remote_file;
|
25
|
+
|
26
|
+
/* this will sometimes hold a string, which is the result
|
27
|
+
* of the content_proc invocation. We need it to hang around.
|
28
|
+
*/
|
29
|
+
VALUE buffer_str;
|
30
|
+
} ruby_curl_postfield;
|
31
|
+
|
32
|
+
extern VALUE cCurlPostField;
|
33
|
+
|
34
|
+
void append_to_form(VALUE self,
|
35
|
+
struct curl_httppost **first,
|
36
|
+
struct curl_httppost **last);
|
37
|
+
|
38
|
+
void init_curb_postfield();
|
39
|
+
|
40
|
+
#endif
|
@@ -0,0 +1,80 @@
|
|
1
|
+
/* curb_upload.c - Curl upload handle
|
2
|
+
* Copyright (c)2009 Todd A Fisher.
|
3
|
+
* Licensed under the Ruby License. See LICENSE for details.
|
4
|
+
*/
|
5
|
+
#include "curb_upload.h"
|
6
|
+
extern VALUE mCurl;
|
7
|
+
VALUE cCurlUpload;
|
8
|
+
|
9
|
+
#ifdef RDOC_NEVER_DEFINED
|
10
|
+
mCurl = rb_define_module("Curl");
|
11
|
+
#endif
|
12
|
+
|
13
|
+
static void curl_upload_mark(ruby_curl_upload *rbcu) {
|
14
|
+
if (rbcu->stream && !NIL_P(rbcu->stream)) rb_gc_mark(rbcu->stream);
|
15
|
+
}
|
16
|
+
static void curl_upload_free(ruby_curl_upload *rbcu) {
|
17
|
+
free(rbcu);
|
18
|
+
}
|
19
|
+
|
20
|
+
/*
|
21
|
+
* call-seq:
|
22
|
+
* internal class for sending large file uploads
|
23
|
+
*/
|
24
|
+
VALUE ruby_curl_upload_new(VALUE klass) {
|
25
|
+
VALUE upload;
|
26
|
+
ruby_curl_upload *rbcu = ALLOC(ruby_curl_upload);
|
27
|
+
rbcu->stream = Qnil;
|
28
|
+
rbcu->offset = 0;
|
29
|
+
upload = Data_Wrap_Struct(klass, curl_upload_mark, curl_upload_free, rbcu);
|
30
|
+
return upload;
|
31
|
+
}
|
32
|
+
|
33
|
+
/*
|
34
|
+
* call-seq:
|
35
|
+
* internal class for sending large file uploads
|
36
|
+
*/
|
37
|
+
VALUE ruby_curl_upload_stream_set(VALUE self, VALUE stream) {
|
38
|
+
ruby_curl_upload *rbcu;
|
39
|
+
Data_Get_Struct(self, ruby_curl_upload, rbcu);
|
40
|
+
rbcu->stream = stream;
|
41
|
+
return stream;
|
42
|
+
}
|
43
|
+
/*
|
44
|
+
* call-seq:
|
45
|
+
* internal class for sending large file uploads
|
46
|
+
*/
|
47
|
+
VALUE ruby_curl_upload_stream_get(VALUE self) {
|
48
|
+
ruby_curl_upload *rbcu;
|
49
|
+
Data_Get_Struct(self, ruby_curl_upload, rbcu);
|
50
|
+
return rbcu->stream;
|
51
|
+
}
|
52
|
+
/*
|
53
|
+
* call-seq:
|
54
|
+
* internal class for sending large file uploads
|
55
|
+
*/
|
56
|
+
VALUE ruby_curl_upload_offset_set(VALUE self, VALUE offset) {
|
57
|
+
ruby_curl_upload *rbcu;
|
58
|
+
Data_Get_Struct(self, ruby_curl_upload, rbcu);
|
59
|
+
rbcu->offset = FIX2LONG(offset);
|
60
|
+
return offset;
|
61
|
+
}
|
62
|
+
/*
|
63
|
+
* call-seq:
|
64
|
+
* internal class for sending large file uploads
|
65
|
+
*/
|
66
|
+
VALUE ruby_curl_upload_offset_get(VALUE self) {
|
67
|
+
ruby_curl_upload *rbcu;
|
68
|
+
Data_Get_Struct(self, ruby_curl_upload, rbcu);
|
69
|
+
return INT2FIX(rbcu->offset);
|
70
|
+
}
|
71
|
+
|
72
|
+
/* =================== INIT LIB =====================*/
|
73
|
+
void init_curb_upload() {
|
74
|
+
cCurlUpload = rb_define_class_under(mCurl, "Upload", rb_cObject);
|
75
|
+
rb_define_singleton_method(cCurlUpload, "new", ruby_curl_upload_new, 0);
|
76
|
+
rb_define_method(cCurlUpload, "stream=", ruby_curl_upload_stream_set, 1);
|
77
|
+
rb_define_method(cCurlUpload, "stream", ruby_curl_upload_stream_get, 0);
|
78
|
+
rb_define_method(cCurlUpload, "offset=", ruby_curl_upload_offset_set, 1);
|
79
|
+
rb_define_method(cCurlUpload, "offset", ruby_curl_upload_offset_get, 0);
|
80
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/* curb_upload.h - Curl upload handle
|
2
|
+
* Copyright (c)2009 Todd A Fisher.
|
3
|
+
* Licensed under the Ruby License. See LICENSE for details.
|
4
|
+
*/
|
5
|
+
#ifndef __CURB_UPLOAD_H
|
6
|
+
#define __CURB_UPLOAD_H
|
7
|
+
|
8
|
+
#include "curb.h"
|
9
|
+
|
10
|
+
#include <curl/easy.h>
|
11
|
+
|
12
|
+
/*
|
13
|
+
* Maintain the state of an upload e.g. for putting large streams with very little memory
|
14
|
+
* out to a server. via PUT requests
|
15
|
+
*/
|
16
|
+
typedef struct {
|
17
|
+
VALUE stream;
|
18
|
+
size_t offset;
|
19
|
+
} ruby_curl_upload;
|
20
|
+
|
21
|
+
extern VALUE cCurlUpload;
|
22
|
+
void init_curb_upload();
|
23
|
+
|
24
|
+
VALUE ruby_curl_upload_new(VALUE klass);
|
25
|
+
VALUE ruby_curl_upload_stream_set(VALUE self, VALUE stream);
|
26
|
+
VALUE ruby_curl_upload_stream_get(VALUE self);
|
27
|
+
VALUE ruby_curl_upload_offset_set(VALUE self, VALUE offset);
|
28
|
+
VALUE ruby_curl_upload_offset_get(VALUE self);
|
29
|
+
|
30
|
+
#endif
|
data/ext/curb/extconf.rb
ADDED
@@ -0,0 +1,399 @@
|
|
1
|
+
require 'mkmf'
|
2
|
+
|
3
|
+
dir_config('curl')
|
4
|
+
|
5
|
+
if find_executable('curl-config')
|
6
|
+
$CFLAGS << " #{`curl-config --cflags`.strip} -g"
|
7
|
+
if ENV['STATIC_BUILD']
|
8
|
+
$LIBS << " #{`curl-config --static-libs`.strip}"
|
9
|
+
else
|
10
|
+
$LIBS << " #{`curl-config --libs`.strip}"
|
11
|
+
end
|
12
|
+
ca_bundle_path=`curl-config --ca`.strip
|
13
|
+
if !ca_bundle_path.nil? and ca_bundle_path != ''
|
14
|
+
$defs.push( %{-D HAVE_CURL_CONFIG_CA} )
|
15
|
+
$defs.push( %{-D CURL_CONFIG_CA='#{ca_bundle_path.inspect}'} )
|
16
|
+
end
|
17
|
+
elsif !have_library('curl') or !have_header('curl/curl.h')
|
18
|
+
fail <<-EOM
|
19
|
+
Can't find libcurl or curl/curl.h
|
20
|
+
|
21
|
+
Try passing --with-curl-dir or --with-curl-lib and --with-curl-include
|
22
|
+
options to extconf.
|
23
|
+
EOM
|
24
|
+
end
|
25
|
+
|
26
|
+
# Check arch flags
|
27
|
+
# TODO: detect mismatched arch types when libcurl mac ports is mixed with native mac ruby or vice versa
|
28
|
+
#archs = $CFLAGS.scan(/-arch\s(.*?)\s/).first # get the first arch flag
|
29
|
+
#if archs and archs.size >= 1
|
30
|
+
# # need to reduce the number of archs...
|
31
|
+
# # guess the first one is correct... at least the first one is probably the ruby installed arch...
|
32
|
+
# # this could lead to compiled binaries that crash at runtime...
|
33
|
+
# $CFLAGS.gsub!(/-arch\s(.*?)\s/,' ')
|
34
|
+
# $CFLAGS << " -arch #{archs.first}"
|
35
|
+
# puts "Selected arch: #{archs.first}"
|
36
|
+
#end
|
37
|
+
|
38
|
+
def define(s, v=1)
|
39
|
+
$defs.push( format("-D HAVE_%s=%d", s.to_s.upcase, v) )
|
40
|
+
end
|
41
|
+
|
42
|
+
def have_constant(name)
|
43
|
+
sname = name.is_a?(Symbol) ? name.to_s : name.upcase
|
44
|
+
checking_for name do
|
45
|
+
src = %{
|
46
|
+
#include <curl/curl.h>
|
47
|
+
int main() {
|
48
|
+
int test = (int)#{sname};
|
49
|
+
return 0;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
if try_compile(src,"#{$CFLAGS} #{$LIBS}")
|
53
|
+
define name
|
54
|
+
true
|
55
|
+
else
|
56
|
+
#define name, 0
|
57
|
+
false
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
have_constant "curlinfo_redirect_time"
|
63
|
+
have_constant "curlinfo_response_code"
|
64
|
+
have_constant "curlinfo_filetime"
|
65
|
+
have_constant "curlinfo_redirect_count"
|
66
|
+
have_constant "curlinfo_os_errno"
|
67
|
+
have_constant "curlinfo_num_connects"
|
68
|
+
have_constant "curlinfo_ftp_entry_path"
|
69
|
+
have_constant "curl_version_ssl"
|
70
|
+
have_constant "curl_version_libz"
|
71
|
+
have_constant "curl_version_ntlm"
|
72
|
+
have_constant "curl_version_gssnegotiate"
|
73
|
+
have_constant "curl_version_debug"
|
74
|
+
have_constant "curl_version_asynchdns"
|
75
|
+
have_constant "curl_version_spnego"
|
76
|
+
have_constant "curl_version_largefile"
|
77
|
+
have_constant "curl_version_idn"
|
78
|
+
have_constant "curl_version_sspi"
|
79
|
+
have_constant "curl_version_conv"
|
80
|
+
have_constant "curlproxy_http"
|
81
|
+
have_constant "curlproxy_socks4"
|
82
|
+
have_constant "curlproxy_socks5"
|
83
|
+
have_constant "curlauth_basic"
|
84
|
+
have_constant "curlauth_digest"
|
85
|
+
have_constant "curlauth_gssnegotiate"
|
86
|
+
have_constant "curlauth_ntlm"
|
87
|
+
have_constant "curlauth_anysafe"
|
88
|
+
have_constant "curlauth_any"
|
89
|
+
have_constant "curle_tftp_notfound"
|
90
|
+
have_constant "curle_tftp_perm"
|
91
|
+
have_constant "curle_tftp_diskfull"
|
92
|
+
have_constant "curle_tftp_illegal"
|
93
|
+
have_constant "curle_tftp_unknownid"
|
94
|
+
have_constant "curle_tftp_exists"
|
95
|
+
have_constant "curle_tftp_nosuchuser"
|
96
|
+
# older versions of libcurl 7.12
|
97
|
+
have_constant "curle_send_fail_rewind"
|
98
|
+
have_constant "curle_ssl_engine_initfailed"
|
99
|
+
have_constant "curle_login_denied"
|
100
|
+
|
101
|
+
# older than 7.16.3
|
102
|
+
have_constant "curlmopt_maxconnects"
|
103
|
+
|
104
|
+
have_constant "curlopt_seekfunction"
|
105
|
+
have_constant "curlopt_seekdata"
|
106
|
+
have_constant "curlopt_sockoptfunction"
|
107
|
+
have_constant "curlopt_sockoptdata"
|
108
|
+
have_constant "curlopt_opensocketfunction"
|
109
|
+
have_constant "curlopt_opensocketdata"
|
110
|
+
|
111
|
+
# additional consts
|
112
|
+
have_constant "curle_conv_failed"
|
113
|
+
have_constant "curle_conv_reqd"
|
114
|
+
have_constant "curle_ssl_cacert_badfile"
|
115
|
+
have_constant "curle_remote_file_not_found"
|
116
|
+
have_constant "curle_ssh"
|
117
|
+
have_constant "curle_ssl_shutdown_failed"
|
118
|
+
have_constant "curle_again"
|
119
|
+
have_constant "curle_ssl_crl_badfile"
|
120
|
+
have_constant "curle_ssl_issuer_error"
|
121
|
+
|
122
|
+
# added in 7.18.2
|
123
|
+
have_constant "curlinfo_redirect_url"
|
124
|
+
|
125
|
+
# username/password added in 7.19.1
|
126
|
+
have_constant "curlopt_username"
|
127
|
+
have_constant "curlopt_password"
|
128
|
+
have_constant "curlinfo_primary_ip"
|
129
|
+
|
130
|
+
# ie quirk added in 7.19.3
|
131
|
+
have_constant "curlauth_digest_ie"
|
132
|
+
|
133
|
+
# added in 7.15.1
|
134
|
+
have_constant "curlftpmethod_multicwd"
|
135
|
+
have_constant "curlftpmethod_nocwd"
|
136
|
+
have_constant "curlftpmethod_singlecwd"
|
137
|
+
|
138
|
+
# centos 4.5 build of libcurl
|
139
|
+
have_constant "curlm_bad_socket"
|
140
|
+
have_constant "curlm_unknown_option"
|
141
|
+
have_func("curl_multi_timeout")
|
142
|
+
have_func("curl_multi_fdset")
|
143
|
+
have_func("curl_multi_perform")
|
144
|
+
|
145
|
+
# constants
|
146
|
+
have_constant "curlopt_interleavefunction"
|
147
|
+
have_constant "curlopt_interleavedata"
|
148
|
+
have_constant "curlopt_chunk_bgn_function"
|
149
|
+
have_constant "curlopt_chunk_end_function"
|
150
|
+
have_constant "curlopt_chunk_data"
|
151
|
+
have_constant "curlopt_fnmatch_function"
|
152
|
+
have_constant "curlopt_fnmatch_data"
|
153
|
+
have_constant "curlopt_errorbuffer"
|
154
|
+
have_constant "curlopt_stderr"
|
155
|
+
have_constant "curlopt_failonerror"
|
156
|
+
have_constant "curlopt_url"
|
157
|
+
have_constant "curlopt_protocols"
|
158
|
+
have_constant "curlopt_redir_protocols"
|
159
|
+
have_constant "curlopt_proxy"
|
160
|
+
have_constant "curlopt_proxyport"
|
161
|
+
have_constant "curlopt_proxytype"
|
162
|
+
have_constant "curlopt_noproxy"
|
163
|
+
have_constant "curlopt_httpproxytunnel"
|
164
|
+
have_constant "curlopt_socks5_gssapi_service"
|
165
|
+
have_constant "curlopt_socks5_gssapi_nec"
|
166
|
+
have_constant "curlopt_interface"
|
167
|
+
have_constant "curlopt_localport"
|
168
|
+
have_constant "curlopt_dns_cache_timeout"
|
169
|
+
have_constant "curlopt_dns_use_global_cache"
|
170
|
+
have_constant "curlopt_buffersize"
|
171
|
+
have_constant "curlopt_port"
|
172
|
+
have_constant "curlopt_tcp_nodelay"
|
173
|
+
have_constant "curlopt_address_scope"
|
174
|
+
have_constant "curlopt_netrc"
|
175
|
+
have_constant "curl_netrc_optional"
|
176
|
+
have_constant "curl_netrc_ignored"
|
177
|
+
have_constant "curl_netrc_required"
|
178
|
+
have_constant "curlopt_netrc_file"
|
179
|
+
have_constant "curlopt_userpwd"
|
180
|
+
have_constant "curlopt_proxyuserpwd"
|
181
|
+
have_constant "curlopt_username"
|
182
|
+
have_constant "curlopt_password"
|
183
|
+
have_constant "curlopt_password"
|
184
|
+
have_constant "curlopt_password"
|
185
|
+
have_constant "curlopt_httpauth"
|
186
|
+
have_constant "curlauth_digest_ie"
|
187
|
+
have_constant "curlauth_only"
|
188
|
+
have_constant "curlopt_tlsauth_type"
|
189
|
+
have_constant "curlopt_tlsauth_srp"
|
190
|
+
have_constant "curlopt_tlsauth_username"
|
191
|
+
have_constant "curlopt_tlsauth_password"
|
192
|
+
have_constant "curlopt_proxyauth"
|
193
|
+
have_constant "curlopt_autoreferer"
|
194
|
+
have_constant "curlopt_encoding"
|
195
|
+
have_constant "curlopt_followlocation"
|
196
|
+
have_constant "curlopt_unrestricted_auth"
|
197
|
+
have_constant "curlopt_maxredirs"
|
198
|
+
have_constant "curlopt_postredir"
|
199
|
+
have_constant "curlopt_put"
|
200
|
+
have_constant "curlopt_post"
|
201
|
+
have_constant "curlopt_postfields"
|
202
|
+
have_constant "curlopt_postfieldsize"
|
203
|
+
have_constant "curlopt_postfieldsize_large"
|
204
|
+
have_constant "curlopt_copypostfields"
|
205
|
+
have_constant "curlopt_httppost"
|
206
|
+
have_constant "curlopt_referer"
|
207
|
+
have_constant "curlopt_useragent"
|
208
|
+
have_constant "curlopt_httpheader"
|
209
|
+
have_constant "curlopt_http200aliases"
|
210
|
+
have_constant "curlopt_cookie"
|
211
|
+
have_constant "curlopt_cookiefile"
|
212
|
+
have_constant "curlopt_cookiejar"
|
213
|
+
have_constant "curlopt_cookiesession"
|
214
|
+
have_constant "curlopt_cookielist"
|
215
|
+
have_constant "curlopt_httpget"
|
216
|
+
have_constant "curlopt_http_version"
|
217
|
+
have_constant "curl_http_version_none"
|
218
|
+
have_constant "curl_http_version_1_0"
|
219
|
+
have_constant "curl_http_version_1_1"
|
220
|
+
have_constant "curlopt_ignore_content_length"
|
221
|
+
have_constant "curlopt_http_content_decoding"
|
222
|
+
have_constant "curlopt_http_transfer_decoding"
|
223
|
+
have_constant "curlopt_mail_from"
|
224
|
+
have_constant "curlopt_mail_rcpt"
|
225
|
+
have_constant "curlopt_tftp_blksize"
|
226
|
+
have_constant "curlopt_ftpport"
|
227
|
+
have_constant "curlopt_quote"
|
228
|
+
have_constant "curlopt_postquote"
|
229
|
+
have_constant "curlopt_prequote"
|
230
|
+
have_constant "curlopt_dirlistonly"
|
231
|
+
have_constant "curlopt_append"
|
232
|
+
have_constant "curlopt_ftp_use_eprt"
|
233
|
+
have_constant "curlopt_ftp_use_epsv"
|
234
|
+
have_constant "curlopt_ftp_use_pret"
|
235
|
+
have_constant "curlopt_ftp_create_missing_dirs"
|
236
|
+
have_constant "curlopt_ftp_response_timeout"
|
237
|
+
have_constant "curlopt_ftp_alternative_to_user"
|
238
|
+
have_constant "curlopt_ftp_skip_pasv_ip"
|
239
|
+
have_constant "curlopt_ftpsslauth"
|
240
|
+
have_constant "curlftpauth_default"
|
241
|
+
have_constant "curlftpauth_ssl"
|
242
|
+
have_constant "curlftpauth_tls"
|
243
|
+
have_constant "curlopt_ftp_ssl_ccc"
|
244
|
+
have_constant "curlftpssl_ccc_none"
|
245
|
+
have_constant "curlftpssl_ccc_passive"
|
246
|
+
have_constant "curlftpssl_ccc_active"
|
247
|
+
have_constant "curlopt_ftp_account"
|
248
|
+
have_constant "curlopt_ftp_filemethod"
|
249
|
+
have_constant "curlftpmethod_multicwd"
|
250
|
+
have_constant "curlftpmethod_nocwd"
|
251
|
+
have_constant "curlftpmethod_singlecwd"
|
252
|
+
have_constant "curlopt_rtsp_request"
|
253
|
+
have_constant "curl_rtspreq_options"
|
254
|
+
have_constant "curl_rtspreq_describe"
|
255
|
+
have_constant "curl_rtspreq_announce"
|
256
|
+
have_constant "curl_rtspreq_setup"
|
257
|
+
have_constant "curl_rtspreq_play"
|
258
|
+
have_constant "curl_rtspreq_pause"
|
259
|
+
have_constant "curl_rtspreq_teardown"
|
260
|
+
have_constant "curl_rtspreq_get_parameter"
|
261
|
+
have_constant "curl_rtspreq_set_parameter"
|
262
|
+
have_constant "curl_rtspreq_record"
|
263
|
+
have_constant "curl_rtspreq_receive"
|
264
|
+
have_constant "curlopt_rtsp_session_id"
|
265
|
+
have_constant "curlopt_rtsp_stream_uri"
|
266
|
+
have_constant "curlopt_rtsp_transport"
|
267
|
+
have_constant "curlopt_rtsp_header"
|
268
|
+
have_constant "curlopt_rtsp_client_cseq"
|
269
|
+
have_constant "curlopt_rtsp_server_cseq"
|
270
|
+
have_constant "curlopt_transfertext"
|
271
|
+
have_constant "curlopt_proxy_transfer_mode"
|
272
|
+
have_constant "curlopt_crlf"
|
273
|
+
have_constant "curlopt_range"
|
274
|
+
have_constant "curlopt_resume_from"
|
275
|
+
have_constant "curlopt_resume_from_large"
|
276
|
+
have_constant "curlopt_customrequest"
|
277
|
+
have_constant "curlopt_filetime"
|
278
|
+
have_constant "curlopt_nobody"
|
279
|
+
have_constant "curlopt_infilesize"
|
280
|
+
have_constant "curlopt_infilesize_large"
|
281
|
+
have_constant "curlopt_upload"
|
282
|
+
have_constant "curlopt_maxfilesize"
|
283
|
+
have_constant "curlopt_maxfilesize_large"
|
284
|
+
have_constant "curlopt_timecondition"
|
285
|
+
have_constant "curlopt_timevalue"
|
286
|
+
have_constant "curlopt_timeout"
|
287
|
+
have_constant "curlopt_timeout_ms"
|
288
|
+
have_constant "curlopt_low_speed_limit"
|
289
|
+
have_constant "curlopt_low_speed_time"
|
290
|
+
have_constant "curlopt_max_send_speed_large"
|
291
|
+
have_constant "curlopt_max_recv_speed_large"
|
292
|
+
have_constant "curlopt_maxconnects"
|
293
|
+
have_constant "curlopt_closepolicy"
|
294
|
+
have_constant "curlopt_fresh_connect"
|
295
|
+
have_constant "curlopt_forbid_reuse"
|
296
|
+
have_constant "curlopt_connecttimeout"
|
297
|
+
have_constant "curlopt_connecttimeout_ms"
|
298
|
+
have_constant "curlopt_ipresolve"
|
299
|
+
have_constant "curl_ipresolve_whatever"
|
300
|
+
have_constant "curl_ipresolve_v4"
|
301
|
+
have_constant "curl_ipresolve_v6"
|
302
|
+
have_constant "curlopt_connect_only"
|
303
|
+
have_constant "curlopt_use_ssl"
|
304
|
+
have_constant "curlusessl_none"
|
305
|
+
have_constant "curlusessl_try"
|
306
|
+
have_constant "curlusessl_control"
|
307
|
+
have_constant "curlusessl_all"
|
308
|
+
have_constant "curlopt_resolve"
|
309
|
+
have_constant "curlopt_sslcert"
|
310
|
+
have_constant "curlopt_sslcerttype"
|
311
|
+
have_constant "curlopt_sslkey"
|
312
|
+
have_constant "curlopt_sslkeytype"
|
313
|
+
have_constant "curlopt_keypasswd"
|
314
|
+
have_constant "curlopt_sslengine"
|
315
|
+
have_constant "curlopt_sslengine_default"
|
316
|
+
have_constant "curlopt_sslversion"
|
317
|
+
have_constant "curl_sslversion_default"
|
318
|
+
have_constant :CURL_SSLVERSION_TLSv1
|
319
|
+
have_constant :CURL_SSLVERSION_SSLv2
|
320
|
+
have_constant :CURL_SSLVERSION_SSLv3
|
321
|
+
have_constant "curlopt_ssl_verifypeer"
|
322
|
+
have_constant "curlopt_cainfo"
|
323
|
+
have_constant "curlopt_issuercert"
|
324
|
+
have_constant "curlopt_capath"
|
325
|
+
have_constant "curlopt_crlfile"
|
326
|
+
have_constant "curlopt_ssl_verifyhost"
|
327
|
+
have_constant "curlopt_certinfo"
|
328
|
+
have_constant "curlopt_random_file"
|
329
|
+
have_constant "curlopt_egdsocket"
|
330
|
+
have_constant "curlopt_ssl_cipher_list"
|
331
|
+
have_constant "curlopt_ssl_sessionid_cache"
|
332
|
+
have_constant "curlopt_krblevel"
|
333
|
+
have_constant "curlopt_ssh_auth_types"
|
334
|
+
have_constant "curlopt_ssh_host_public_key_md5"
|
335
|
+
have_constant "curlopt_ssh_public_keyfile"
|
336
|
+
have_constant "curlopt_ssh_private_keyfile"
|
337
|
+
have_constant "curlopt_ssh_knownhosts"
|
338
|
+
have_constant "curlopt_ssh_keyfunction"
|
339
|
+
have_constant "curlkhstat_fine_add_to_file"
|
340
|
+
have_constant "curlkhstat_fine"
|
341
|
+
have_constant "curlkhstat_reject"
|
342
|
+
have_constant "curlkhstat_defer"
|
343
|
+
have_constant "curlopt_ssh_keydata"
|
344
|
+
have_constant "curlopt_private"
|
345
|
+
have_constant "curlopt_share"
|
346
|
+
have_constant "curlopt_new_file_perms"
|
347
|
+
have_constant "curlopt_new_directory_perms"
|
348
|
+
have_constant "curlopt_telnetoptions"
|
349
|
+
# was obsoleted in August 2007 for 7.17.0, reused in April 2011 for 7.21.5
|
350
|
+
have_constant "curle_not_built_in"
|
351
|
+
|
352
|
+
have_constant "curle_obsolete" # removed in 7.24 ?
|
353
|
+
|
354
|
+
if try_compile('int main() { return 0; }','-Wall')
|
355
|
+
$CFLAGS << ' -Wall'
|
356
|
+
end
|
357
|
+
|
358
|
+
# do some checking to detect ruby 1.8 hash.c vs ruby 1.9 hash.c
|
359
|
+
def test_for(name, const, src)
|
360
|
+
checking_for name do
|
361
|
+
if try_compile(src,"#{$CFLAGS} #{$LIBS}")
|
362
|
+
define const
|
363
|
+
true
|
364
|
+
else
|
365
|
+
false
|
366
|
+
end
|
367
|
+
end
|
368
|
+
end
|
369
|
+
test_for("Ruby 1.9 Hash", "RUBY19_HASH", %{
|
370
|
+
#include <ruby.h>
|
371
|
+
int main() {
|
372
|
+
VALUE hash = rb_hash_new();
|
373
|
+
if( RHASH(hash)->ntbl->num_entries ) {
|
374
|
+
return 0;
|
375
|
+
}
|
376
|
+
return 1;
|
377
|
+
}
|
378
|
+
})
|
379
|
+
test_for("Ruby 1.9 st.h", "RUBY19_ST_H", %{
|
380
|
+
#include <ruby.h>
|
381
|
+
#include <ruby/st.h>
|
382
|
+
int main() {
|
383
|
+
return 0;
|
384
|
+
}
|
385
|
+
})
|
386
|
+
|
387
|
+
test_for("curl_easy_escape", "CURL_EASY_ESCAPE", %{
|
388
|
+
#include <curl/curl.h>
|
389
|
+
int main() {
|
390
|
+
CURL *easy = curl_easy_init();
|
391
|
+
curl_easy_escape(easy,"hello",5);
|
392
|
+
return 0;
|
393
|
+
}
|
394
|
+
})
|
395
|
+
|
396
|
+
have_func('rb_thread_blocking_region')
|
397
|
+
|
398
|
+
create_header('curb_config.h')
|
399
|
+
create_makefile('curb_core')
|