fix(dbms): put EOT char in the end of request/response

This commit is contained in:
2023-01-26 17:29:01 +03:00
parent 23aae2c3b1
commit 58868ff681
3 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -836,7 +836,7 @@ void *client_thread(void *arg) {
}
memcpy(request + offset, buffer, nread);
offset += nread;
if (request[offset - 1] == 0) {
if (request[offset - 1] == EOT) {
break;
}
}
@@ -860,6 +860,7 @@ void *client_thread(void *arg) {
buf += nwrite;
resp_size -= nwrite;
if (resp_size == 0) {
nwrite = write(client_fd, "\4", 1);
break;
}
}