From 056647348ff38f83b5e13bed1c4f4bb76cce50f9 Mon Sep 17 00:00:00 2001 From: snowdrop Date: Mon, 30 Aug 2004 13:25:23 +0000 Subject: optimized warnings --- nanohttp/nanohttp-server.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'nanohttp/nanohttp-server.c') diff --git a/nanohttp/nanohttp-server.c b/nanohttp/nanohttp-server.c index da71273..0e241a7 100644 --- a/nanohttp/nanohttp-server.c +++ b/nanohttp/nanohttp-server.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-server.c,v 1.9 2004/08/30 07:55:42 snowdrop Exp $ +* $Id: nanohttp-server.c,v 1.10 2004/08/30 13:25:23 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -109,13 +109,14 @@ FUNCTION: httpd_register int httpd_register(const char* ctx, httpd_service func) { hservice_t* service; - log_verbose3("register service:t(%p):%s", service, SAVE_STR(ctx)); service = (hservice_t*)malloc(sizeof(hservice_t)); service->next = NULL; service->func = func; strcpy(service->ctx, ctx); + log_verbose3("register service:t(%p):%s", service, SAVE_STR(ctx)); + if (_httpd_services_head == NULL) { _httpd_services_head = _httpd_services_tail = service; } else { @@ -267,12 +268,10 @@ static void* httpd_session_main(void *data) char buffer[256]; /* temp buffer for recv() */ char header[4064]; /* received header */ int total; /* result from recv() */ - int hindex; /* searching end of header */ int headerreached =0; /* whether reach header "\n\n" */ hrequest_t* req = NULL; /* only for test */ httpd_conn_t *rconn; hservice_t* service = NULL; - char *content_length_str; long content_length = 0; header[0] = '\0'; @@ -390,7 +389,7 @@ pthread_attr_init(&attr); #if HSOCKET_BLOCKMODE!=0 fcntl(_httpd_socket, F_SETFL, O_NONBLOCK); #endif -#else +#else if(ioctlsocket(_httpd_socket, FIONBIO, (u_long FAR*) &iMode) == INVALID_SOCKET) { log_error1("ioctlsocket error"); -- cgit v1.1-32-gdbae