From d24d6ab7bbfda8e302af3a5cf8be62299d543c1a Mon Sep 17 00:00:00 2001 From: snowdrop Date: Thu, 28 Oct 2004 10:30:41 +0000 Subject: changed hstatus_t to herror_t and chagend the API function to return herror_t. Added herror_*() functions and fixed a bug in the socket receive comm. --- nanohttp/nanohttp-request.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'nanohttp/nanohttp-request.c') diff --git a/nanohttp/nanohttp-request.c b/nanohttp/nanohttp-request.c index 0eb5a22..7661592 100755 --- a/nanohttp/nanohttp-request.c +++ b/nanohttp/nanohttp-request.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-request.c,v 1.2 2004/10/20 14:17:41 snowdrop Exp $ +* $Id: nanohttp-request.c,v 1.3 2004/10/28 10:30:46 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -217,10 +217,11 @@ hrequest_free(hrequest_t * req) } -hrequest_t * -hrequest_new_from_socket(hsocket_t sock) +herror_t +hrequest_new_from_socket(hsocket_t sock, hrequest_t **out) { - int i=0, status; + int i=0, readed; + herror_t status; hrequest_t *req; char buffer[MAX_HEADER_SIZE+1]; attachments_t *mimeMessage; @@ -228,11 +229,11 @@ hrequest_new_from_socket(hsocket_t sock) /* Read header */ while (iin = http_input_stream_new(sock, req->header); @@ -266,7 +263,7 @@ hrequest_new_from_socket(hsocket_t sock) { /* TODO (#1#): Handle error */ hrequest_free(req); - return NULL; + return status; } else { @@ -275,8 +272,8 @@ hrequest_new_from_socket(hsocket_t sock) } } - - return req; + *out = req; + return H_OK; } -- cgit v1.1-32-gdbae