Don't print each keep-alive request on a new line
This commit is contained in:
parent
0373577005
commit
d2f5dc2823
1 changed files with 7 additions and 2 deletions
9
nmrp.c
9
nmrp.c
|
|
@ -356,7 +356,7 @@ int nmrp_do(struct nmrpd_args *args)
|
||||||
uint16_t region;
|
uint16_t region;
|
||||||
char *filename;
|
char *filename;
|
||||||
time_t beg;
|
time_t beg;
|
||||||
int i, status, ulreqs, expect, upload_ok, autoip;
|
int i, status, ulreqs, expect, upload_ok, autoip, kareqs;
|
||||||
struct ethsock *sock;
|
struct ethsock *sock;
|
||||||
struct ethsock_ip_undo *ip_undo = NULL;
|
struct ethsock_ip_undo *ip_undo = NULL;
|
||||||
struct ethsock_arp_undo *arp_undo = NULL;
|
struct ethsock_arp_undo *arp_undo = NULL;
|
||||||
|
|
@ -514,6 +514,7 @@ int nmrp_do(struct nmrpd_args *args)
|
||||||
|
|
||||||
expect = NMRP_C_CONF_REQ;
|
expect = NMRP_C_CONF_REQ;
|
||||||
ulreqs = 0;
|
ulreqs = 0;
|
||||||
|
kareqs = 0;
|
||||||
|
|
||||||
while (!g_interrupted) {
|
while (!g_interrupted) {
|
||||||
if (expect != NMRP_C_NONE && rx.msg.code != expect) {
|
if (expect != NMRP_C_NONE && rx.msg.code != expect) {
|
||||||
|
|
@ -634,7 +635,7 @@ int nmrp_do(struct nmrpd_args *args)
|
||||||
case NMRP_C_KEEP_ALIVE_REQ:
|
case NMRP_C_KEEP_ALIVE_REQ:
|
||||||
tx.msg.code = NMRP_C_KEEP_ALIVE_ACK;
|
tx.msg.code = NMRP_C_KEEP_ALIVE_ACK;
|
||||||
ethsock_set_timeout(sock, args->ul_timeout);
|
ethsock_set_timeout(sock, args->ul_timeout);
|
||||||
printf("Received keep-alive request.\n");
|
printf("\rReceived keep-alive request (%d). ", ++kareqs);
|
||||||
break;
|
break;
|
||||||
case NMRP_C_CLOSE_REQ:
|
case NMRP_C_CLOSE_REQ:
|
||||||
tx.msg.code = NMRP_C_CLOSE_ACK;
|
tx.msg.code = NMRP_C_CLOSE_ACK;
|
||||||
|
|
@ -660,6 +661,10 @@ int nmrp_do(struct nmrpd_args *args)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rx.msg.code == NMRP_C_CLOSE_REQ) {
|
if (rx.msg.code == NMRP_C_CLOSE_REQ) {
|
||||||
|
if (ka_count) {
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
printf("Remote finished. Closing connection.\n");
|
printf("Remote finished. Closing connection.\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue