axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r371459 - in /webservices/axis2/trunk/c/modules: core/transport/http/receiver/simple_http_svr_conn.c util/stream.c
Date Mon, 23 Jan 2006 04:30:56 GMT
Author: samisa
Date: Sun Jan 22 20:30:49 2006
New Revision: 371459

URL: http://svn.apache.org/viewcvs?rev=371459&view=rev
Log:
Moved socket timeout setting to simple_http_svr_conn.c

Modified:
    webservices/axis2/trunk/c/modules/core/transport/http/receiver/simple_http_svr_conn.c
    webservices/axis2/trunk/c/modules/util/stream.c

Modified: webservices/axis2/trunk/c/modules/core/transport/http/receiver/simple_http_svr_conn.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/receiver/simple_http_svr_conn.c?rev=371459&r1=371458&r2=371459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/receiver/simple_http_svr_conn.c
(original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/receiver/simple_http_svr_conn.c
Sun Jan 22 20:30:49 2006
@@ -18,6 +18,7 @@
 #include <unistd.h>
 #include <axis2_http_transport.h>
 #include <axis2_string.h>
+#include <axis2_network_handler.h>
 
 /** 
  * @brief Simple HTTP Server Connection struct impl
@@ -97,6 +98,9 @@
     svr_conn_impl->socket = sockfd;
     svr_conn_impl->stream = NULL;
     svr_conn_impl->keep_alive = AXIS2_FALSE;
+	
+	/* set the socket timeout to 2 seconds */
+	axis2_network_handler_set_sock_option(env, sockfd, SO_RCVTIMEO, 2000);
     
 	if(-1 != svr_conn_impl->socket)
 	{
@@ -141,7 +145,6 @@
 axis2_simple_http_svr_conn_free(axis2_simple_http_svr_conn_t *svr_conn, 
                                 axis2_env_t **env)
 {
-    AXIS2_FUNC_PARAM_CHECK(svr_conn, env, AXIS2_FAILURE);
     axis2_simple_http_svr_conn_impl_t *svr_conn_impl = 
                                     AXIS2_INTF_TO_IMPL(svr_conn);
     

Modified: webservices/axis2/trunk/c/modules/util/stream.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/stream.c?rev=371459&r1=371458&r2=371459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/stream.c (original)
+++ webservices/axis2/trunk/c/modules/util/stream.c Sun Jan 22 20:30:49 2006
@@ -594,23 +594,8 @@
 	{
         return -1;
 	}
-    /*--- set timeout ---*/
-    fd_set          set;
-    struct timeval  timeout;
-
-    FD_ZERO( &set); /* initialize the file descriptor set.*/
-    FD_SET( AXIS2_INTF_TO_IMPL(stream)->socket, &set);
-
-    timeout.tv_sec = 5; /* initialize the timeout data structure. */
-    timeout.tv_usec = 0;
-
-    
-    int ret = select( FD_SETSIZE, &set, NULL, NULL, &timeout); /* select returns
0 if timeout, 
-                                                                    1 if input available,
-1 if error. */    
-    /*--- end set timeout ---*/
-    
-    if (ret > 0) /* read socket only if data available */
-        len = read(AXIS2_INTF_TO_IMPL(stream)->socket, buffer, count);
+        
+    len = read(AXIS2_INTF_TO_IMPL(stream)->socket, buffer, count);
     return len;
 }
 



Mime
View raw message