From 85ff3e5d57fe8d982ef2442788b1507e81611c09 Mon Sep 17 00:00:00 2001 From: tiptorrent development team Date: Thu, 23 Dec 2021 18:20:32 +0100 Subject: rename TIP_CLIENT_RECEIVING_* states to TIP_CLIENT_GET_* --- src/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index ed3b032..d4d1dea 100644 --- a/src/main.c +++ b/src/main.c @@ -40,8 +40,8 @@ static const char *addr; struct ev_loop *tip_main_loop; enum { - TIP_CLIENT_RECEIVING_HEADER, - TIP_CLIENT_RECEIVING_PAYLOAD, + TIP_CLIENT_GET_HEADER, + TIP_CLIENT_GET_PAYLOAD, TIP_CLIENT_NOTIFY_REDIRECT, TIP_CLIENT_DONE, }; @@ -160,7 +160,7 @@ static int tip_client_state_recv_hdr(struct tip_client *cli) cli->redirected = true; tip_client_close(cli); tip_client_connect(redirect_addr); - cli->state = TIP_CLIENT_RECEIVING_HEADER; + cli->state = TIP_CLIENT_GET_HEADER; return 0; } @@ -297,16 +297,16 @@ static void tip_client_read_cb(struct ev_loop *loop, struct ev_io *io, int event cli->buf_len += ret; switch (cli->state) { - case TIP_CLIENT_RECEIVING_HEADER: + case TIP_CLIENT_GET_HEADER: ret = tip_client_state_recv_hdr(cli); if (ret < 0) goto error; if (!ret) return; - cli->state = TIP_CLIENT_RECEIVING_PAYLOAD; + cli->state = TIP_CLIENT_GET_PAYLOAD; /* Fall through. */ - case TIP_CLIENT_RECEIVING_PAYLOAD: + case TIP_CLIENT_GET_PAYLOAD: ret = tip_client_state_recv_payload(cli); if (ret < 0) goto error; @@ -479,7 +479,7 @@ retry: syslog(LOG_INFO, "Requesting file %s to server\n", filename); tip_client_connect(argv[1]); - _cli.state = TIP_CLIENT_RECEIVING_HEADER; + _cli.state = TIP_CLIENT_GET_HEADER; while (_cli.state != TIP_CLIENT_DONE && !_cli.error) ev_loop(tip_main_loop, 0); -- cgit v1.2.3-18-g5258