lib/pmux-gw/http_handler.rb in pmux-gw-0.1.6 vs lib/pmux-gw/http_handler.rb in pmux-gw-0.1.7
- old
+ new
@@ -72,11 +72,11 @@
if !@cc.nil?
@@task_cnt -= 1
@cc.end_datetime = DateTime.now().new_offset(Rational(9, 24))
# pmuxが終わっていないのにクライアントとの接続が切れたらpmuxを終了する
if !@cc.pmux_terminated
- @cc.pmux_handler.close_connection()
+ @cc.pmux_handler.close_connection() if !@cc.pmux_handler.nil?
@cc.force_pmux_terminated = true
@cc.status = "disconnected"
else
@cc.status = "done"
end
@@ -272,21 +272,21 @@
:content_type => "text/plain",
:content => err})
return
end
@cc = ClientContext.new(self, @response, mapper, cmd, is_detect_error())
- @cc.set_pmux_handler(EMPessimistic.popen3(cmd, PmuxHandler, @cc))
- @@task_cnt += 1
#ステータス情報を保存しておく
- @cc.pid = @cc.pmux_handler.get_status.pid
+ @@task_cnt += 1
@cc.status = "runnning"
@cc.start_datetime = DateTime.now().new_offset(Rational(9, 24))
@cc.peername = "#{@peer_ip} - #{@peer_port}"
@cc.user = @auth_user
+ @cc.set_pmux_handler(EMPessimistic.popen3(cmd, PmuxHandler, @cc))
+ @cc.pid = @cc.pmux_handler.get_status.pid
#ヒストリー情報を更新する
@history.save(@cc)
end
-
+
def resource_existence
# リソース/existenceが呼ばれた際の処理
success_response({:status => 204,
:content_type => "text/html",
:content => ""})