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
@@ -57,6 +57,7 @@ char *tdb_query(int socket_fd, const char *db_name, char request_code, const cha
buffer += nwrite;
req_size -= nwrite;
if (req_size == 0) {
nwrite = write(socket_fd, "\4", 1);
break;
}
}
@@ -75,7 +76,7 @@ char *tdb_query(int socket_fd, const char *db_name, char request_code, const cha
}
memcpy(response + offset, buffer, nread);
offset += nread;
if (response[offset - 1] == 0) {
if (response[offset - 1] == EOT) {
break;
}
}