mirror of https://github.com/fail2ban/fail2ban
BF: asyncserver now ensures all data is sent
Previously was using `send` method, which uses `socket.send`. This does not guarantee to send all data, and no check was in place to verify whether all data was sent. Using asynchat built in `push` method, ensures that all data is sent before closing the connection.pull/532/head
parent
33df269d82
commit
4d128db64a
|
@ -65,7 +65,7 @@ class RequestHandler(asynchat.async_chat):
|
|||
# Serializes the response.
|
||||
message = dumps(message, HIGHEST_PROTOCOL)
|
||||
# Sends the response to the client.
|
||||
self.send(message + RequestHandler.END_STRING)
|
||||
self.push(message + RequestHandler.END_STRING)
|
||||
# Closes the channel.
|
||||
self.close_when_done()
|
||||
|
||||
|
|
Loading…
Reference in New Issue