2 Commits

Author SHA1 Message Date
581b4dc5aa Fix flines() 2023-01-11 15:07:01 +01:00
611ceabfb2 Small fixes in tcp_acceptor 2023-01-11 14:49:06 +01:00
2 changed files with 3 additions and 2 deletions

View File

@@ -325,7 +325,7 @@ long flines(FILE *file) {
if (fseek(file, cur_pos, SEEK_SET) != 0)
return -1;
return lines;
return lines + 1;
}
long file_get_line_pos(FILE *file, long line_num) {

View File

@@ -105,7 +105,7 @@ static int tcp_acceptor(client_ctx_t *ctx) {
if (ret != 1) {
error_ssl(SSL_get_error(client->ssl, ret));
info("Unable to perform handshake");
return - 1;
return -1;
}
client->ts_last = clock_micros();
}
@@ -118,6 +118,7 @@ static int tcp_acceptor(client_ctx_t *ctx) {
}
void tcp_close(client_ctx_t *ctx) {
errno = 0;
logger_set_prefix("[%*s]%s", INET6_ADDRSTRLEN, ctx->socket.s_addr, ctx->log_prefix);
sock_close(&ctx->socket);