dango 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dango/server_framework.rb +30 -11
- data/lib/dango/version.rb +1 -1
- metadata +2 -2
@@ -101,7 +101,7 @@ class DangoServerFramework
|
|
101
101
|
begin
|
102
102
|
File.delete("tmp/pids/dango.pid")
|
103
103
|
rescue
|
104
|
-
puts "failed delete file. tmp/pids/dango.pid:#{$!.class}:#{$!.message}"
|
104
|
+
# puts "failed delete file. tmp/pids/dango.pid:#{$!.class}:#{$!.message}"
|
105
105
|
end
|
106
106
|
puts "shutdown"
|
107
107
|
exit!
|
@@ -318,20 +318,34 @@ class DangoServerFramework
|
|
318
318
|
is_flash_policy_file = true
|
319
319
|
end
|
320
320
|
|
321
|
-
if is_flash_policy_file
|
322
|
-
logger.info "is_flash_policy_file
|
323
|
-
|
321
|
+
if is_flash_policy_file # Flashのポリシーファイルが来たら
|
322
|
+
logger.info "is_flash_policy_file"
|
323
|
+
|
324
|
+
if @policy_file_request # ポリシーファイルを返す設定なら
|
325
|
+
logger.info "is_flash_policy_file #{sid} #{@policy_file_request}"
|
326
|
+
|
327
|
+
allow_str = ""
|
328
|
+
@policy_file_allow_domain.each do |one_host|
|
329
|
+
allow_str += %Q|<allow-access-from domain="#{one_host}" to-ports="#{@network_port}" />|
|
330
|
+
allow_str += "\n"
|
331
|
+
end
|
332
|
+
|
333
|
+
policy_data = <<EOF
|
324
334
|
<?xml version="1.0"?>
|
325
335
|
<cross-domain-policy>
|
326
|
-
|
336
|
+
#{allow_str}
|
327
337
|
</cross-domain-policy>
|
328
338
|
EOF
|
329
339
|
|
330
|
-
|
331
|
-
|
332
|
-
|
340
|
+
logger.debug policy_data
|
341
|
+
sock.write policy_data
|
342
|
+
sock.flush
|
343
|
+
logger.info "policy file sent."
|
344
|
+
end
|
345
|
+
|
346
|
+
# この部分はポリシーファイルを返す設定に関係なく実行する部分
|
333
347
|
sleep 0.1
|
334
|
-
raise(DangoFrameworkFlashPolicyError, "policy file
|
348
|
+
raise(DangoFrameworkFlashPolicyError, "requested policy file. disconnectiong...")
|
335
349
|
|
336
350
|
elsif ret_objs == [] # 受信データがなければ
|
337
351
|
# logger.debug "ret_objs is empty. "
|
@@ -394,7 +408,7 @@ EOF
|
|
394
408
|
end # loop
|
395
409
|
|
396
410
|
rescue DangoFrameworkFlashPolicyError
|
397
|
-
logger.info "Flash policy file
|
411
|
+
logger.info "Flash policy file #{sid} "
|
398
412
|
|
399
413
|
rescue DangoFrameworkMonitorSecurityError
|
400
414
|
logger.warn "Monitor Security Error #{sid} "
|
@@ -466,7 +480,6 @@ EOF
|
|
466
480
|
@log_shift_age = @config['server']['log_shift_age'] || DefaultLogShiftAge
|
467
481
|
@gserver_log_file = @config['server']['gserver_log_file'] || DefaultGServerLogFile
|
468
482
|
|
469
|
-
@policy_file_request = @config['server']['policy_file_request'] || true
|
470
483
|
@send_receive_sleep_interval_sec = @config['server']['send_receive_sleep_interval_sec'] || SendReceiveSleepIntervalSec
|
471
484
|
@send_receive_timeout_default_sec = @config['server']['send_receive_timeout_default_sec'] || SendReceiveTimeoutDefaultSec
|
472
485
|
# @send_timeout_sec = @config['server']['send_timeout_sec'] || SendTimeoutSec
|
@@ -475,6 +488,12 @@ EOF
|
|
475
488
|
@heart_beat_receive_wait_sec = @config['server']['heart_beat_receive_wait_sec'] || HeartBeatReceiveWaitSec
|
476
489
|
@gc_interval_sec = @config['server']['gc_interval_sec'] || GCIntervalSec
|
477
490
|
|
491
|
+
@policy_file_request = @config['server']['policy_file_request']
|
492
|
+
@policy_file_request = true if @policy_file_request == nil
|
493
|
+
|
494
|
+
@policy_file_allow_domain = @config['server']['policy_file_allow_domain']
|
495
|
+
@policy_file_allow_domain = [@network_host] if @policy_file_allow_domain.class != Array
|
496
|
+
|
478
497
|
# ログレベルの設定
|
479
498
|
log_level_hash = {
|
480
499
|
"FATAL" => Logger::FATAL,
|
data/lib/dango/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dango
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keisuke Minami
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-05-01 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|