dango 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 && @policy_file_request # Flashのポリシーファイルが来たら
322
- logger.info "is_flash_policy_file #{sid} "
323
- policy_data = <<EOF
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
- <allow-access-from domain="#{@network_host}" to-ports="#{@network_port}" />
336
+ #{allow_str}
327
337
  </cross-domain-policy>
328
338
  EOF
329
339
 
330
- logger.debug policy_data
331
- sock.write policy_data
332
- sock.flush
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 sent. disconnectiong...")
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 send. #{sid} "
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
@@ -2,7 +2,7 @@ module Dango #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 2
5
+ TINY = 3
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
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.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-03-26 00:00:00 +09:00
12
+ date: 2008-05-01 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency