A lot of updates
This commit is contained in:
@@ -136,7 +136,13 @@ void LicenseServer::handleEventWrite(int fd, short, void* ptrServer) {
|
||||
if(!buffer) return;
|
||||
|
||||
auto writtenBytes = send(fd, &buffer->buffer[buffer->index], buffer->length - buffer->index, 0);
|
||||
buffer->index += writtenBytes;
|
||||
if(writtenBytes <= 0) {
|
||||
if(writtenBytes == -1 && errno == EAGAIN)
|
||||
return;
|
||||
logError(LOG_LICENSE_CONTROLL, "Invalid write. Disconnecting remote client. Message: {}/{}", errno, strerror(errno));
|
||||
} else {
|
||||
buffer->index += writtenBytes;
|
||||
}
|
||||
|
||||
if(buffer->index >= buffer->length) {
|
||||
TAILQ_REMOVE(&client->network.writeQueue, buffer, tail);
|
||||
@@ -202,7 +208,7 @@ void LicenseServer::handleEventRead(int fd, short, void* ptrServer) {
|
||||
|
||||
if(read < 0){
|
||||
if(errno == EWOULDBLOCK) return;
|
||||
logError(LOG_LICENSE_CONTROLL, "Invalid read. Disconnecting remote manager. Message: {}/{}", errno, strerror(errno));
|
||||
logError(LOG_LICENSE_CONTROLL, "Invalid read. Disconnecting remote client. Message: {}/{}", errno, strerror(errno));
|
||||
event_del_noblock(client->network.readEvent);
|
||||
server->closeConnection(client);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user