bayserver-core 3.3.1 → 3.3.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.
- checksums.yaml +4 -4
- data/lib/baykit/bayserver/agent/multiplexer/spider_multiplexer.rb +15 -16
- data/lib/baykit/bayserver/common/inbound_ship.rb +1 -15
- data/lib/baykit/bayserver/docker/send_file/file_store.rb +1 -1
- data/lib/baykit/bayserver/protocol/packet_part_accessor.rb +4 -3
- data/lib/baykit/bayserver/tours/tour_handler.rb +1 -1
- data/lib/baykit/bayserver/util/io_util.rb +1 -3
- data/lib/baykit/bayserver/util/object_factory.rb +5 -2
- data/lib/baykit/bayserver/util/object_store.rb +5 -5
- data/lib/baykit/bayserver/util/reusable.rb +3 -2
- data/lib/baykit/bayserver/util/simple_buffer.rb +1 -3
- data/lib/baykit/bayserver/version.rb +1 -1
- 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: e703a9c19bbe0247b85fc02107f7877c52c04dbbe058b2a8f27e926f3d5261e3
|
|
4
|
+
data.tar.gz: '04958635d3712700bf351335d8356ff17408fbe73b6b9342e1e0e837deb3f40e'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c21165db27b4db383b702d87eda5b3199eedf61f51189b9ce22c25b7b8393a60280d1c2f0cd41e10390aede1d5b8ca3e4c7273a02853ac2be8c6fdefc60bc848
|
|
7
|
+
data.tar.gz: 6a5b41fb281ecd34217a0c9205e7446ee945cf24b0870287f012a8ed0724f887c99c301f6cea549112de61911ca7d7121f85a3ae8fe70e8cebe825c35250f452
|
|
@@ -45,7 +45,7 @@ module Baykit
|
|
|
45
45
|
def initialize(agt, anchorable)
|
|
46
46
|
super(agt)
|
|
47
47
|
@anchorable = anchorable
|
|
48
|
-
@operations =
|
|
48
|
+
@operations = {}
|
|
49
49
|
@operations_lock = Mutex.new
|
|
50
50
|
|
|
51
51
|
begin
|
|
@@ -272,19 +272,18 @@ module Baykit
|
|
|
272
272
|
def add_operation(rd, op, to_connect=false)
|
|
273
273
|
@operations_lock.synchronize do
|
|
274
274
|
found = false
|
|
275
|
-
@operations
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
end
|
|
275
|
+
ch_op = @operations[rd]
|
|
276
|
+
if ch_op != nil
|
|
277
|
+
ch_op.op |= op
|
|
278
|
+
ch_op.to_connect = (ch_op.to_connect or to_connect)
|
|
279
|
+
found = true
|
|
280
|
+
#BayLog.debug("%s Update operation: %d con=%s rd=%s",
|
|
281
|
+
# @agent, self.class.op_mode(ch_op.op), ch_op.to_connect, rd)
|
|
283
282
|
end
|
|
284
283
|
|
|
285
284
|
if not found
|
|
286
|
-
BayLog.
|
|
287
|
-
@operations
|
|
285
|
+
#BayLog.debug("%s New operation: %d con=%s close=%s rd=%s", @agent, op, to_connect, rd)
|
|
286
|
+
@operations[rd] =ChannelOperation.new(rd, op, to_connect)
|
|
288
287
|
end
|
|
289
288
|
end
|
|
290
289
|
|
|
@@ -298,16 +297,16 @@ module Baykit
|
|
|
298
297
|
|
|
299
298
|
@operations_lock.synchronize do
|
|
300
299
|
nch = @operations.length
|
|
301
|
-
@operations.each do |rd_op|
|
|
302
|
-
st = get_rudder_state(
|
|
303
|
-
if
|
|
300
|
+
@operations.each do |rd, rd_op|
|
|
301
|
+
st = get_rudder_state(rd)
|
|
302
|
+
if rd.io.closed?
|
|
304
303
|
# Channel is closed before register operation
|
|
305
304
|
BayLog.debug("%s Try to register closed socket (Ignore)", @agent)
|
|
306
305
|
next
|
|
307
306
|
end
|
|
308
307
|
|
|
309
308
|
begin
|
|
310
|
-
io =
|
|
309
|
+
io = rd.io
|
|
311
310
|
BayLog.trace("%s register op=%s st=%s", @agent, self.class.op_mode(rd_op.op), st)
|
|
312
311
|
op = @selector.get_op(io)
|
|
313
312
|
if op == nil
|
|
@@ -328,7 +327,7 @@ module Baykit
|
|
|
328
327
|
end
|
|
329
328
|
|
|
330
329
|
rescue => e
|
|
331
|
-
st = get_rudder_state(
|
|
330
|
+
st = get_rudder_state(rd)
|
|
332
331
|
BayLog.error_e(e, "%s Cannot register operation: %s", self.agent, st.rudder)
|
|
333
332
|
end
|
|
334
333
|
end
|
|
@@ -208,22 +208,8 @@ module Baykit
|
|
|
208
208
|
if !tur.valid?
|
|
209
209
|
raise Sink.new("Tour is not valid")
|
|
210
210
|
end
|
|
211
|
-
keep_alive = false
|
|
212
|
-
if tur.req.headers.get_connection() == Headers::CONNECTION_KEEP_ALIVE
|
|
213
|
-
keep_alive = true
|
|
214
|
-
if keep_alive
|
|
215
|
-
res_conn = tur.res.headers.get_connection()
|
|
216
|
-
keep_alive = (res_conn == Headers::CONNECTION_KEEP_ALIVE) ||
|
|
217
|
-
(res_conn == Headers::CONNECTION_UNKNOWN)
|
|
218
|
-
end
|
|
219
|
-
if keep_alive
|
|
220
|
-
if tur.res.headers.content_length() < 0
|
|
221
|
-
keep_alive = false
|
|
222
|
-
end
|
|
223
|
-
end
|
|
224
|
-
end
|
|
225
211
|
|
|
226
|
-
tour_handler.send_end_tour(tur,
|
|
212
|
+
tour_handler.send_end_tour(tur, &callback)
|
|
227
213
|
end
|
|
228
214
|
end
|
|
229
215
|
|
|
@@ -47,7 +47,7 @@ module Baykit
|
|
|
47
47
|
now = Time.now.to_i
|
|
48
48
|
|
|
49
49
|
if file_content.loaded_time + @lifespan_seconds < Time.now.to_i
|
|
50
|
-
@total_bytes -= file_content.
|
|
50
|
+
@total_bytes -= file_content.content_length
|
|
51
51
|
BayLog.debug("Remove expired content: %s", path)
|
|
52
52
|
@contents.delete(path)
|
|
53
53
|
file_content = nil
|
|
@@ -68,9 +68,10 @@ module Baykit
|
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
def get_byte
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
check_read(1)
|
|
72
|
+
b = @packet.buf[@start + @pos]
|
|
73
|
+
@pos += 1
|
|
74
|
+
return b.codepoints[0]
|
|
74
75
|
end
|
|
75
76
|
|
|
76
77
|
def get_bytes(buf, ofs=0, len=buf.length)
|
|
@@ -18,9 +18,7 @@ module Baykit
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def IOUtil.write_int32(io, i)
|
|
21
|
-
|
|
22
|
-
#print("IOwrite->" + data.to_s)
|
|
23
|
-
io.write(data.pack("C*"))
|
|
21
|
+
io.write([i].pack("N"))
|
|
24
22
|
end
|
|
25
23
|
|
|
26
24
|
def IOUtil.get_sock_recv_buf_size(skt)
|
|
@@ -10,8 +10,8 @@ module Baykit
|
|
|
10
10
|
attr :factory
|
|
11
11
|
|
|
12
12
|
def initialize(factory=nil)
|
|
13
|
-
@free_list =
|
|
14
|
-
@active_list =
|
|
13
|
+
@free_list = {}
|
|
14
|
+
@active_list = {}
|
|
15
15
|
@factory = factory
|
|
16
16
|
end
|
|
17
17
|
|
|
@@ -34,12 +34,12 @@ module Baykit
|
|
|
34
34
|
obj = @factory.call()
|
|
35
35
|
end
|
|
36
36
|
else
|
|
37
|
-
obj = @free_list.
|
|
37
|
+
obj = @free_list.shift()[0]
|
|
38
38
|
end
|
|
39
39
|
if obj == nil
|
|
40
40
|
raise Sink.new()
|
|
41
41
|
end
|
|
42
|
-
@active_list
|
|
42
|
+
@active_list[obj] = true
|
|
43
43
|
return obj
|
|
44
44
|
end
|
|
45
45
|
|
|
@@ -54,7 +54,7 @@ module Baykit
|
|
|
54
54
|
|
|
55
55
|
@active_list.delete(obj)
|
|
56
56
|
if reuse
|
|
57
|
-
@free_list
|
|
57
|
+
@free_list[obj] = true
|
|
58
58
|
obj.reset()
|
|
59
59
|
end
|
|
60
60
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bayserver-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.3.
|
|
4
|
+
version: 3.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michisuke-P
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: BayServer is one of the high-speed web servers. It operates as a single-threaded,
|
|
14
14
|
asynchronous server, which makes it exceptionally fast. It also supports multi-core
|