mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-23 13:57:52 +00:00
fix log disconnected
This commit is contained in:
parent
1cabe202e7
commit
c76c2db2be
1 changed files with 7 additions and 4 deletions
|
@ -38,7 +38,13 @@ class Server
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if !msg['action'].nil? && msg['action'] == 'close'
|
||||||
|
@log.info("#{client.peeraddr[3]} is disconnected")
|
||||||
|
close_connection(client)
|
||||||
|
end
|
||||||
|
|
||||||
if msg['gpg_key'].nil? || msg['gpg_key'].empty? || msg['password'].nil? || msg['password'].empty?
|
if msg['gpg_key'].nil? || msg['gpg_key'].empty? || msg['password'].nil? || msg['password'].empty?
|
||||||
|
@log.warning("#{client.peeraddr[3]} is disconnected because no password or no gpg_key")
|
||||||
close_connection(client)
|
close_connection(client)
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
@ -53,11 +59,8 @@ class Server
|
||||||
when 'delete'
|
when 'delete'
|
||||||
@log.debug("#{client.peeraddr[3]} DELETE gpg_key=#{msg['gpg_key']} suffix=#{msg['suffix']}")
|
@log.debug("#{client.peeraddr[3]} DELETE gpg_key=#{msg['gpg_key']} suffix=#{msg['suffix']}")
|
||||||
client.puts delete_file(msg)
|
client.puts delete_file(msg)
|
||||||
when 'close'
|
|
||||||
@log.info("#{client.peeraddr[3]} is disconnected")
|
|
||||||
close_connection(client)
|
|
||||||
else
|
else
|
||||||
@log.warning("#{client.peeraddr[3]} is disconnected for unkwnow command")
|
@log.warning("#{client.peeraddr[3]} is disconnected because unkwnow command")
|
||||||
send_msg = {:action => 'unknown',
|
send_msg = {:action => 'unknown',
|
||||||
:gpg_key => msg['gpg_key'],
|
:gpg_key => msg['gpg_key'],
|
||||||
:error => 'server.error.client.unknown'}
|
:error => 'server.error.client.unknown'}
|
||||||
|
|
Loading…
Reference in a new issue