agoo 2.14.1 → 2.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -2
- data/ext/agoo/extconf.rb +1 -1
- data/ext/agoo/graphql.c +1 -1
- data/ext/agoo/ready.c +9 -9
- data/ext/agoo/rserver.c +6 -6
- data/lib/agoo/version.rb +1 -1
- data/test/graphql_error_test.rb +35 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e538b3f1c7ed9ea23d8529c29bf5104d0882b0dcda49e6114bb011491b1e3ed7
|
4
|
+
data.tar.gz: ee1a1284779ec7108675794f4eff89f826c76f3a5e10a7f07a42bab8bbae31cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e28b50c1bea0934691679719532108fdd6d912f3beed8b9eabe6071ccd71af393b14f3c81d094cb82b5777a22884cc716e12d3c66629e39c5f7f1290919fc030
|
7
|
+
data.tar.gz: 1d478668d82b79acc3d2cabb56fe9aca55fb3513b4c5a5810c0d200a69b081573ff532a346c13d513fae0980fa6331f3701ee041d43ea7cfc32cd2d2a586d0c2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# [![{}j](misc/agoo_128.svg)](http://www.ohler.com/agoo) Agoo
|
2
2
|
|
3
|
-
[![Build Status](https://img.shields.io/
|
3
|
+
[![Build Status](https://img.shields.io/github/workflow/status/ohler55/agoo/CI?logo=github)](https://github.com/ohler55/agoo/actions/workflows/CI.yml)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/agoo.svg)](https://badge.fury.io/rb/agoo)
|
5
5
|
![Gem](https://img.shields.io/gem/dt/agoo.svg) [![TideLift](https://tidelift.com/badges/github/ohler55/agoo)](https://tidelift.com/subscription/pkg/rubygems-agoo?utm_source=rubygems-agoo&utm_medium=referral&utm_campaign=readme)
|
6
6
|
|
@@ -163,4 +163,3 @@ the develop branch. Pull requests should be made against the develop branch.
|
|
163
163
|
- *WABuR* *repo*: https://github.com/ohler55/wabur has an option to use Agoo
|
164
164
|
|
165
165
|
- *Perfer* *repo*: https://github.com/ohler55/perfer
|
166
|
-
|
data/ext/agoo/extconf.rb
CHANGED
@@ -20,7 +20,7 @@ CONFIG['warnflags'].slice!(/ -Wdeclaration-after-statement/)
|
|
20
20
|
CONFIG['warnflags'].slice!(/ -Wmissing-noreturn/)
|
21
21
|
|
22
22
|
have_header('stdatomic.h')
|
23
|
-
|
23
|
+
have_header('sys/epoll.h')
|
24
24
|
have_header('openssl/ssl.h')
|
25
25
|
have_library('ssl')
|
26
26
|
|
data/ext/agoo/graphql.c
CHANGED
data/ext/agoo/ready.c
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
#include <string.h>
|
6
6
|
#include <unistd.h>
|
7
7
|
|
8
|
-
#
|
8
|
+
#ifdef HAVE_SYS_EPOLL_H
|
9
9
|
#include <sys/epoll.h>
|
10
10
|
#else
|
11
11
|
#include <ctype.h>
|
@@ -22,7 +22,7 @@
|
|
22
22
|
// milliseconds
|
23
23
|
#define MAX_WAIT 10
|
24
24
|
|
25
|
-
#
|
25
|
+
#ifdef HAVE_SYS_EPOLL_H
|
26
26
|
#define EPOLL_SIZE 100
|
27
27
|
#else
|
28
28
|
#define INITIAL_POLL_SIZE 1024
|
@@ -34,7 +34,7 @@ typedef struct _link {
|
|
34
34
|
int fd;
|
35
35
|
void *ctx;
|
36
36
|
agooHandler handler;
|
37
|
-
#
|
37
|
+
#ifdef HAVE_SYS_EPOLL_H
|
38
38
|
uint32_t events; // last events set
|
39
39
|
#else
|
40
40
|
struct pollfd *pp;
|
@@ -45,7 +45,7 @@ struct _agooReady {
|
|
45
45
|
Link links;
|
46
46
|
int lcnt;
|
47
47
|
double next_check;
|
48
|
-
#
|
48
|
+
#ifdef HAVE_SYS_EPOLL_H
|
49
49
|
int epoll_fd;
|
50
50
|
#else
|
51
51
|
struct pollfd *pa;
|
@@ -82,7 +82,7 @@ agoo_ready_create(agooErr err) {
|
|
82
82
|
ready->links = NULL;
|
83
83
|
ready->lcnt = 0;
|
84
84
|
ready->next_check = dtime() + CHECK_FREQ;
|
85
|
-
#
|
85
|
+
#ifdef HAVE_SYS_EPOLL_H
|
86
86
|
if (0 > (ready->epoll_fd = epoll_create(1))) {
|
87
87
|
agoo_err_no(err, "epoll create failed");
|
88
88
|
return NULL;
|
@@ -111,7 +111,7 @@ agoo_ready_destroy(agooReady ready) {
|
|
111
111
|
}
|
112
112
|
AGOO_FREE(link);
|
113
113
|
}
|
114
|
-
#
|
114
|
+
#ifdef HAVE_SYS_EPOLL_H
|
115
115
|
close(ready->epoll_fd);
|
116
116
|
#else
|
117
117
|
AGOO_FREE(ready->pa);
|
@@ -137,7 +137,7 @@ agoo_ready_add(agooErr err,
|
|
137
137
|
ready->links = link;
|
138
138
|
ready->lcnt++;
|
139
139
|
|
140
|
-
#
|
140
|
+
#ifdef HAVE_SYS_EPOLL_H
|
141
141
|
link->events = EPOLLIN;
|
142
142
|
{
|
143
143
|
struct epoll_event event = {
|
@@ -181,7 +181,7 @@ ready_remove(agooReady ready, Link link) {
|
|
181
181
|
if (NULL != link->next) {
|
182
182
|
link->next->prev = link->prev;
|
183
183
|
}
|
184
|
-
#
|
184
|
+
#ifdef HAVE_SYS_EPOLL_H
|
185
185
|
{
|
186
186
|
struct epoll_event event = {
|
187
187
|
.events = 0,
|
@@ -214,7 +214,7 @@ agoo_ready_go(agooErr err, agooReady ready) {
|
|
214
214
|
Link link;
|
215
215
|
Link next;
|
216
216
|
|
217
|
-
#
|
217
|
+
#ifdef HAVE_SYS_EPOLL_H
|
218
218
|
struct epoll_event events[EPOLL_SIZE];
|
219
219
|
struct epoll_event *ep;
|
220
220
|
int cnt;
|
data/ext/agoo/rserver.c
CHANGED
@@ -523,14 +523,14 @@ handle_rack_inner(VALUE x) {
|
|
523
523
|
if (Qnil != body) {
|
524
524
|
body = rb_ivar_get(body, rb_intern("@body"));
|
525
525
|
}
|
526
|
-
if (rb_respond_to(body,
|
527
|
-
|
526
|
+
if (rb_respond_to(body, each_id)) {
|
527
|
+
rb_block_call(body, each_id, 0, 0, body_len_cb, (VALUE)&bsize);
|
528
528
|
}
|
529
529
|
} else {
|
530
|
-
|
530
|
+
rb_block_call(bv, each_id, 0, 0, body_len_cb, (VALUE)&bsize);
|
531
531
|
}
|
532
532
|
} else {
|
533
|
-
|
533
|
+
rb_block_call(bv, each_id, 0, 0, body_len_cb, (VALUE)&bsize);
|
534
534
|
}
|
535
535
|
}
|
536
536
|
switch (code) {
|
@@ -587,7 +587,7 @@ handle_rack_inner(VALUE x) {
|
|
587
587
|
if (T_HASH == rb_type(hv)) {
|
588
588
|
rb_hash_foreach(hv, header_cb, (VALUE)&t);
|
589
589
|
} else {
|
590
|
-
|
590
|
+
rb_block_call(hv, each_id, 0, 0, header_each_cb, (VALUE)&t);
|
591
591
|
}
|
592
592
|
}
|
593
593
|
t = agoo_text_append(t, "\r\n", 2);
|
@@ -602,7 +602,7 @@ handle_rack_inner(VALUE x) {
|
|
602
602
|
t = agoo_text_append(t, StringValuePtr(v), (int)RSTRING_LEN(v));
|
603
603
|
}
|
604
604
|
} else {
|
605
|
-
|
605
|
+
rb_block_call(bv, each_id, 0, 0, body_append_cb, (VALUE)&t);
|
606
606
|
}
|
607
607
|
}
|
608
608
|
agoo_res_message_push(req->res, t);
|
data/lib/agoo/version.rb
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$: << File.dirname(__FILE__)
|
4
|
+
$root_dir = File.dirname(File.expand_path(File.dirname(__FILE__)))
|
5
|
+
%w(lib ext).each do |dir|
|
6
|
+
$: << File.join($root_dir, dir)
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'minitest'
|
10
|
+
require 'minitest/autorun'
|
11
|
+
|
12
|
+
require 'agoo'
|
13
|
+
|
14
|
+
class Schema
|
15
|
+
attr_reader :query
|
16
|
+
|
17
|
+
def initialize()
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class GraphQLErrTest < Minitest::Test
|
22
|
+
|
23
|
+
def test_bad_sdl
|
24
|
+
bad_sdl = %^
|
25
|
+
type Query @ruby(class: "Query" {
|
26
|
+
}
|
27
|
+
^
|
28
|
+
Agoo::GraphQL.schema(Schema.new) {
|
29
|
+
assert_raises(StandardError) {
|
30
|
+
Agoo::GraphQL.load(bad_sdl)
|
31
|
+
}
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
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.14.
|
4
|
+
version: 2.14.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:
|
11
|
+
date: 2022-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
@@ -154,6 +154,7 @@ files:
|
|
154
154
|
- test/bind_test.rb
|
155
155
|
- test/domain_test.rb
|
156
156
|
- test/early_hints_test.rb
|
157
|
+
- test/graphql_error_test.rb
|
157
158
|
- test/graphql_test.rb
|
158
159
|
- test/hijack_test.rb
|
159
160
|
- test/log_test.rb
|
@@ -189,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
190
|
version: '0'
|
190
191
|
requirements:
|
191
192
|
- Linux or macOS
|
192
|
-
rubygems_version: 3.
|
193
|
+
rubygems_version: 3.3.3
|
193
194
|
signing_key:
|
194
195
|
specification_version: 4
|
195
196
|
summary: An HTTP server
|
@@ -198,6 +199,7 @@ test_files:
|
|
198
199
|
- test/bind_test.rb
|
199
200
|
- test/domain_test.rb
|
200
201
|
- test/early_hints_test.rb
|
202
|
+
- test/graphql_error_test.rb
|
201
203
|
- test/graphql_test.rb
|
202
204
|
- test/hijack_test.rb
|
203
205
|
- test/log_test.rb
|