Return-Path: Delivered-To: apmail-ws-axis-cvs-archive@www.apache.org Received: (qmail 86747 invoked from network); 31 Jan 2006 05:36:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Jan 2006 05:36:00 -0000 Received: (qmail 257 invoked by uid 500); 31 Jan 2006 05:35:59 -0000 Delivered-To: apmail-ws-axis-cvs-archive@ws.apache.org Received: (qmail 99919 invoked by uid 500); 31 Jan 2006 05:35:58 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 99908 invoked by uid 500); 31 Jan 2006 05:35:58 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 99904 invoked by uid 99); 31 Jan 2006 05:35:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2006 21:35:58 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 30 Jan 2006 21:35:57 -0800 Received: (qmail 86611 invoked by uid 65534); 31 Jan 2006 05:35:37 -0000 Message-ID: <20060131053537.86610.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r373718 - in /webservices/axis2/trunk/c/modules/core/transport/http: http_transport_utils.c receiver/http_svr_thread.c server/http_server_main.c Date: Tue, 31 Jan 2006 05:35:36 -0000 To: axis2-cvs@ws.apache.org From: sahan@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sahan Date: Mon Jan 30 21:35:29 2006 New Revision: 373718 URL: http://svn.apache.org/viewcvs?rev=373718&view=rev Log: Added error reporting and changed the services HTML Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_svr_thread.c webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c?rev=373718&r1=373717&r2=373718&view=diff ============================================================================== --- webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c (original) +++ webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c Mon Jan 30 21:35:29 2006 @@ -610,7 +610,8 @@ void *op = NULL; axis2_char_t *oname = NULL; - ret = AXIS2_STRACAT(tmp2, "Available Operations
    ", env); + ret = AXIS2_STRACAT(tmp2, "Available Operations
      ", + env); AXIS2_FREE((*env)->allocator, tmp2); tmp2 = ret; for(hi2 = axis2_hash_first(ops, env); NULL != hi2; @@ -646,7 +647,7 @@ { void *fsname = NULL; svcs_exists = AXIS2_TRUE; - ret = AXIS2_STRACAT(tmp2, "

      Faulty \ + ret = AXIS2_STRACAT(tmp2, "

      Faulty \ Services

      " , env); AXIS2_FREE((*env)->allocator, tmp2); @@ -656,7 +657,7 @@ axis2_hash_next(env, hi)) { axis2_hash_this(hi, (const void **)&fsname, NULL, NULL); - ret = AXIS2_STRACAT(tmp2, "

      ", env); + ret = AXIS2_STRACAT(tmp2, "

      ", env); AXIS2_FREE((*env)->allocator, tmp2); tmp2 = ret; ret = AXIS2_STRACAT(tmp2, (axis2_char_t*)fsname, env); @@ -671,11 +672,16 @@ { ret = AXIS2_STRDUP("

      There are no services deployed

      ", env); } - ret = AXIS2_STRACAT("Axis2C :: Services\ - " , tmp2, env); + ret = AXIS2_STRACAT("Axis2C :: Services" + "" + "
      " + , tmp2, env); /*AXIS2_FREE((*env)->allocator, tmp2);*/ tmp2 = ret; - ret = AXIS2_STRACAT(tmp2, "\r\n", env); + ret = AXIS2_STRACAT(tmp2, "
      \r\n", env); /*AXIS2_FREE((*env)->allocator, tmp);*/ return ret; Modified: webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_svr_thread.c URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_svr_thread.c?rev=373718&r1=373717&r2=373718&view=diff ============================================================================== --- webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_svr_thread.c (original) +++ webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_svr_thread.c Mon Jan 30 21:35:29 2006 @@ -158,10 +158,10 @@ struct AXIS2_PLATFORM_TIMEB t1, t2; axis2_simple_http_svr_conn_t *svr_conn = NULL; axis2_http_simple_request_t *request = NULL; - char log_str[128]; int millisecs = 0; double secs = 0; axis2_http_worker_t *tmp = NULL; + axis2_status_t status = AXIS2_FAILURE; socket = axis2_network_handler_svr_socket_accept(env, svr_thread_impl->listen_socket); @@ -171,9 +171,11 @@ } AXIS2_PLATFORM_GET_TIME_IN_MILLIS(&t1); svr_conn = axis2_simple_http_svr_conn_create(env, socket); + AXIS2_SIMPLE_HTTP_SVR_CONN_SET_RCV_TIMEOUT(svr_conn, env, + axis2_http_socket_read_timeout); request = AXIS2_SIMPLE_HTTP_SVR_CONN_READ_REQUEST(svr_conn, env); tmp = svr_thread_impl->worker; - AXIS2_HTTP_WORKER_PROCESS_REQUEST(tmp, env, svr_conn, request); + status = AXIS2_HTTP_WORKER_PROCESS_REQUEST(tmp, env, svr_conn, request); AXIS2_SIMPLE_HTTP_SVR_CONN_FREE(svr_conn, env); AXIS2_PLATFORM_GET_TIME_IN_MILLIS(&t2); millisecs = t2.millitm - t1.millitm; @@ -184,9 +186,16 @@ secs--; } secs += millisecs/1000.0; - sprintf(log_str, "[Axis2]Request served in %.3f seconds", secs); - AXIS2_LOG_WRITE((*env)->log, log_str, - AXIS2_LOG_LEVEL_INFO); + if(status == AXIS2_SUCCESS) + { + AXIS2_LOG_INFO((*env)->log, "Request served in %.3f seconds", secs); + } + else + { + AXIS2_LOG_INFO((*env)->log, "Error occured in processing request." + "(%.3f seconds)", secs); + } + } return AXIS2_SUCCESS; Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c?rev=373718&r1=373717&r2=373718&view=diff ============================================================================== --- webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c (original) +++ webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c Mon Jan 30 21:35:29 2006 @@ -117,14 +117,20 @@ server = axis2_http_server_create(&env, repo_path, port); if(NULL == server) { - AXIS2_LOG_ERROR(env->log, LOG_SI, "Server creation failed: Error code: %d :: %s", - env->error->error_number, + AXIS2_LOG_ERROR(env->log, LOG_SI, "Server creation failed: Error code:" + " %d :: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); system_exit(allocator, env, -1); } printf("Started Simple Axis2 HTTP Server ...\n"); - AXIS2_TRANSPORT_RECEIVER_START(server, &env); + if(AXIS2_TRANSPORT_RECEIVER_START(server, &env) == AXIS2_FAILURE) + { + AXIS2_LOG_ERROR(env->log, LOG_SI, "Server start failed: Error code:" + " %d :: %s", env->error->error_number, + AXIS2_ERROR_GET_MESSAGE(env->error)); + system_exit(allocator, env, -1); + } return 0; } @@ -136,10 +142,14 @@ fprintf(stdout, " [-r REPO_PATH]"); fprintf(stdout, " [-l LOG_LEVEL]\n"); fprintf(stdout, " Options :\n"); - fprintf(stdout, "\t-p PORT \t use the port number PORT. The default port is 9090\n"); - fprintf(stdout, "\t-r REPO_PATH \t use the repository path REPO_PATH. The default repository path is ../\n"); - fprintf(stdout, "\t-t SOCKET_READ_TIMEOUT\t set socket read timeout to SOCKET_READ_TIMEOUT. Default timeout is 30 seconds\n"); - fprintf(stdout, "\t-l LOG_LEVEL\t set log level to LOG_LEVEL. Available log levels range from 0(critical only) to 4(debug).\n\t\t\t Default log level is 4(debug)\n"); + fprintf(stdout, "\t-p PORT \t use the port number PORT. The default port is" + " 9090\n"); + fprintf(stdout, "\t-r REPO_PATH \t use the repository path REPO_PATH. The" + " default repository path is ../\n"); + fprintf(stdout, "\t-t SOCKET_READ_TIMEOUT\t set socket read timeout to " + "SOCKET_READ_TIMEOUT. Default timeout is 30 seconds\n"); + fprintf(stdout, "\t-l LOG_LEVEL\t set log level to LOG_LEVEL. Available " + "log levels range from 0(critical only) to 4(debug)." + "\n\t\t\t Default log level is 4(debug)\n"); fprintf(stdout, " Help :\n\t-h \t display this help screen.\n\n"); } -