summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar nandika2010-12-19 11:01:55 +0000
committerGravatar nandika2010-12-19 11:01:55 +0000
commit4f694fc357eb2fe9a417f6d8905319f074ff92ea (patch)
treee03e2d3435505e4b083d3b04aaaa263559ab9634 /src
parent75b77e3cb81ace15f6f01da89091b8c9a76cfb24 (diff)
downloadaxis2c-4f694fc357eb2fe9a417f6d8905319f074ff92ea.tar.gz
axis2c-4f694fc357eb2fe9a417f6d8905319f074ff92ea.tar.bz2
defined constants, header length definition increase to 1024
git-svn-id: http://svn.apache.org/repos/asf/axis/axis2/c/core/trunk@1050808 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/core/transport/http/sender/http_client.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/core/transport/http/sender/http_client.c b/src/core/transport/http/sender/http_client.c
index 73115fc..66f75a6 100644
--- a/src/core/transport/http/sender/http_client.c
+++ b/src/core/transport/http/sender/http_client.c
@@ -32,6 +32,9 @@
#include "ssl/ssl_stream.h"
#endif
+#define AXIS2_HTTP_HEADER_LENGTH 1024
+#define AXIS2_HTTP_STATUS_LINE_LENGTH 512
+
struct axis2_http_client
{
int sockfd;
@@ -551,9 +554,9 @@ axis2_http_client_receive_header(
{
int status_code = -1;
axis2_http_status_line_t *status_line = NULL;
- axis2_char_t str_status_line[512];
+ axis2_char_t str_status_line[AXIS2_HTTP_STATUS_LINE_LENGTH];
axis2_char_t tmp_buf[3];
- axis2_char_t str_header[512];
+ axis2_char_t str_header[AXIS2_HTTP_HEADER_LENGTH];
int read = 0;
int http_status = 0;
axis2_bool_t end_of_line = AXIS2_FALSE;
@@ -575,7 +578,7 @@ axis2_http_client_receive_header(
/* read the status line */
do
{
- memset(str_status_line, 0, 512);
+ memset(str_status_line, 0, AXIS2_HTTP_STATUS_LINE_LENGTH);
while((read = axutil_stream_read(client->data_stream, env, tmp_buf, 1)) > 0)
{
/* "read" variable is number of characters read by stream */
@@ -626,7 +629,7 @@ str_status_line %s", str_status_line);
axis2_http_status_line_get_reason_phrase(status_line, env));
/* now read the headers */
- memset(str_header, 0, 512);
+ memset(str_header, 0, AXIS2_HTTP_HEADER_LENGTH);
end_of_line = AXIS2_FALSE;
while(AXIS2_FALSE == end_of_headers)
{
@@ -649,7 +652,7 @@ str_status_line %s", str_status_line);
else
{
axis2_http_header_t *tmp_header = axis2_http_header_create_by_str(env, str_header);
- memset(str_header, 0, 512);
+ memset(str_header, 0, AXIS2_HTTP_HEADER_LENGTH);
if(tmp_header)
{
axis2_http_simple_response_set_header(client->response, env, tmp_header);
@@ -792,7 +795,7 @@ axis2_http_client_connect_ssl_host(
{
axutil_stream_t *tmp_stream = NULL;
axis2_char_t *connect_string = NULL;
- axis2_char_t str_status_line[512];
+ axis2_char_t str_status_line[AXIS2_HTTP_STATUS_LINE_LENGTH];
axis2_char_t tmp_buf[3];
int read = 0;
axis2_bool_t end_of_line = AXIS2_FALSE;
@@ -824,7 +827,7 @@ axis2_http_client_connect_ssl_host(
axutil_stream_write(tmp_stream, env, connect_string, axutil_strlen(connect_string)
* sizeof(axis2_char_t));
- memset(str_status_line, 0, 512);
+ memset(str_status_line, 0, AXIS2_HTTP_STATUS_LINE_LENGTH);
while((read = axutil_stream_read(tmp_stream, env, tmp_buf, 1)) > 0)
{
tmp_buf[read] = '\0';
@@ -858,7 +861,7 @@ axis2_http_client_connect_ssl_host(
}
/* We need to empty the stream before we return
*/
- memset(str_status_line, 0, 512);
+ memset(str_status_line, 0, AXIS2_HTTP_STATUS_LINE_LENGTH);
while(AXIS2_FALSE == end_of_response)
{
while((read = axutil_stream_read(tmp_stream, env, tmp_buf, 1)) > 0)