diff options
Diffstat (limited to 'src/core.c')
-rw-r--r-- | src/core.c | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -48,10 +48,12 @@ static void tip_client_release(struct ev_loop *loop, struct tip_client *cli) free((void *)cli->uri); free((void *)cli->path); - num_clients--; - if (tip_client_large_file(cli)) - tip_client_activate_pending(); + if (cli->method == TIP_METHOD_GET) { + num_clients--; + if (tip_client_large_file(cli)) + tip_client_activate_pending(); + } free(cli); } @@ -161,11 +163,15 @@ static void tip_client_read_cb(struct ev_loop *loop, struct ev_io *io, int event ntohs(cli->addr.sin_port)); goto close; } - - syslog(LOG_INFO, "client %s:%hu starts download for %s\n", - inet_ntoa(cli->addr.sin_addr), - ntohs(cli->addr.sin_port), cli->uri); - + if (cli->method == TIP_METHOD_GET) { + syslog(LOG_INFO, "client %s:%hu starts download for %s\n", + inet_ntoa(cli->addr.sin_addr), + ntohs(cli->addr.sin_port), cli->uri); + } else { + syslog(LOG_INFO, "client %s:%hu checks if %s exists\n", + inet_ntoa(cli->addr.sin_addr), + ntohs(cli->addr.sin_port), cli->uri); + } ev_io_stop(loop, &cli->io); ev_io_set(&cli->io, tip_client_socket(cli), EV_READ | EV_WRITE); ev_io_start(loop, &cli->io); |