sid0-problem
This commit is contained in:
parent
53bf167fd1
commit
3f267e2ca2
|
@ -9,7 +9,7 @@ require 'logan/cache'
|
||||||
|
|
||||||
module LogAn::Inc
|
module LogAn::Inc
|
||||||
class Main < RobustServer
|
class Main < RobustServer
|
||||||
def cache db, type, &e
|
def cache ret, type, &e
|
||||||
type ||= 1+4
|
type ||= 1+4
|
||||||
ret = LogAn::AutoValueConvertHash.new ret, &e if type&4 > 0 or e
|
ret = LogAn::AutoValueConvertHash.new ret, &e if type&4 > 0 or e
|
||||||
ret = LogAn::Cache.new ret, type&3 if type&3 > 0
|
ret = LogAn::Cache.new ret, type&3 if type&3 > 0
|
||||||
|
|
|
@ -92,12 +92,13 @@ class LogAn::Inc::Server < ::Select::Server
|
||||||
|
|
||||||
def init opts
|
def init opts
|
||||||
super opts
|
super opts
|
||||||
|
@sid0 = LogAn::Inc::SID0.new
|
||||||
@config = opts[:config] or raise( ArgumentError, "#{self.class} needs a Config!")
|
@config = opts[:config] or raise( ArgumentError, "#{self.class} needs a Config!")
|
||||||
end
|
end
|
||||||
|
|
||||||
def event_cmd cmd
|
def event_cmd cmd
|
||||||
sid, line = cmd.unpack 'Na*'
|
sid, line = cmd.unpack 'Na*'
|
||||||
fps = @config[:fileparser][sid]
|
fp = sid == 0 ? @sid0 : @config[:fileparser][sid]
|
||||||
fp.event_line line, self if fp
|
fp.event_line line, self if fp
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue