You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2007/11/18 14:41:54 UTC
svn commit: r596084 [2/2] - in
/webservices/axis2/scratch/c/dinesh/axis2c-762: axiom/src/om/ include/
samples/server/echo/ src/core/deployment/ src/core/engine/
src/core/receivers/ src/core/transport/http/receiver/
src/core/transport/http/sender/ src/c...
Modified: webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/transport/http/sender/http_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/transport/http/sender/http_client.c?rev=596084&r1=596083&r2=596084&view=diff
==============================================================================
--- webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/transport/http/sender/http_client.c (original)
+++ webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/transport/http/sender/http_client.c Sun Nov 18 05:41:52 2007
@@ -179,11 +179,12 @@
}
else
{
- client->sockfd = axutil_network_handler_open_socket(env,
- axutil_url_get_server
- (client->url, env),
- axutil_url_get_port
- (client->url, env));
+ client->sockfd =
+ axutil_network_handler_open_socket(env,
+ axutil_url_get_server
+ (client->url, env),
+ axutil_url_get_port
+ (client->url, env));
}
if (client->sockfd < 0)
{
@@ -211,23 +212,24 @@
#ifdef AXIS2_SSL_ENABLED
if (AXIS2_TRUE == client->proxy_enabled)
{
- if (AXIS2_SUCCESS != axis2_http_client_connect_ssl_host(client, env,
- axutil_url_get_server
- (client->
- url, env),
- axutil_url_get_port
- (client->
- url, env)))
+ if (AXIS2_SUCCESS !=
+ axis2_http_client_connect_ssl_host(client, env,
+ axutil_url_get_server
+ (client->url, env),
+ axutil_url_get_port
+ (client->
+ url, env)))
{
return AXIS2_FAILURE;
}
}
- client->data_stream = axutil_stream_create_ssl(env,
- client->sockfd,
- axis2_http_client_get_server_cert
- (client, env),
- axis2_http_client_get_key_file
- (client, env), ssl_pp);
+ client->data_stream =
+ axutil_stream_create_ssl(env,
+ client->sockfd,
+ axis2_http_client_get_server_cert
+ (client, env),
+ axis2_http_client_get_key_file
+ (client, env), ssl_pp);
#else
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_TRANSPORT_PROTOCOL,
AXIS2_FAILURE);
@@ -469,13 +471,11 @@
while (AXIS2_HTTP_RESPONSE_OK_CODE_VAL > http_status);
client->response = axis2_http_simple_response_create_default(env);
- axis2_http_simple_response_set_status_line(client->response, env,
- axis2_http_status_line_get_http_version
- (status_line, env),
- axis2_http_status_line_get_status_code
- (status_line, env),
- axis2_http_status_line_get_reason_phrase
- (status_line, env));
+ axis2_http_simple_response_set_status_line(
+ client->response, env,
+ axis2_http_status_line_get_http_version (status_line, env),
+ axis2_http_status_line_get_status_code (status_line, env),
+ axis2_http_status_line_get_reason_phrase (status_line, env));
/* now read the headers */
memset(str_header, 0, 512);
@@ -522,8 +522,9 @@
status_line = NULL;
}
if (AXIS2_FALSE ==
- axis2_http_simple_response_contains_header(client->response, env,
- AXIS2_HTTP_HEADER_CONTENT_TYPE)
+ axis2_http_simple_response_contains_header(
+ client->response, env,
+ AXIS2_HTTP_HEADER_CONTENT_TYPE)
&& 202 != status_code &&
axis2_http_simple_response_get_content_length(client->response,
env) > 0)
Modified: webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/transport/http/server/simple_axis2_server/http_server_main.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/transport/http/server/simple_axis2_server/http_server_main.c?rev=596084&r1=596083&r2=596084&view=diff
==============================================================================
--- webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/transport/http/server/simple_axis2_server/http_server_main.c (original)
+++ webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/transport/http/server/simple_axis2_server/http_server_main.c Sun Nov 18 05:41:52 2007
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -35,6 +34,8 @@
AXIS2_IMPORT extern int axis2_http_socket_read_timeout;
AXIS2_IMPORT extern axis2_char_t *axis2_request_url_prefix;
+#define DEFAULT_REPO_PATH "../"
+
/***************************** Function headers *******************************/
axutil_env_t *init_syetem_env(
axutil_allocator_t * allocator,
@@ -100,11 +101,15 @@
extern char *optarg;
extern int optopt;
int c;
+ unsigned int len;
int log_file_size = AXUTIL_LOG_FILE_SIZE;
+ unsigned int file_flag = 0;
axutil_log_levels_t log_level = AXIS2_LOG_LEVEL_DEBUG;
const axis2_char_t *log_file = "axis2.log";
+ const axis2_char_t *repo_path = DEFAULT_REPO_PATH;
int port = 9090;
- const axis2_char_t *repo_path = "../";
+ axis2_status_t status;
+
/* Set the service URL prefix to be used. This could default to services if not
set with AXIS2_REQUEST_URL_PREFIX macro at compile time */
@@ -178,8 +183,30 @@
AXIS2_LOG_INFO(env->log, "Repo location : %s", repo_path);
AXIS2_LOG_INFO(env->log, "Read Timeout : %d ms",
axis2_http_socket_read_timeout);
-
- server = axis2_http_server_create(env, repo_path, port);
+
+ status = axutil_file_handler_access (repo_path, AXIS2_R_OK);
+ if (status == AXIS2_SUCCESS)
+ {
+ len = strlen (repo_path);
+ if (!strcmp ((repo_path + (len - 9)), "axis2.xml"))
+ {
+ file_flag = 1;
+ }
+ }
+ else
+ {
+ AXIS2_LOG_WARNING (env->log, AXIS2_LOG_SI, "provided repo path %s is "
+ "not exsist or no permissions to read, set "
+ "repo_path to DEFAULT_REPO_PATH", repo_path);
+ repo_path = DEFAULT_REPO_PATH;
+ }
+
+
+ if (!file_flag)
+ server = axis2_http_server_create(env, repo_path, port);
+ else
+ server = axis2_http_server_create_with_file (env, repo_path, port);
+
if (!server)
{
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
Modified: webservices/axis2/scratch/c/dinesh/axis2c-762/util/include/axutil_error.h
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/dinesh/axis2c-762/util/include/axutil_error.h?rev=596084&r1=596083&r2=596084&view=diff
==============================================================================
--- webservices/axis2/scratch/c/dinesh/axis2c-762/util/include/axutil_error.h (original)
+++ webservices/axis2/scratch/c/dinesh/axis2c-762/util/include/axutil_error.h Sun Nov 18 05:41:52 2007
@@ -37,7 +37,7 @@
#define USER_ERROR_CODES_START (SAVAN_ERROR_CODES_START + AXUTIL_ERROR_MESSAGE_BLOCK_SIZE)
/* AXUTIL_ERROR_MAX define the maximum size of the error array */
-#define AXUTIL_ERROR_MAX (USER_ERROR_CODES_START+AXUTIL_ERROR_MESSAGE_BLOCK_SIZE)
+#define AXUTIL_ERROR_MAX (USER_ERROR_CODES_START + AXUTIL_ERROR_MESSAGE_BLOCK_SIZE)
/**
Modified: webservices/axis2/scratch/c/dinesh/axis2c-762/util/src/dir_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/dinesh/axis2c-762/util/src/dir_handler.c?rev=596084&r1=596083&r2=596084&view=diff
==============================================================================
--- webservices/axis2/scratch/c/dinesh/axis2c-762/util/src/dir_handler.c (original)
+++ webservices/axis2/scratch/c/dinesh/axis2c-762/util/src/dir_handler.c Sun Nov 18 05:41:52 2007
@@ -190,6 +190,8 @@
file_list = axutil_array_list_create(env, 0);
if (!getcwd(cwd, 500))
exit(1);
+
+ /* pathname is path of services directory or modules directory. */
chdir(pathname);
axis2_archive_extract();
@@ -200,10 +202,13 @@
if (count <= 0)
{
axutil_array_list_free(file_list, env);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "No files in the path %s.",
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No files in the path %s.",
pathname);
return NULL;
}
+
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "No %dfiles in the path %s.",
+ count, pathname);
for (i = 1; i < (count + 1); ++i)
{
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org