hiredis 0.4.2.pre → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/hiredis_ext/connection.c +20 -4
- data/lib/hiredis/version.rb +1 -1
- metadata +17 -20
@@ -72,12 +72,20 @@ static VALUE connection_parent_context_alloc(VALUE klass) {
|
|
72
72
|
return Data_Wrap_Struct(klass, parent_context_mark, parent_context_free, pc);
|
73
73
|
}
|
74
74
|
|
75
|
-
static int __wait_readable(int fd, struct timeval *timeout, int *isset) {
|
75
|
+
static int __wait_readable(int fd, const struct timeval *timeout, int *isset) {
|
76
|
+
struct timeval to;
|
77
|
+
struct timeval *toptr = NULL;
|
76
78
|
fd_set fds;
|
77
79
|
FD_ZERO(&fds);
|
78
80
|
FD_SET(fd, &fds);
|
79
81
|
|
80
|
-
|
82
|
+
/* rb_thread_select modifies the passed timeval, so we pass a copy */
|
83
|
+
if (timeout != NULL) {
|
84
|
+
memcpy(&to, timeout, sizeof(to));
|
85
|
+
toptr = &to;
|
86
|
+
}
|
87
|
+
|
88
|
+
if (rb_thread_select(fd + 1, &fds, NULL, NULL, toptr) < 0) {
|
81
89
|
return -1;
|
82
90
|
}
|
83
91
|
|
@@ -88,12 +96,20 @@ static int __wait_readable(int fd, struct timeval *timeout, int *isset) {
|
|
88
96
|
return 0;
|
89
97
|
}
|
90
98
|
|
91
|
-
static int __wait_writable(int fd, struct timeval *timeout, int *isset) {
|
99
|
+
static int __wait_writable(int fd, const struct timeval *timeout, int *isset) {
|
100
|
+
struct timeval to;
|
101
|
+
struct timeval *toptr = NULL;
|
92
102
|
fd_set fds;
|
93
103
|
FD_ZERO(&fds);
|
94
104
|
FD_SET(fd, &fds);
|
95
105
|
|
96
|
-
|
106
|
+
/* rb_thread_select modifies the passed timeval, so we pass a copy */
|
107
|
+
if (timeout != NULL) {
|
108
|
+
memcpy(&to, timeout, sizeof(to));
|
109
|
+
toptr = &to;
|
110
|
+
}
|
111
|
+
|
112
|
+
if (rb_thread_select(fd + 1, NULL, &fds, NULL, toptr) < 0) {
|
97
113
|
return -1;
|
98
114
|
}
|
99
115
|
|
data/lib/hiredis/version.rb
CHANGED
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hiredis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
5
|
-
prerelease:
|
4
|
+
version: 0.4.3
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Pieter Noordhuis
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-12-
|
12
|
+
date: 2011-12-01 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|
16
|
-
requirement: &
|
16
|
+
requirement: &10823340 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 0.7.1
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *10823340
|
25
25
|
description: Ruby extension that wraps Hiredis (blocking connection and reply parsing)
|
26
26
|
email:
|
27
27
|
- pcnoordhuis@gmail.com
|
@@ -31,32 +31,32 @@ extensions:
|
|
31
31
|
extra_rdoc_files: []
|
32
32
|
files:
|
33
33
|
- ext/hiredis_ext/extconf.rb
|
34
|
-
- ext/hiredis_ext/connection.c
|
35
34
|
- ext/hiredis_ext/hiredis_ext.c
|
36
35
|
- ext/hiredis_ext/reader.c
|
36
|
+
- ext/hiredis_ext/connection.c
|
37
37
|
- ext/hiredis_ext/hiredis_ext.h
|
38
|
-
- vendor/hiredis/async.c
|
39
|
-
- vendor/hiredis/dict.c
|
40
38
|
- vendor/hiredis/hiredis.c
|
41
|
-
- vendor/hiredis/net.c
|
42
39
|
- vendor/hiredis/sds.c
|
43
40
|
- vendor/hiredis/test.c
|
44
|
-
- vendor/hiredis/async.
|
45
|
-
- vendor/hiredis/
|
41
|
+
- vendor/hiredis/async.c
|
42
|
+
- vendor/hiredis/net.c
|
43
|
+
- vendor/hiredis/dict.c
|
44
|
+
- vendor/hiredis/sds.h
|
46
45
|
- vendor/hiredis/fmacros.h
|
47
46
|
- vendor/hiredis/hiredis.h
|
48
47
|
- vendor/hiredis/net.h
|
49
|
-
- vendor/hiredis/
|
48
|
+
- vendor/hiredis/dict.h
|
49
|
+
- vendor/hiredis/async.h
|
50
50
|
- vendor/hiredis/COPYING
|
51
51
|
- vendor/hiredis/Makefile
|
52
|
+
- lib/hiredis.rb
|
52
53
|
- lib/hiredis/connection.rb
|
54
|
+
- lib/hiredis/ruby/connection.rb
|
55
|
+
- lib/hiredis/ruby/reader.rb
|
53
56
|
- lib/hiredis/ext/connection.rb
|
54
57
|
- lib/hiredis/ext/reader.rb
|
55
58
|
- lib/hiredis/reader.rb
|
56
|
-
- lib/hiredis/ruby/connection.rb
|
57
|
-
- lib/hiredis/ruby/reader.rb
|
58
59
|
- lib/hiredis/version.rb
|
59
|
-
- lib/hiredis.rb
|
60
60
|
- COPYING
|
61
61
|
- Rakefile
|
62
62
|
homepage: http://github.com/pietern/hiredis-rb
|
@@ -71,15 +71,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
71
71
|
- - ! '>='
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
|
-
segments:
|
75
|
-
- 0
|
76
|
-
hash: -2677498915203441495
|
77
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
75
|
none: false
|
79
76
|
requirements:
|
80
|
-
- - ! '
|
77
|
+
- - ! '>='
|
81
78
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
79
|
+
version: '0'
|
83
80
|
requirements: []
|
84
81
|
rubyforge_project:
|
85
82
|
rubygems_version: 1.8.10
|