diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-10-06 14:50:37 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-10-06 14:50:37 +0000 |
commit | 58d919bd347e216a47d1536939b499484b905db9 (patch) | |
tree | 368a4fa4a4e226f04c5e40423081fec9727711c9 /apps/netutils/webclient/webclient.c | |
parent | 1aad2537e6adf2a72a69329a555b97cb9ed48f88 (diff) | |
download | nuttx-58d919bd347e216a47d1536939b499484b905db9.tar.gz nuttx-58d919bd347e216a47d1536939b499484b905db9.tar.bz2 nuttx-58d919bd347e216a47d1536939b499484b905db9.zip |
Several bugfixes, mostly from Darcy Gong
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5217 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/netutils/webclient/webclient.c')
-rw-r--r-- | apps/netutils/webclient/webclient.c | 14 |
1 files changed, 7 insertions, 7 deletions
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; } } |