From 949a8d0b46d6baa9f42c2f8c3bd5e3bdc3596cbd Mon Sep 17 00:00:00 2001 From: m0gg Date: Sun, 19 Nov 2006 09:40:14 +0000 Subject: nanohttp admin patch; code cleanup --- examples/csoap/echoattachments-client.c | 13 +++++++++++-- examples/csoap/echoattachments-server.c | 13 +++++++++++-- examples/csoap/simpleclient.c | 11 ++++++++++- examples/csoap/simpleserver.c | 14 ++++++++++++-- examples/csoap/soapclient.c | 10 ++++++++++ examples/nanohttp/http_client.c | 15 +++++++++++---- examples/nanohttp/http_server.c | 22 +++++++++++++++------- 7 files changed, 80 insertions(+), 18 deletions(-) (limited to 'examples') diff --git a/examples/csoap/echoattachments-client.c b/examples/csoap/echoattachments-client.c index 6f07253..49d1931 100755 --- a/examples/csoap/echoattachments-client.c +++ b/examples/csoap/echoattachments-client.c @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: echoattachments-client.c,v 1.11 2006/07/09 16:24:19 snowdrop Exp $ + * $Id: echoattachments-client.c,v 1.12 2006/11/19 09:40:14 m0gg Exp $ * * CSOAP Project: CSOAP examples project * Copyright (C) 2003-2004 Ferhat Ayaz @@ -20,7 +20,16 @@ * * Email: ferhatayaz@yahoo.com ******************************************************************/ - +#include +#include +#include + +#include +#include +#include +#include +#include +#include #include #include diff --git a/examples/csoap/echoattachments-server.c b/examples/csoap/echoattachments-server.c index 0beb56f..5543984 100755 --- a/examples/csoap/echoattachments-server.c +++ b/examples/csoap/echoattachments-server.c @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: echoattachments-server.c,v 1.8 2006/07/09 16:24:19 snowdrop Exp $ + * $Id: echoattachments-server.c,v 1.9 2006/11/19 09:40:14 m0gg Exp $ * * CSOAP Project: CSOAP examples project * Copyright (C) 2003-2004 Ferhat Ayaz @@ -20,7 +20,16 @@ * * Email: ferhatayaz@yahoo.com ******************************************************************/ - +#include +#include +#include + +#include +#include +#include +#include +#include +#include #include #include diff --git a/examples/csoap/simpleclient.c b/examples/csoap/simpleclient.c index 6468113..47ffd32 100644 --- a/examples/csoap/simpleclient.c +++ b/examples/csoap/simpleclient.c @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: simpleclient.c,v 1.12 2006/07/09 16:24:19 snowdrop Exp $ + * $Id: simpleclient.c,v 1.13 2006/11/19 09:40:14 m0gg Exp $ * * CSOAP Project: CSOAP examples project * Copyright (C) 2003-2004 Ferhat Ayaz @@ -20,7 +20,16 @@ * * Email: ferhatayaz@yahoo.com ******************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/examples/csoap/simpleserver.c b/examples/csoap/simpleserver.c index 6b076f6..33e1a3c 100644 --- a/examples/csoap/simpleserver.c +++ b/examples/csoap/simpleserver.c @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: simpleserver.c,v 1.19 2006/07/09 16:24:19 snowdrop Exp $ + * $Id: simpleserver.c,v 1.20 2006/11/19 09:40:14 m0gg Exp $ * * CSOAP Project: CSOAP examples project * Copyright (C) 2003-2004 Ferhat Ayaz @@ -20,8 +20,18 @@ * * Email: ferhatayaz@yahoo.com ******************************************************************/ - +#include +#include +#include + +#include +#include +#include +#include +#include +#include #include + #include diff --git a/examples/csoap/soapclient.c b/examples/csoap/soapclient.c index c7ece72..131ceac 100644 --- a/examples/csoap/soapclient.c +++ b/examples/csoap/soapclient.c @@ -4,11 +4,21 @@ */ /* Author: Adrianus Warmenhoven */ +#include #include #include #include +#include + +#include +#include +#include +#include +#include +#include #include + #include #define MAX_LINE_LENGTH 65535 diff --git a/examples/nanohttp/http_client.c b/examples/nanohttp/http_client.c index c454fd7..d2ff4c9 100644 --- a/examples/nanohttp/http_client.c +++ b/examples/nanohttp/http_client.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: http_client.c,v 1.2 2006/07/09 16:24:19 snowdrop Exp $ +* $Id: http_client.c,v 1.3 2006/11/19 09:40:14 m0gg Exp $ * * CSOAP Project: A http client/server library in C (example) * Copyright (C) 2003-2004 Ferhat Ayaz @@ -23,9 +23,16 @@ ******************************************************************/ #include #include - -#include +#include +#include + +#include +#include +#include +#include +#include #include +#include #define MAX_BUFFER_SIZE 1024 @@ -38,7 +45,7 @@ static char *password = NULL; static void show_response(hresponse_t *res) { - byte_t buffer[MAX_BUFFER_SIZE+1]; + unsigned char buffer[MAX_BUFFER_SIZE+1]; int read; if (!res) { diff --git a/examples/nanohttp/http_server.c b/examples/nanohttp/http_server.c index 348a1d7..5801312 100644 --- a/examples/nanohttp/http_server.c +++ b/examples/nanohttp/http_server.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: http_server.c,v 1.4 2006/07/09 16:24:19 snowdrop Exp $ +* $Id: http_server.c,v 1.5 2006/11/19 09:40:14 m0gg Exp $ * * CSOAP Project: A http client/server library in C (example) * Copyright (C) 2003 Ferhat Ayaz @@ -21,11 +21,18 @@ * * Email: hero@persua.de ******************************************************************/ +#include #include #include +#include -#include +#include +#include +#include +#include +#include #include +#include static int simple_authenticator(hrequest_t *req, const char *user, const char *password) { @@ -133,6 +140,7 @@ static void root_service(httpd_conn_t *conn, hrequest_t *req) "
  • Secure service (try: bob/builder)
  • " "
  • Request headers
  • " "
  • The default service
  • " + "
  • Admin page (try -NHTTPDadmin on the command line)
  • " "" "" ""); @@ -146,31 +154,31 @@ int main(int argc, char *argv[]) if (httpd_init(argc, argv)) { - fprintf(stderr, "Can not init httpd"); + fprintf(stderr, "Cannot init httpd"); return 1; } if (!httpd_register("/", root_service)) { - fprintf(stderr, "Can not register service"); + fprintf(stderr, "Cannot register service"); return 1; } if (!httpd_register_secure("/secure", secure_service, simple_authenticator)) { - fprintf(stderr, "Can not register secure service"); + fprintf(stderr, "Cannot register secure service"); return 1; } if (!httpd_register("/headers", headers_service)) { - fprintf(stderr, "Can not register headers service"); + fprintf(stderr, "Cannot register headers service"); return 1; } if (!httpd_register_default("/error", default_service)) { - fprintf(stderr, "Can not register default service"); + fprintf(stderr, "Cannot register default service"); return 1; } -- cgit v1.1-32-gdbae