bayserver-docker-cgi 3.0.2 → 3.0.5
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88a5c98d0a6278bc4939b376cfbca8567cef41fa4095f269bd4dcfe9d5d30664
|
4
|
+
data.tar.gz: a4a582dceedf85fe208d011f2b06124dd177a8c660a04533e888af7a920d73de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9edb6724864c83d9ebd92b552de1caec5088564398e23c80ee3907646418c10d0f0ed6cbd641171656741e25ac08c00752482cd24534801d0c3255de664f910
|
7
|
+
data.tar.gz: 6c45895c8be3db7d8cc5935a283d123b206031d82c8be72bb61da12deea45466462469e16038c1c68234b9f9f3f60f42a980c7baa62a4e4be5453e0126fcddff
|
@@ -38,14 +38,20 @@ module Baykit
|
|
38
38
|
attr :last_access
|
39
39
|
attr_accessor :multiplexer
|
40
40
|
attr :env
|
41
|
+
attr :buffers
|
41
42
|
|
42
43
|
def initialize(cgi_docker, tur, env)
|
43
44
|
@cgi_docker = cgi_docker
|
44
45
|
@tour = tur
|
45
46
|
@tour_id = tur.tour_id
|
46
47
|
@env = env
|
48
|
+
@pid = 0
|
49
|
+
@std_in_rd = nil
|
50
|
+
@std_out_rd = nil
|
51
|
+
@std_err_rd = nil
|
47
52
|
@std_out_closed = true
|
48
53
|
@std_err_closed = true
|
54
|
+
@buffers = []
|
49
55
|
end
|
50
56
|
|
51
57
|
######################################################
|
@@ -64,9 +70,12 @@ module Baykit
|
|
64
70
|
def on_read_req_content(tur, buf, start, len, &callback)
|
65
71
|
BayLog.debug("%s CGI:onReadReqContent: len=%d", tur, len)
|
66
72
|
|
67
|
-
|
68
|
-
|
69
|
-
|
73
|
+
if @pid != 0
|
74
|
+
write_to_std_in(tur, buf, start, len, &callback)
|
75
|
+
else
|
76
|
+
# postponed
|
77
|
+
@buffers << [buf[start, len].dup, callback]
|
78
|
+
end
|
70
79
|
access()
|
71
80
|
end
|
72
81
|
|
@@ -135,6 +144,11 @@ module Baykit
|
|
135
144
|
@std_err_rd = IORudder.new(std_err[0])
|
136
145
|
BayLog.debug("#{@tour} PID: #{pid}")
|
137
146
|
|
147
|
+
@buffers.each do |pair|
|
148
|
+
BayLog.debug("%s write postponed data: len=%d", @tour, pair[0].length)
|
149
|
+
write_to_std_in(@tour, pair[0], 0, pair[0].length, &pair[1])
|
150
|
+
end
|
151
|
+
|
138
152
|
@std_out_closed = false
|
139
153
|
@std_err_closed = false
|
140
154
|
|
@@ -185,7 +199,7 @@ module Baykit
|
|
185
199
|
RudderState.new(@std_out_rd, out_tp)
|
186
200
|
)
|
187
201
|
|
188
|
-
ship_id =
|
202
|
+
ship_id = out_ship.ship_id
|
189
203
|
@tour.res.set_consume_listener do |len, resume|
|
190
204
|
if resume
|
191
205
|
out_ship.resume_read(ship_id)
|
@@ -233,6 +247,12 @@ module Baykit
|
|
233
247
|
return duration_sec > @cgi_docker.timeout_sec
|
234
248
|
end
|
235
249
|
|
250
|
+
def write_to_std_in(tur, buf, start, len, &callback)
|
251
|
+
wrote_len = @std_in_rd.write(buf[start, len])
|
252
|
+
BayLog.debug("%s CGI:onReadReqContent: wrote=%d", tur, wrote_len)
|
253
|
+
tur.req.consumed(Tour::TOUR_ID_NOCHECK, len, &callback)
|
254
|
+
end
|
255
|
+
|
236
256
|
def process_finished()
|
237
257
|
BayLog.debug("%s CGI Process finished: pid=%s", @tour, @pid)
|
238
258
|
|
@@ -57,17 +57,17 @@ module Baykit
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def notify_eof()
|
60
|
-
BayLog.debug("
|
60
|
+
BayLog.debug("%s CGI stderr EOF\\(^o^)/ tur=%s", self, @tour)
|
61
61
|
return NextSocketAction::CLOSE
|
62
62
|
end
|
63
63
|
|
64
64
|
def notify_close()
|
65
|
-
BayLog.debug("
|
65
|
+
BayLog.debug("%s CGI stderr notifyClose tur=%s", self, @tour)
|
66
66
|
@handler.std_err_closed()
|
67
67
|
end
|
68
68
|
|
69
69
|
def check_timeout(duration_sec)
|
70
|
-
BayLog.debug("%s stderr Check timeout: dur=%d", @tour, duration_sec)
|
70
|
+
BayLog.debug("%s stderr Check timeout: tur=%s dur=%d", self, @tour, duration_sec)
|
71
71
|
return @handler.timed_out()
|
72
72
|
end
|
73
73
|
|
@@ -57,7 +57,7 @@ module Baykit
|
|
57
57
|
|
58
58
|
def notify_read(buf)
|
59
59
|
@file_wrote_len += buf.length
|
60
|
-
BayLog.
|
60
|
+
BayLog.debug("%s on read (len=%d total=%d)", self, buf.length, @file_wrote_len)
|
61
61
|
|
62
62
|
pos = 0
|
63
63
|
if @header_reading
|
@@ -132,25 +132,25 @@ module Baykit
|
|
132
132
|
end
|
133
133
|
|
134
134
|
def notify_error(e)
|
135
|
-
BayLog.debug_e(e, "%s CGI notifyError", self)
|
135
|
+
BayLog.debug_e(e, "%s CGI notifyError tur=%s", self, @tour)
|
136
136
|
end
|
137
137
|
|
138
138
|
def notify_eof()
|
139
|
-
BayLog.debug("%s stdout EOF(^o^)", @tour)
|
139
|
+
BayLog.debug("%s stdout EOF(^o^) tur=%s", self, @tour)
|
140
140
|
return NextSocketAction::CLOSE
|
141
141
|
end
|
142
142
|
|
143
143
|
def notify_close()
|
144
|
-
BayLog.debug("%s stdout notifyClose", @tour)
|
144
|
+
BayLog.debug("%s stdout notifyClose tur=%s", self, @tour)
|
145
145
|
@handler.std_out_closed()
|
146
146
|
end
|
147
147
|
|
148
148
|
def check_timeout(duration_sec)
|
149
|
-
BayLog.debug("%s Check StdOut timeout: dur=%d", @tour, duration_sec)
|
149
|
+
BayLog.debug("%s Check StdOut timeout: tur=%s dur=%d", self, @tour, duration_sec)
|
150
150
|
|
151
151
|
if @handler.timed_out()
|
152
152
|
# Kill cgi process instead of handing timeout
|
153
|
-
BayLog.warn("%s Kill process!:
|
153
|
+
BayLog.warn("%s Process timed out! Kill process!: tur=%s pid=%d", self, @tour, @handler.pid)
|
154
154
|
Process.kill("KILL", @handler.pid)
|
155
155
|
return true
|
156
156
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bayserver-docker-cgi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michisuke-P
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bayserver-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.0.
|
19
|
+
version: 3.0.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.0.
|
26
|
+
version: 3.0.5
|
27
27
|
description: BayServer is one of the high-speed web servers. It operates as a single-threaded,
|
28
28
|
asynchronous server, which makes it exceptionally fast. It also supports multi-core
|
29
29
|
processors, harnessing the full potential of the CPU's capabilities.
|
@@ -45,7 +45,7 @@ homepage: https://baykit.yokohama
|
|
45
45
|
licenses:
|
46
46
|
- MIT
|
47
47
|
metadata: {}
|
48
|
-
post_install_message:
|
48
|
+
post_install_message:
|
49
49
|
rdoc_options: []
|
50
50
|
require_paths:
|
51
51
|
- lib
|
@@ -60,8 +60,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
requirements: []
|
63
|
-
rubygems_version: 3.
|
64
|
-
signing_key:
|
63
|
+
rubygems_version: 3.4.19
|
64
|
+
signing_key:
|
65
65
|
specification_version: 4
|
66
66
|
summary: AJP docker of BayServer
|
67
67
|
test_files: []
|