diff options
| author | Niklas | 2011-09-01 17:26:32 +0200 |
|---|---|---|
| committer | Niklas | 2011-09-01 17:26:32 +0200 |
| commit | ce2dc6982101ffb964feb5f29354d2b061c4b2b6 (patch) | |
| tree | 8c17a4fbbd7f2e0faeb69c2dbc145a451fb7f5dd /customdhcpcd | |
| parent | bigger changes in the checkConnectivity method. using now route command to de... (diff) | |
| download | fbgui-ce2dc6982101ffb964feb5f29354d2b061c4b2b6.tar.gz fbgui-ce2dc6982101ffb964feb5f29354d2b061c4b2b6.tar.xz fbgui-ce2dc6982101ffb964feb5f29354d2b061c4b2b6.zip | |
we tried some fixes for the messge loss problem, but we failed. Sebastian will look at the code later. server is now a echo server which sends ack for every received message.
Diffstat (limited to 'customdhcpcd')
| -rwxr-xr-x | customdhcpcd/src/customdhcpcd | bin | 175254 -> 175292 bytes | |||
| -rw-r--r-- | customdhcpcd/src/logwriter.c | 7 |
2 files changed, 4 insertions, 3 deletions
diff --git a/customdhcpcd/src/customdhcpcd b/customdhcpcd/src/customdhcpcd Binary files differindex 1fd0594..65aedd0 100755 --- a/customdhcpcd/src/customdhcpcd +++ b/customdhcpcd/src/customdhcpcd diff --git a/customdhcpcd/src/logwriter.c b/customdhcpcd/src/logwriter.c index cc7a595..378d805 100644 --- a/customdhcpcd/src/logwriter.c +++ b/customdhcpcd/src/logwriter.c @@ -82,7 +82,7 @@ void sendToQt(log_msg * msg) { int t; const char *tpl = "%s;%d;%d;%s\n"; char *outbuf; - char ack[4]; + char ack[8]; size_t outbuf_size = sizeof(char) * 4 + // ";" *3 + newline sizeof(int) * 2 + // status, substatus sizeof(msg->device) + // devicename @@ -104,9 +104,10 @@ void sendToQt(log_msg * msg) { msg->status, msg->substatus, msg->msg, msg->device); // fprintf(stdout, "ERROR writing to socket: %s", msg); } - if ((t = recv(sockfd, ack, 4, 0)) > 0) { - ack[t] = '\0'; + memset(ack,0,sizeof(ack)); + if ((t = recv(sockfd, ack, sizeof(ack), 0)) > 0) { syslog(LOG_ERR, "[fbgui] recv ack echo> %s", ack); + printf("received: %s\n", ack); } else { if (t < 0) syslog(LOG_ERR, "[fbgui] ERROR receiving from socket"); |
