# HG changeset patch # User Michael Spacefalcon # Date 1385324841 0 # Node ID ec040f521cc2d933a61e5892104a00115580bf44 # Parent 4714fdfca39cb4ded322ed6e5b0b7909f1ab28c3 rvinterf works after fixing max_fd diff -r 4714fdfca39c -r ec040f521cc2 rvinterf/lowlevel/clientcmd.c --- a/rvinterf/lowlevel/clientcmd.c Sun Nov 24 08:40:44 2013 +0000 +++ b/rvinterf/lowlevel/clientcmd.c Sun Nov 24 20:27:21 2013 +0000 @@ -18,6 +18,7 @@ struct client *cli; { int c; + char logmsg[128]; switch (cli->rx_buf[0]) { case CLI2RVI_WANT_RVTRACE: @@ -37,6 +38,10 @@ cli->int_rvt_match[c] = cli->rx_buf[5] << 24 | cli->rx_buf[6] << 16 | cli->rx_buf[7] << 8 | cli->rx_buf[8]; + sprintf(logmsg, + "*** Client program interested in RVT mask %08X match %08X", + cli->int_rvt_mask[c], cli->int_rvt_match[c]); + output_line(logmsg); cli->int_rvt_count++; send_local_msg_to_client(cli, "+OK"); return; @@ -50,6 +55,10 @@ "-Unsupported protocol MUX value"); return; } + sprintf(logmsg, + "*** Client program interested in MUX proto %02X", + cli->rx_buf[1]); + output_line(logmsg); cli->int_proto[cli->rx_buf[1] - 0x12] = 1; send_local_msg_to_client(cli, "+OK"); return; diff -r 4714fdfca39c -r ec040f521cc2 rvinterf/lowlevel/localsock.c --- a/rvinterf/lowlevel/localsock.c Sun Nov 24 08:40:44 2013 +0000 +++ b/rvinterf/lowlevel/localsock.c Sun Nov 24 20:27:21 2013 +0000 @@ -97,6 +97,8 @@ perror("rvinterf: accept"); exit(1); } + if (rc > max_fd) + max_fd = rc; newcli = malloc(sizeof(struct client)); if (!newcli) { perror("rvinterf: malloc for new client"); @@ -107,6 +109,7 @@ newcli->next = client_head; client_head = newcli; prep_for_length_rx(newcli); + output_line("*** Client program connected"); return(0); } @@ -135,6 +138,7 @@ cc = read(cli->fd, cli->rx_ptr, cli->rx_left); if (cc <= 0) { /* normal client exit condition */ + output_line("*** Client program disconnected"); close_socket: cli->rx_state = 2; return; }