Obsolete
/
ipcd
Archived
3
0
Fork 0

websocketd: replace warnings with debug (for example: ping/pong messages)

master
Karchnu 2020-08-31 05:04:00 +02:00
parent fca1b29a47
commit 4ae93338a5
1 changed files with 6 additions and 6 deletions

View File

@ -306,7 +306,7 @@ def websocket_switching_procedure (activefd : Int)
still_something_to_read = ! wsclient.ws.io.empty? still_something_to_read = ! wsclient.ws.io.empty?
if wsclient.closed? if wsclient.closed?
Baguette::Log.error "client #{activefd} is closed" Baguette::Log.error "client #{activefd} is closing"
Context.context.remove_fd activefd Context.context.remove_fd activefd
return return
end end
@ -323,21 +323,21 @@ def websocket_switching_procedure (activefd : Int)
Context.context.remove_fd activefd Context.context.remove_fd activefd
return return
when WebSocket::Ping when WebSocket::Ping
Baguette::Log.warning "Received a ping message" Baguette::Log.debug "Received a ping message"
if still_something_to_read if still_something_to_read
Baguette::Log.info "Still something to read" Baguette::Log.info "Still something to read"
next next
end end
break break
when WebSocket::Pong when WebSocket::Pong
Baguette::Log.warning "Received a pong message" Baguette::Log.debug "Received a pong message"
if still_something_to_read if still_something_to_read
Baguette::Log.info "Still something to read" Baguette::Log.info "Still something to read"
next next
end end
break break
when WebSocket::Close when WebSocket::Close
Baguette::Log.warning "Received a close message" Baguette::Log.debug "Received a close message"
Context.context.remove_fd activefd Context.context.remove_fd activefd
if still_something_to_read if still_something_to_read
Baguette::Log.info "Still something to read" Baguette::Log.info "Still something to read"
@ -345,7 +345,7 @@ def websocket_switching_procedure (activefd : Int)
end end
return return
when WebSocket::NotFinal when WebSocket::NotFinal
Baguette::Log.warning "Received only part of a message" Baguette::Log.warning "Received only part of a message (not supported)"
if still_something_to_read if still_something_to_read
Baguette::Log.info "Still something to read" Baguette::Log.info "Still something to read"
next next
@ -354,7 +354,7 @@ def websocket_switching_procedure (activefd : Int)
when Bytes when Bytes
# TODO: when receiving a binary message # TODO: when receiving a binary message
# we should test the format and maybe its content # we should test the format and maybe its content
Baguette::Log.warning "Received a binary message" Baguette::Log.warning "Received a binary message (not supported)"
if still_something_to_read if still_something_to_read
Baguette::Log.info "Still something to read" Baguette::Log.info "Still something to read"
next next