End the connection when reading a wrong message length.
This commit is contained in:
parent
5807ea51bd
commit
9d4f5b3cab
@ -451,8 +451,15 @@ pub const Context = struct {
|
||||
try self.close(i);
|
||||
return Event.init(Event.Type.DISCONNECTION, i, fd.fd, null);
|
||||
},
|
||||
error.wrongMessageLength => {
|
||||
log.warn("wrong message length, terminating the connection", .{});
|
||||
try self.close(i);
|
||||
return Event.init(Event.Type.DISCONNECTION, i, fd.fd, null);
|
||||
},
|
||||
else => {
|
||||
return err;
|
||||
log.warn("unmanaged error while reading a message ({})", .{err});
|
||||
try self.close(i);
|
||||
return Event.init(Event.Type.ERROR, i, fd.fd, null);
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user