summaryrefslogtreecommitdiffstats
path: root/examples/nanohttp
diff options
context:
space:
mode:
authorGravatar m0gg2006-12-10 19:21:05 +0000
committerGravatar m0gg2006-12-10 19:21:05 +0000
commitf4c29af542bbded2fe36d9bdc80808c3a7f5d92b (patch)
tree4e131c9e14555cce9dcb9af7298d88953a230e7a /examples/nanohttp
parenta1267cdc17db793dbd3d960d1da0b6cf397e2b3e (diff)
downloadcsoap-f4c29af542bbded2fe36d9bdc80808c3a7f5d92b.tar.gz
csoap-f4c29af542bbded2fe36d9bdc80808c3a7f5d92b.tar.bz2
nhttp client fix and documentation update
Diffstat (limited to 'examples/nanohttp')
-rw-r--r--examples/nanohttp/http_client.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/nanohttp/http_client.c b/examples/nanohttp/http_client.c
index 7deeb03..1b9c912 100644
--- a/examples/nanohttp/http_client.c
+++ b/examples/nanohttp/http_client.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: http_client.c,v 1.8 2006/12/01 10:56:00 m0gg Exp $
+* $Id: http_client.c,v 1.9 2006/12/10 19:21:06 m0gg Exp $
*
* CSOAP Project: A http client/server library in C (example)
* Copyright (C) 2003-2004 Ferhat Ayaz
@@ -39,7 +39,7 @@ static char *password = NULL;
static void show_response(hresponse_t *res)
{
unsigned char buffer[MAX_BUFFER_SIZE+1];
- int read;
+ int len;
if (!res)
{
@@ -53,6 +53,7 @@ static void show_response(hresponse_t *res)
if (show_headers)
{
hpair_t *pair;
+
printf("HTTP Headers:\n");
for (pair = res->header; pair; pair=pair->next)
printf(" %s: %s\n", pair->key, pair->value);
@@ -66,10 +67,10 @@ static void show_response(hresponse_t *res)
while (http_input_stream_is_ready(res->in))
{
- read = http_input_stream_read(res->in, buffer, MAX_BUFFER_SIZE);
+ len = http_input_stream_read(res->in, buffer, MAX_BUFFER_SIZE);
if (show_content)
- fwrite(buffer, read, 1, stdout);
+ fwrite(buffer, len, 1, stdout);
}
return;
}