diff --git a/Utilities/Adaptors/Adaptor/appcfg.c b/Utilities/Adaptors/Adaptor/appcfg.c index 724811ee076..e72b952b23b 100644 --- a/Utilities/Adaptors/Adaptor/appcfg.c +++ b/Utilities/Adaptors/Adaptor/appcfg.c @@ -1232,7 +1232,7 @@ static char *_retrieveServerInfo(ConfigServer *server, net_fd s, int *len, char } tr_close(c, AC_INVALID_HANDLE, 0); if (resp != NULL) { - *len = resp->content_length; + *len = (int) resp->content_length; *content_type = '\0'; if (resp->status == HTTP_OK) { /* may be NOT_MODIFIED (or worse!) */ diff --git a/Utilities/Adaptors/Adaptor/config.h b/Utilities/Adaptors/Adaptor/config.h index 4ac887a215f..7eeb850d4a5 100644 --- a/Utilities/Adaptors/Adaptor/config.h +++ b/Utilities/Adaptors/Adaptor/config.h @@ -57,7 +57,7 @@ typedef int intptr_t; #define CURRENT_WOF_VERSION_MAJOR 4 #define CURRENT_WOF_VERSION_MINOR 6 -#define ADAPTOR_VERSION "4.6.2" +#define ADAPTOR_VERSION "4.6.3" /* Used to turn the value of a macro into a string literal */ #define _Str(x) #x diff --git a/Utilities/Adaptors/Adaptor/request.c b/Utilities/Adaptors/Adaptor/request.c index 9ad4a57d110..33cb27bece2 100644 --- a/Utilities/Adaptors/Adaptor/request.c +++ b/Utilities/Adaptors/Adaptor/request.c @@ -168,7 +168,7 @@ const char *req_AddHeader_common(HTTPRequest *req,const char *key,const char *va */ if ((req->content_length == 0) && ((strcasecmp(key, CONTENT_LENGTH) == 0) || (strcasecmp(key, "content_length") == 0))) /* get content-length */ - req->content_length = atoi(value); + req->content_length = atol(value); #ifdef DEBUG WOLog(WO_DBG,"(req-hdr) %s: %s",key, value); @@ -263,8 +263,8 @@ int req_sendRequest(HTTPRequest *req, net_fd socket) /* Note that we reuse buffers, and the existing content-data buffer. */ if (req->content_length > req->content_buffer_size) { - int total_sent = req->content_buffer_size; - int len_read, amount_to_read; + long total_sent = req->content_buffer_size; + long len_read, amount_to_read; req->haveReadStreamedData = 1; while (total_sent < req->content_length) { @@ -362,8 +362,8 @@ int req_sendRequest(HTTPRequest *req, net_fd socket) /* Note that we reuse buffers, and the existing content-data buffer. */ if (req->content_length > req->content_buffer_size) { - int total_sent = req->content_buffer_size; - int len_read, amount_to_read; + long total_sent = req->content_buffer_size; + long len_read, amount_to_read; req->haveReadStreamedData = 1; while (total_sent < req->content_length && result == 0) { diff --git a/Utilities/Adaptors/Adaptor/request.h b/Utilities/Adaptors/Adaptor/request.h index 99eeed2d615..164e1651ec8 100644 --- a/Utilities/Adaptors/Adaptor/request.h +++ b/Utilities/Adaptors/Adaptor/request.h @@ -51,7 +51,7 @@ typedef struct _HTTPRequest { char *request_str; /* the http request (includes CRLF) */ void *headers; /* (strtbl *) but you don't need to know */ void *api_handle; /* api specific pointer */ - unsigned content_length; + unsigned long content_length; void *content; unsigned content_buffer_size; req_getMoreContentCallback getMoreContent; diff --git a/Utilities/Adaptors/Adaptor/response.c b/Utilities/Adaptors/Adaptor/response.c index 769a96725ce..a85ab1d8c17 100644 --- a/Utilities/Adaptors/Adaptor/response.c +++ b/Utilities/Adaptors/Adaptor/response.c @@ -95,7 +95,7 @@ HTTPResponse *resp_errorResponse(const char *msg, int status) resp->content = html_msg->text; resp_addStringToResponse(resp, html_msg); resp->flags |= RESP_DONT_FREE_CONTENT; - sprintf(buf,"%d",resp->content_length); + sprintf(buf, "%lu", resp->content_length); st_add(resp->headers, CONTENT_LENGTH, buf, STR_COPYVALUE|STR_FREEVALUE); return resp; } @@ -174,8 +174,8 @@ void resp_addHeader(HTTPResponse *resp, String *rawhdr) // 2009/06/10: an explicit content-length value is available. // Update response flag information: resp->flags |= RESP_LENGTH_EXPLICIT; - resp->content_length = atoi(value); - WOLog(WO_INFO,"content-length was set expl.: %d", resp->content_length); + resp->content_length = atol(value); + WOLog(WO_INFO, "content-length was set expl.: %lu", resp->content_length); } if (((strcasecmp(CONTENT_TYPE,key) == 0) || strcasecmp("content_type", key) == 0)) @@ -235,7 +235,7 @@ HTTPResponse *resp_getResponseHeaders(WOConnection *instanceConnection, WOInstan // can be found in the adaptor source code. Therefore, we // should better use INT_MAX! resp->content_length = INT_MAX; - WOLog(WO_WARN, "Response doesn't specify a content-length: assuming %u bytes!", + WOLog(WO_WARN, "Response doesn't specify a content-length: assuming %lu bytes!", resp->content_length); } } @@ -254,7 +254,7 @@ int resp_getResponseContent(HTTPResponse *resp, int allowStreaming) { int ret = 0; if (resp->content_length) { - int count, amountToRead; + long count, amountToRead; if (resp->content == NULL) { diff --git a/Utilities/Adaptors/Adaptor/response.h b/Utilities/Adaptors/Adaptor/response.h index 95196b521e8..a6eb44267cc 100644 --- a/Utilities/Adaptors/Adaptor/response.h +++ b/Utilities/Adaptors/Adaptor/response.h @@ -37,9 +37,9 @@ typedef struct _HTTPResponse { /* These Strings get freed along with the response. */ String *responseStrings; void *content; - unsigned content_length; + unsigned long content_length; unsigned content_buffer_size; - unsigned content_read; /* total amount of data read from the instance */ + unsigned long content_read; /* total amount of data read from the instance */ unsigned content_valid; /* amount of valid data in content buffer */ int (*getMoreContent)(struct _HTTPResponse *resp, void *buffer, int bufferSize); diff --git a/Utilities/Adaptors/Apache2.2/mod_WebObjects.c b/Utilities/Adaptors/Apache2.2/mod_WebObjects.c index fee966a9d53..cfc5a5300a7 100644 --- a/Utilities/Adaptors/Apache2.2/mod_WebObjects.c +++ b/Utilities/Adaptors/Apache2.2/mod_WebObjects.c @@ -449,7 +449,7 @@ static void sendResponse(request_rec *r, HTTPResponse *resp) { while (resp->content_read < resp->content_length && (resp->flags & RESP_LENGTH_INVALID) != RESP_LENGTH_INVALID) { - int count; + long count; ap_rwrite(resp->content, resp->content_valid, r); if (r->connection->aborted) { diff --git a/Utilities/Adaptors/Apache2.4/mod_WebObjects.c b/Utilities/Adaptors/Apache2.4/mod_WebObjects.c index 992ce62b36f..b6d7aa38d06 100644 --- a/Utilities/Adaptors/Apache2.4/mod_WebObjects.c +++ b/Utilities/Adaptors/Apache2.4/mod_WebObjects.c @@ -449,7 +449,7 @@ static void sendResponse(request_rec *r, HTTPResponse *resp) { while (resp->content_read < resp->content_length && (resp->flags & RESP_LENGTH_INVALID) != RESP_LENGTH_INVALID) { - int count; + long count; ap_rwrite(resp->content, resp->content_valid, r); if (r->connection->aborted) { diff --git a/Utilities/Adaptors/CGI/WebObjects.c b/Utilities/Adaptors/CGI/WebObjects.c index 98bacf8291e..c393cc77251 100644 --- a/Utilities/Adaptors/CGI/WebObjects.c +++ b/Utilities/Adaptors/CGI/WebObjects.c @@ -147,7 +147,7 @@ static void sendResponse(HTTPResponse *resp) #ifndef PROFILE /* resp->content_valid will be 0 for HEAD requests and empty responses */ if (resp->content_valid) { - int count; + long count; while (resp->content_read < resp->content_length && (resp->flags & RESP_LENGTH_INVALID) != RESP_LENGTH_INVALID) { diff --git a/Utilities/Adaptors/IIS/WebObjects.c b/Utilities/Adaptors/IIS/WebObjects.c index 538982bc113..84bcd6d6052 100644 --- a/Utilities/Adaptors/IIS/WebObjects.c +++ b/Utilities/Adaptors/IIS/WebObjects.c @@ -200,7 +200,7 @@ static void sendResponse(EXTENSION_CONTROL_BLOCK *p, HTTPResponse *resp) /* resp->content_valid will be 0 for HEAD requests and empty responses */ if (resp->content_valid) { - int count; + long count; while (resp->content_read < resp->content_length && (resp->flags & RESP_LENGTH_INVALID) != RESP_LENGTH_INVALID && browserStatus == 0) { @@ -567,7 +567,7 @@ static int readContentData(HTTPRequest *req, void *dataBuffer, int dataSize, int length = (char *)WOMALLOC(32); if (length) { - sprintf(length,"%d",req->content_length); + sprintf(length,"%lu",req->content_length); req_addHeader(req, CONTENT_LENGTH, length, STR_FREEVALUE); } if (p->lpszContentType != NULL)