axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r376205 - in /webservices/axis2/trunk/c/modules/util: network_handler.c stream.c
Date Thu, 09 Feb 2006 06:41:03 GMT
Author: sahan
Date: Wed Feb  8 22:41:01 2006
New Revision: 376205

URL: http://svn.apache.org/viewcvs?rev=376205&view=rev
Log:
Bug fix for windows (fdopen)

Modified:
    webservices/axis2/trunk/c/modules/util/network_handler.c
    webservices/axis2/trunk/c/modules/util/stream.c

Modified: webservices/axis2/trunk/c/modules/util/network_handler.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/network_handler.c?rev=376205&r1=376204&r2=376205&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/network_handler.c (original)
+++ webservices/axis2/trunk/c/modules/util/network_handler.c Wed Feb  8 22:41:01 2006
@@ -202,6 +202,7 @@
 	WORD wVersionRequested;
 	WSADATA wsaData;
 	int err;
+	int sock_opt = SO_SYNCHRONOUS_NONALERT;
  
 	wVersionRequested = MAKEWORD( 2, 2 );
  
@@ -223,7 +224,11 @@
 		WSACleanup( );
 		return 0; //WinSock 2.2 not supported 
 	}
-
+	/**
+	 *	Enable the use of sockets as filehandles
+	 */
+	setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *)&sock_opt,
+						sizeof(sock_opt));
 	return 1;
 }
-#endif
\ No newline at end of file
+#endif

Modified: webservices/axis2/trunk/c/modules/util/stream.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/stream.c?rev=376205&r1=376204&r2=376205&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/stream.c (original)
+++ webservices/axis2/trunk/c/modules/util/stream.c Wed Feb  8 22:41:01 2006
@@ -534,6 +534,7 @@
 {
 	axis2_stream_t *def_stream = NULL;
 	axis2_stream_impl_t *stream_impl = NULL;
+	int osfh = -1;
 	
 	AXIS2_ENV_CHECK(env, NULL);
 	def_stream = axis2_stream_create_internal(env);
@@ -557,7 +558,12 @@
 	stream_impl->stream_type = AXIS2_STREAM_SOCKET;
 	stream_impl->socket = socket;
 	stream_impl->fp = NULL;
+#if defined(WIN32)
+	osfh = _open_osfhandle(socket, _O_TEXT);
+	stream_impl->fp = fdopen(osfh, "w+");
+#else	
 	stream_impl->fp = fdopen(socket, "w+");
+#endif
 	if(NULL == stream_impl->fp)
 	{
 		axis2_stream_free(def_stream, env);



Mime
View raw message