dango 0.0.19 → 0.0.20
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.
- data/README.txt +2 -1
- data/lib/dango/framework_base.rb +16 -11
- data/lib/dango/server_framework.rb +5 -3
- data/lib/dango/version.rb +1 -1
- metadata +4 -4
data/README.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= dango -- Ruby
|
1
|
+
= dango -- Realtime communications network framework for Ruby and Flash on Rails.
|
2
2
|
|
3
3
|
|
4
4
|
== Download
|
@@ -26,6 +26,7 @@ Download and install dango with the following.
|
|
26
26
|
== dango References
|
27
27
|
|
28
28
|
* dango Project Page: http://rubyforge.org/projects/dango
|
29
|
+
* dango Download Page: http://rubyforge.org/projects/dango
|
29
30
|
* dango API Documents: http://dango.rubyforge.org
|
30
31
|
|
31
32
|
== Simple Example
|
data/lib/dango/framework_base.rb
CHANGED
@@ -147,20 +147,25 @@ module DangoFrameworkModule
|
|
147
147
|
|
148
148
|
raise(DangoFrameworkReadNoDataError, "sid=#{Thread.current.object_id}:size_str=#{size_str.inspect}") if size_str == ""
|
149
149
|
|
150
|
+
## Flash のpolicyファイルだった場合(特殊)
|
151
|
+
if size_str == "<polic"
|
152
|
+
cs_logger.debug "size_str=#{size_str.inspect}"
|
153
|
+
receive_data = sock.recv(18)
|
154
|
+
cs_logger.debug "receive_data=#{receive_data}"
|
155
|
+
raise(DangoFrameworkFlashPolicyError)
|
156
|
+
end
|
157
|
+
|
158
|
+
## サイズとデータタイプを取得
|
150
159
|
dtype, size = size_str[0, 5].unpack("cN")
|
151
160
|
|
152
|
-
|
161
|
+
## データが小さすぎる場合
|
162
|
+
if size == nil || size == 0
|
163
|
+
raise(DangoFrameworkConnectionError, "sid=#{Thread.current.object_id}:size=#{size}:size_str=#{size_str.inspect}")
|
164
|
+
end
|
153
165
|
|
154
|
-
##
|
155
|
-
if size
|
156
|
-
|
157
|
-
receive_data = sock.recv(20)
|
158
|
-
cs_logger.debug "receive_data=#{receive_data}"
|
159
|
-
if size_str + receive_data =~ /^\<policy\-file\-request/ # <policy-file-request/>なら
|
160
|
-
raise(DangoFrameworkFlashPolicyError)
|
161
|
-
else # そうじゃなきゃ普通のエラー
|
162
|
-
raise(DangoFrameworkConnectionError, "too big... size=#{size}:size_str=#{size_str.inspect}")
|
163
|
-
end
|
166
|
+
## データが大きすぎる場合
|
167
|
+
if size >= 1886350441
|
168
|
+
raise(DangoFrameworkConnectionError, "too big... size=#{size}:size_str=#{size_str.inspect}")
|
164
169
|
end
|
165
170
|
|
166
171
|
# cs_logger.debug "size=#{size}:size_str=#{size_str.inspect}"
|
@@ -219,10 +219,12 @@ class DangoServerFramework
|
|
219
219
|
end
|
220
220
|
|
221
221
|
if is_flash_policy_file && @policy_file_request # Flashのポリシーファイルが来たら
|
222
|
-
cs_logger.debug "is_flash_policy_file"
|
223
|
-
policy_data = '
|
224
|
-
|
222
|
+
cs_logger.debug "is_flash_policy_file #{sid} #{Time.now_to_s}"
|
223
|
+
policy_data = '<?xml version="1.0"?><cross-domain-policy><allow-access-from domain="*" to-ports="*" /></cross-domain-policy>' + "\0" + "\n"
|
224
|
+
cs_logger.debug policy_data
|
225
|
+
sock.write policy_data
|
225
226
|
sock.flush
|
227
|
+
sleep 1
|
226
228
|
raise(DangoFrameworkFlashPolicyError, "policy file sent. disconnectiong...")
|
227
229
|
|
228
230
|
elsif ret_obj == {} # 受信データがなければ
|
data/lib/dango/version.rb
CHANGED
metadata
CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: dango
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2007-10-
|
8
|
-
summary: Ruby
|
6
|
+
version: 0.0.20
|
7
|
+
date: 2007-10-25 00:00:00 +09:00
|
8
|
+
summary: Realtime communications network framework for Ruby and Flash on Rails.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email: keisuke@rccn.com
|
12
12
|
homepage: http://dango.rubyforge.org
|
13
13
|
rubyforge_project: dango
|
14
|
-
description: Ruby
|
14
|
+
description: Realtime communications network framework for Ruby and Flash on Rails.
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|