bayserver-core 2.2.0 → 2.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9553fc51408c4fdcf0cfdab84dedbfe4787dfb635c6d80fb35f8ed8931d45e94
4
- data.tar.gz: 1621adc0afcd182c88d92334c5492573c7832a1d4fdd32ad446e69715546a534
3
+ metadata.gz: 3384e309df7bc1a51935394fa90199ec3037f2a40978a6612e5c4a8ae826cdbf
4
+ data.tar.gz: 0dd2baf7f2cf5878eda0fcace793d50f3dce873962c983e3d49fe899542cf158
5
5
  SHA512:
6
- metadata.gz: 9e2f3c03c747fa755ac913a8036afd5269310f1933ff10331d533b778fcf06f0e68003e79bba992d02cb3595264433901bdc9779b4845d4c883832811eb0a208
7
- data.tar.gz: a43916c531db4c6c7a473de166c91079386b6e6ac88071db6eaf2a23cb7637351c97ea7a8cbf8ea96390244775859246faf3cc357bdc4164589b223e18419af7
6
+ metadata.gz: 3a84b96eba136c9bf08ec77ced8300289967bbe4a55d0aa9bdf66a4ceaad72dc0e27409878b92faf9f594ea11ed48dcff58fbc669b38daad37ef163c6d7b7bae
7
+ data.tar.gz: 64f1d19b52431b7f0986be35723231ea56ed17941314ce44ecab9d4a26296dc89e60f7a179f1eb71a4e5e3719de7d6630ac38a01f97a63ec20b2655707fba5f2
data/LICENSE.BAYKIT ADDED
@@ -0,0 +1,53 @@
1
+ /*
2
+ * The Baykit Public License, Version 1.1
3
+ *
4
+ * Copyright (c) 2000 The Yokohama Baykit. All rights reserved.
5
+ *
6
+ * This license is based on the Apache Software License 1.1
7
+ * (http://xml.apache.org/LICENSE)
8
+ *
9
+ * Redistribution and use in source and binary forms, with or without
10
+ * modification, are permitted provided that the following conditions
11
+ * are met:
12
+ *
13
+ * 1. Redistributions of source code must retain the above copyright
14
+ * notice, this list of conditions and the following disclaimer.
15
+ *
16
+ * 2. Redistributions in binary form must reproduce the above copyright
17
+ * notice, this list of conditions and the following disclaimer in
18
+ * the documentation and/or other materials provided with the
19
+ * distribution.
20
+ *
21
+ * 3. The end-user documentation included with the redistribution,
22
+ * if any, must include the following acknowledgment:
23
+ * "This product includes software developed by the
24
+ * Yokohama Baykit (http://www.baykit.org/)."
25
+ * Alternately, this acknowledgment may appear in the software itself,
26
+ * if and wherever such third-party acknowledgments normally appear.
27
+ *
28
+ * 4. The name "Baykit" must
29
+ * not be used to endorse or promote products derived from this
30
+ * software without prior written permission. For written
31
+ * permission, please contact xml@baykit.org.
32
+ *
33
+ * 5. Products derived from this software may not be called "Baykit",
34
+ * nor may "Baykit" appear in their name, without prior written
35
+ * permission of the Yokohama Baykit.
36
+ *
37
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
38
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
39
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40
+ * DISCLAIMED. IN NO EVENT SHALL THE BAYKIT OR
41
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
43
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
44
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
45
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
47
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48
+ * SUCH DAMAGE.
49
+ * ====================================================================
50
+ *
51
+ * For more information on the Yokohama Baykit, please see
52
+ * <http://www.baykit.org/>.
53
+ */
data/README.md ADDED
@@ -0,0 +1,3 @@
1
+ BayServer is one of the high-speed web servers. It operates as a single-threaded, asynchronous server, which makes it exceptionally fast. It also supports multi-core processors, harnessing the full potential of the CPU's capabilities.
2
+
3
+ https://baykit.yokohama
@@ -344,6 +344,13 @@ module Baykit
344
344
  ch_state.access
345
345
  end
346
346
 
347
+ def close_all()
348
+ @ch_map.keys().each do |ch|
349
+ st = find_channel_state(ch)
350
+ close_channel(ch, st)
351
+ end
352
+ end
353
+
347
354
 
348
355
  private
349
356
 
@@ -10,6 +10,7 @@ module Baykit
10
10
 
11
11
  include Baykit::BayServer::Agent
12
12
  include Baykit::BayServer::Tours
13
+ include Baykit::BayServer::WaterCraft
13
14
  include Baykit::BayServer::Util
14
15
 
15
16
  # class variables
@@ -165,7 +166,7 @@ module Baykit
165
166
  if tur.zombie? || tur.aborted?
166
167
  # Don't send peer any data
167
168
  BayLog::debug("%s Aborted or zombie tour. do nothing: %s state=%s", self, tur, tur.state)
168
- tur.change_state(check_id, TourState::ENDED)
169
+ tur.change_state(Tour::TOUR_ID_NOCHECK, TourState::ENDED)
169
170
  if callback != nil
170
171
  callback.call()
171
172
  end
@@ -174,8 +175,8 @@ module Baykit
174
175
 
175
176
  max_len = @protocol_handler.max_res_packet_data_size();
176
177
  if len > max_len
177
- send_res_content(Tour::TOUR_ID_NOCHECK, tur, bytes, ofs, max_len)
178
- send_res_content(Tour::TOUR_ID_NOCHECK, tur, bytes, ofs + max_len, len - max_len, &callback)
178
+ send_res_content(Ship::SHIP_ID_NOCHECK, tur, bytes, ofs, max_len)
179
+ send_res_content(Ship::SHIP_ID_NOCHECK, tur, bytes, ofs + max_len, len - max_len, &callback)
179
180
  else
180
181
  begin
181
182
  @protocol_handler.send_res_content(tur, bytes, ofs, len, &callback)
@@ -187,7 +188,7 @@ module Baykit
187
188
  end
188
189
  end
189
190
 
190
- def send_end_tour(chk_ship_id, chk_tour_id, tur, &callback)
191
+ def send_end_tour(chk_ship_id, tur, &callback)
191
192
  @lock.synchronize do
192
193
  check_ship_id(chk_ship_id)
193
194
  BayLog.debug("%s sendEndTour: %s state=%s", self, tur, tur.state)
@@ -195,7 +196,7 @@ module Baykit
195
196
  if tur.zombie? || tur.aborted?
196
197
  # Don't send peer any data. Do nothing
197
198
  BayLog.debug("%s Aborted or zombie tour. do nothing: %s state=%s", self, tur, tur.state)
198
- tur.change_state(chk_tour_id, Tour::TourState::ENDED)
199
+ tur.change_state(Tour::TOUR_ID_NOCHECK, Tour::TourState::ENDED)
199
200
  callback.call()
200
201
  else
201
202
  if !tur.valid?
@@ -216,7 +217,7 @@ module Baykit
216
217
  end
217
218
  end
218
219
 
219
- tur.change_state(chk_tour_id, Tour::TourState::ENDED)
220
+ tur.change_state(Tour::TOUR_ID_NOCHECK, Tour::TourState::ENDED)
220
221
 
221
222
  @protocol_handler.send_end_tour(tur, keep_alive, &callback)
222
223
  end
@@ -83,8 +83,13 @@ module Baykit
83
83
 
84
84
  def end_warp_tour(tur)
85
85
  wdat = WarpData.get(tur)
86
- BayLog.debug("%s end: started=%s ended=%s", tur, wdat.started, wdat.ended)
87
- @tour_map.delete wdat.warp_id
86
+ BayLog.debug("%s end warp tour: started=%s ended=%s", tur, wdat.started, wdat.ended)
87
+
88
+ if(!@tour_map.include?(wdat.warp_id))
89
+ raise Sink.new("%s WarpId not in tourMap: %d", tur, wdat.warp_id);
90
+ else
91
+ @tour_map.delete wdat.warp_id
92
+ end
88
93
  @docker.keep_ship(self)
89
94
  end
90
95
 
@@ -225,7 +225,7 @@ module Baykit
225
225
  end
226
226
 
227
227
  begin
228
- @tour.ship.send_end_tour(@tour.ship_id, chk_tour_id, @tour, &done_lis)
228
+ @tour.ship.send_end_tour(@tour.ship_id, @tour, &done_lis)
229
229
  rescue IOError => e
230
230
  done_lis.call()
231
231
  raise e
@@ -65,6 +65,7 @@ module Baykit
65
65
  tur = @free_tours.delete_at(@free_tours.length - 1)
66
66
  else
67
67
  if !force && (@active_tour_map.length >= TourStore.max_count)
68
+ BayLog.warn("Max tour count reached")
68
69
  return nil
69
70
  else
70
71
  tur = Tour.new()
@@ -1,7 +1,7 @@
1
1
  module Baykit
2
2
  module BayServer
3
3
  class Version
4
- VERSION='2.2.0'
4
+ VERSION='2.2.2'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,21 +1,25 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bayserver-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.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: 2023-08-29 00:00:00.000000000 Z
11
+ date: 2023-09-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: BayServer core module
13
+ description: BayServer is one of the high-speed web servers. It operates as a single-threaded,
14
+ asynchronous server, which makes it exceptionally fast. It also supports multi-core
15
+ processors, harnessing the full potential of the CPU's capabilities.
14
16
  email: michisukep@gmail.com
15
17
  executables: []
16
18
  extensions: []
17
19
  extra_rdoc_files: []
18
20
  files:
21
+ - LICENSE.BAYKIT
22
+ - README.md
19
23
  - lib/baykit/bayserver/agent/accept_handler.rb
20
24
  - lib/baykit/bayserver/agent/channel_listener.rb
21
25
  - lib/baykit/bayserver/agent/command_receiver.rb