diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/ChangeLog.txt | 4 | ||||
-rw-r--r-- | apps/netutils/webclient/webclient.c | 14 | ||||
-rw-r--r-- | apps/netutils/webserver/httpd.c | 2 |
3 files changed, 12 insertions, 8 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index bf2a85a9b..7375adccf 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -364,3 +364,7 @@ There are still a LOT of empty, stub Kconfig files. * Kconfig: Fleshed out apps/examples/buttons/Kconfig. There are still a LOT of empty, stub Kconfig files. + * apps/netutils/webserver/httpd.c: Fix a bug that I introduced in + recent check-ins (Darcy Gong). + * apps/netutils/webclient/webclient.c: Fix another but that I introduced + when I was trying to add correct handling for loss of connection (Darcy Gong) diff --git a/apps/netutils/webclient/webclient.c b/apps/netutils/webclient/webclient.c index 05a63ba38..5a84c4fd1 100644 --- a/apps/netutils/webclient/webclient.c +++ b/apps/netutils/webclient/webclient.c @@ -110,7 +110,7 @@ struct wget_s FAR char *buffer; /* user-provided buffer */ int buflen; /* Length of the user provided buffer */ int offset; /* Offset to the beginning of interesting data */ - int datend; /* Offset+1 to the last valid byte of data in the buffer */ + int datend; /* Offset+1 to the last valid byte of data in the buffer */ /* Buffer HTTP header data and parse line at a time */ @@ -204,7 +204,7 @@ static inline int wget_resolvehost(const char *hostname, in_addr_t *ipaddr) /* 'host' does not point to a valid address string. Try to resolve * the host name to an IP address. */ - + if (resolv_query(hostname, &addr) < 0) { /* Needs to set the errno here */ @@ -401,10 +401,10 @@ exit: * * Returned Value: * 0: if the GET operation completed successfully; - * -1: On a failure with errno set appropriately + * -1: On a failure with errno set appropriately * ****************************************************************************/ - + int wget(FAR const char *url, FAR char *buffer, int buflen, wget_callback_t callback, FAR void *arg) { @@ -524,10 +524,10 @@ int wget(FAR const char *url, FAR char *buffer, int buflen, ret = ws.datend; goto errout_with_errno; } - else if (ret == 0) + else if (ws.datend == 0) { nvdbg("Connection lost\n"); - close(sockfd); + close(sockfd); break; } @@ -567,7 +567,7 @@ int wget(FAR const char *url, FAR char *buffer, int buflen, else { redirected = true; - close(sockfd); + close(sockfd); break; } } diff --git a/apps/netutils/webserver/httpd.c b/apps/netutils/webserver/httpd.c index f96fc5a6c..9f621d67c 100644 --- a/apps/netutils/webserver/httpd.c +++ b/apps/netutils/webserver/httpd.c @@ -694,7 +694,7 @@ static inline int httpd_parse(struct httpd_state *pstate) while (state != STATE_BODY); #if !defined(CONFIG_NETUTILS_HTTPD_SENDFILE) && !defined(CONFIG_NETUTILS_HTTPD_MMAP) - if (0 == strcmp(pstate->ht_filename, "/") + if (0 == strcmp(pstate->ht_filename, "/")) { strncpy(pstate->ht_filename, "/" CONFIG_NETUTILS_HTTPD_INDEX, strlen("/" CONFIG_NETUTILS_HTTPD_INDEX)); } |