summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortiptorrent development team <tiptorrent@soleta.eu>2021-09-14 14:37:19 +0200
committertiptorrent development team <tiptorrent@soleta.eu>2021-09-29 15:48:28 +0200
commit94c45d5d36ddb236c0d988ff6d8b2e2d9b23c466 (patch)
treed87146615b2017ab5cc53e421ca0fd94bde3782a
parenta23722910e703e7464ebc6b0447c719937e2850e (diff)
improve logging
Report "client %s:%hu starts download for %s" when the file transfer really starts. Replace log when redirection after pending state is not available
-rw-r--r--src/core.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/core.c b/src/core.c
index fa1bf73..6c04891 100644
--- a/src/core.c
+++ b/src/core.c
@@ -165,15 +165,6 @@ static void tip_client_read_cb(struct ev_loop *loop, struct ev_io *io, int event
ntohs(cli->addr.sin_port));
goto close;
}
- 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);
@@ -279,6 +270,15 @@ static void tip_client_write_cb(struct ev_loop *loop, struct ev_io *io, int even
ntohs(cli->addr.sin_port));
goto close;
}
+ 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);
+ }
break;
case TIP_CLIENT_PROCESSING_REQUEST_3:
ret = tip_client_state_process_payload_bulk(cli);
@@ -352,8 +352,8 @@ static void tip_client_activate_pending(void)
continue;
if (!tip_client_redirect(cli)) {
- syslog(LOG_INFO, "sending %s to client %s:%hu",
- cli->uri, inet_ntoa(cli->addr.sin_addr),
+ syslog(LOG_INFO, "no client redirections are available for client %s:%hu after resuming from pending state",
+ inet_ntoa(cli->addr.sin_addr),
htons(cli->addr.sin_port));
}
ev_io_set(&cli->io, tip_client_socket(cli), EV_READ | EV_WRITE);