agoo 2.11.1 → 2.11.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of agoo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +1 -1
- data/ext/agoo/con.c +15 -13
- data/ext/agoo/doc.c +8 -1
- data/ext/agoo/graphql.c +1 -0
- data/ext/agoo/rgraphql.c +3 -0
- data/lib/agoo/version.rb +1 -1
- data/test/hijack_test.rb +28 -29
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df1bb00da0c9e4622be8beab3f1f6e1e72944ebd499c59be4708a406497398e5
|
4
|
+
data.tar.gz: 919371ceccd840f0bd281ae010f1478764e76ca4660d1160b3b1c324e5f862f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a964aaf5a16e046f245d4da7e13852e5b996628fcd293343ce8ac57bbf8ca38b658282681e7c8e38b33c19546516adf5e3c148a5a9000b942de90438742f752
|
7
|
+
data.tar.gz: b5334140835783165e52f716217079739ab1460e7bda78e3f0dd0925b86885583b9143222befde5d206543838b7cc8a1127e6a4915c1a04df08821b7b80a4def
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,17 @@ All changes to the Agoo gem are documented here. Releases follow semantic versio
|
|
4
4
|
|
5
5
|
## [Unreleased]
|
6
6
|
|
7
|
+
## [2.11.2] - [2019-10-20]
|
8
|
+
|
9
|
+
Coerce improvements
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
- Coerce of `nil` to anything returns GraphQL `null`.
|
13
|
+
|
14
|
+
- Coerce String to defined scalar now succeeds.
|
15
|
+
|
16
|
+
- Handle comments in all locations.
|
17
|
+
|
7
18
|
## [2.11.1] - [2019-09-22]
|
8
19
|
|
9
20
|
Race fix
|
data/README.md
CHANGED
@@ -125,7 +125,7 @@ the develop branch. Pull requests should be made against the develop branch.
|
|
125
125
|
|
126
126
|
## Support
|
127
127
|
|
128
|
-
[Get supported Agoo with a Tidelift Subscription.](https://tidelift.com/subscription/pkg/rubygems-agoo?utm_source=rubygems-agoo&utm_medium=referral&utm_campaign=readme)
|
128
|
+
[Get supported Agoo with a Tidelift Subscription.](https://tidelift.com/subscription/pkg/rubygems-agoo?utm_source=rubygems-agoo&utm_medium=referral&utm_campaign=readme) Security updates are [supported](https://tidelift.com/security).
|
129
129
|
|
130
130
|
## Links
|
131
131
|
|
data/ext/agoo/con.c
CHANGED
@@ -487,19 +487,21 @@ check_upgrade(agooCon c) {
|
|
487
487
|
|
488
488
|
#ifdef HAVE_OPENSSL_SSL_H
|
489
489
|
static void
|
490
|
-
con_ssl_error(agooCon c, const char *filename, int line) {
|
491
|
-
char
|
492
|
-
unsigned long e = ERR_get_error();
|
490
|
+
con_ssl_error(agooCon c, const char *what, unsigned long e, const char *filename, int line) {
|
491
|
+
char buf[224];
|
493
492
|
|
493
|
+
if (0 == e) {
|
494
|
+
e = ERR_get_error();
|
495
|
+
}
|
494
496
|
c->dead = true;
|
495
497
|
ERR_error_string_n(e, buf, sizeof(buf));
|
496
|
-
agoo_log_cat(&agoo_error_cat, "%s at %s:%d", buf, filename, line);
|
498
|
+
agoo_log_cat(&agoo_error_cat, "%s %s at %s:%d", what, buf, filename, line);
|
497
499
|
}
|
498
500
|
#endif
|
499
501
|
|
500
502
|
bool
|
501
503
|
agoo_con_http_read(agooCon c) {
|
502
|
-
ssize_t cnt;
|
504
|
+
ssize_t cnt = 0;
|
503
505
|
|
504
506
|
if (c->dead || 0 == c->sock || c->closing) {
|
505
507
|
return true;
|
@@ -512,13 +514,13 @@ agoo_con_http_read(agooCon c) {
|
|
512
514
|
cnt = SSL_read(c->ssl, c->buf + c->bcnt, sizeof(c->buf) - c->bcnt - 1);
|
513
515
|
}
|
514
516
|
if (0 > cnt) {
|
515
|
-
unsigned long e = ERR_get_error();
|
517
|
+
//unsigned long e = ERR_get_error();
|
518
|
+
int e = ERR_get_error();
|
516
519
|
|
517
520
|
if (0 == e) {
|
518
|
-
cnt = 0;
|
519
521
|
return false;
|
520
522
|
} else {
|
521
|
-
con_ssl_error(c, __FILE__, __LINE__);
|
523
|
+
con_ssl_error(c, "read", (unsigned long)e, __FILE__, __LINE__);
|
522
524
|
c->dead = true;
|
523
525
|
return true;
|
524
526
|
}
|
@@ -632,7 +634,7 @@ bool
|
|
632
634
|
agoo_con_http_write(agooCon c) {
|
633
635
|
agooRes res = agoo_con_res_pop(c);
|
634
636
|
agooText message = agoo_res_message_peek(res);
|
635
|
-
ssize_t cnt;
|
637
|
+
ssize_t cnt = 0;
|
636
638
|
|
637
639
|
if (NULL == message) {
|
638
640
|
return true;
|
@@ -665,7 +667,7 @@ agoo_con_http_write(agooCon c) {
|
|
665
667
|
if (0 == e) {
|
666
668
|
return true;
|
667
669
|
}
|
668
|
-
con_ssl_error(c, __FILE__, __LINE__);
|
670
|
+
con_ssl_error(c, "write", (unsigned long)e, __FILE__, __LINE__);
|
669
671
|
c->dead = true;
|
670
672
|
|
671
673
|
return false;
|
@@ -1246,13 +1248,13 @@ static void
|
|
1246
1248
|
con_ssl_setup(agooCon c) {
|
1247
1249
|
#ifdef HAVE_OPENSSL_SSL_H
|
1248
1250
|
if (NULL == (c->ssl = SSL_new(agoo_server.ssl_ctx))) {
|
1249
|
-
con_ssl_error(c, __FILE__, __LINE__);
|
1251
|
+
con_ssl_error(c, "new SSL", 0, __FILE__, __LINE__);
|
1250
1252
|
}
|
1251
1253
|
if (!SSL_set_fd(c->ssl, c->sock)) {
|
1252
|
-
con_ssl_error(c, __FILE__, __LINE__);
|
1254
|
+
con_ssl_error(c, "SSL set fd", 0, __FILE__, __LINE__);
|
1253
1255
|
}
|
1254
1256
|
if (!SSL_accept(c->ssl)) {
|
1255
|
-
con_ssl_error(c, __FILE__, __LINE__);
|
1257
|
+
con_ssl_error(c, "SSL accept", 0, __FILE__, __LINE__);
|
1256
1258
|
}
|
1257
1259
|
#else
|
1258
1260
|
agoo_log_cat(&agoo_error_cat, "SSL not included in the build.");
|
data/ext/agoo/doc.c
CHANGED
@@ -61,7 +61,14 @@ int
|
|
61
61
|
agoo_doc_skip_white(agooDoc doc) {
|
62
62
|
const char *start = doc->cur;
|
63
63
|
|
64
|
-
|
64
|
+
while (true) {
|
65
|
+
for (; 'w' == char_map[*(uint8_t*)doc->cur]; doc->cur++) {
|
66
|
+
}
|
67
|
+
if ('#' == *doc->cur) {
|
68
|
+
agoo_doc_skip_comment(doc);
|
69
|
+
} else {
|
70
|
+
break;
|
71
|
+
}
|
65
72
|
}
|
66
73
|
return (int)(doc->cur - start);
|
67
74
|
}
|
data/ext/agoo/graphql.c
CHANGED
data/ext/agoo/rgraphql.c
CHANGED
@@ -222,6 +222,9 @@ coerce(agooErr err, gqlRef ref, gqlType type) {
|
|
222
222
|
gqlValue value = NULL;
|
223
223
|
volatile VALUE v;
|
224
224
|
|
225
|
+
if (Qnil == (VALUE)ref) {
|
226
|
+
return gql_null_create(err);
|
227
|
+
}
|
225
228
|
if (NULL == type) {
|
226
229
|
// This is really an error but make a best effort anyway.
|
227
230
|
switch (rb_type((VALUE)ref)) {
|
data/lib/agoo/version.rb
CHANGED
data/test/hijack_test.rb
CHANGED
@@ -14,7 +14,7 @@ require 'oj'
|
|
14
14
|
|
15
15
|
require 'agoo'
|
16
16
|
|
17
|
-
class
|
17
|
+
class HijackHandlerTest < Minitest::Test
|
18
18
|
class HijackHandler
|
19
19
|
def call(env)
|
20
20
|
io = env['rack.hijack'].call
|
@@ -27,34 +27,33 @@ hello world|)
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
Minitest.after_run {
|
31
|
+
GC.start
|
32
|
+
Agoo::shutdown
|
33
|
+
}
|
34
|
+
|
30
35
|
def test_hijack
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
jack
|
53
|
-
|
54
|
-
ensure
|
55
|
-
GC.start
|
56
|
-
Agoo.shutdown
|
57
|
-
end
|
36
|
+
Agoo::Log.configure(dir: '',
|
37
|
+
console: true,
|
38
|
+
classic: true,
|
39
|
+
colorize: true,
|
40
|
+
states: {
|
41
|
+
INFO: false,
|
42
|
+
DEBUG: false,
|
43
|
+
connect: false,
|
44
|
+
request: false,
|
45
|
+
response: false,
|
46
|
+
eval: true,
|
47
|
+
})
|
48
|
+
|
49
|
+
Agoo::Server.init(6471, 'root', thread_count: 1)
|
50
|
+
|
51
|
+
handler = HijackHandler.new
|
52
|
+
Agoo::Server.handle(:GET, "/hijack", handler)
|
53
|
+
|
54
|
+
Agoo::Server.start()
|
55
|
+
|
56
|
+
jack
|
58
57
|
end
|
59
58
|
|
60
59
|
def jack
|
@@ -72,5 +71,5 @@ hello world|)
|
|
72
71
|
|
73
72
|
assert_equal('hello world', content, 'content mismatch')
|
74
73
|
end
|
75
|
-
|
74
|
+
|
76
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.11.
|
4
|
+
version: 2.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|