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 pr...@apache.org on 2005/03/21 16:33:01 UTC

cvs commit: ws-axis/c/src/transport/axis3/HTTPChannel HTTPChannel.cpp HTTPChannel.hpp

prestonf    2005/03/21 07:33:01

  Modified:    c/src/transport/axis3/HTTPChannel HTTPChannel.cpp
                        HTTPChannel.hpp
  Log:
  Hi All,
  Minor changes to the error message that is thrown after a send/receive to socket fails to report more detailed information.
  
  Revision  Changes    Path
  1.13      +18 -9     ws-axis/c/src/transport/axis3/HTTPChannel/HTTPChannel.cpp
  
  Index: HTTPChannel.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/transport/axis3/HTTPChannel/HTTPChannel.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- HTTPChannel.cpp	18 Mar 2005 14:14:15 -0000	1.12
  +++ HTTPChannel.cpp	21 Mar 2005 15:33:01 -0000	1.13
  @@ -18,7 +18,7 @@
       m_uiProxyPort = 0;
   
   #ifdef WIN32
  -	m_lTimeoutSeconds = 100;
  +	m_lTimeoutSeconds = 10;
   #else
   	m_lTimeoutSeconds = 0;
   #endif
  @@ -220,8 +220,7 @@
   
       if( (nByteRecv = recv( m_Sock, (char *) &buf, iBufSize, 0)) == SOCKET_ERROR)
       {
  -		// Recv SOCKET_ERROR, Channel error while getting data
  -		m_LastError = "Channel error while getting data";
  +		ReportError( "Channel error", "while reading data");
   
   		CloseChannel();
   
  @@ -275,7 +274,7 @@
   // throw an exception.
   		CloseChannel();
   
  -		m_LastError = "Output streaming error while writing data";
  +		ReportError( "Channel error", "while writing data");
   
   		throw HTTPTransportException( SERVER_TRANSPORT_OUTPUT_STREAMING_ERROR,
   									  (char *) m_LastError.c_str());
  @@ -444,21 +443,20 @@
               // Cannot open a channel to the remote end, shutting down the
               // channel and then throw an exception.
               // Before we do anything else get the last error message;
  -			long dw = GETLASTERROR
  +			long dwError = GETLASTERROR
   
   			CloseChannel();
               freeaddrinfo( paiAddrInfo0);
   			
  -			string* message = PLATFORM_GET_ERROR_MESSAGE(dw);
  -
  -			char fullMessage[600];
  +			string *	message = PLATFORM_GET_ERROR_MESSAGE( dwError);
  +			char		fullMessage[600];
   			sprintf(fullMessage,
   				"Failed to open connection to server: \n \
   				hostname='%s'\n\
   				port='%d'\n\
   				Error Message='%s'\
   				Error Code='%d'\n",
  -				m_URL.getHostName(), m_URL.getPort(), message->c_str(), (int) dw);
  +				m_URL.getHostName(), m_URL.getPort(), message->c_str(), (int) dwError);
   				
   			delete( message);
   
  @@ -715,3 +713,14 @@
       /* select returns 0 if timeout, 1 if input available, -1 if error. */
       return select( FD_SETSIZE, &set, NULL, NULL, &timeout);
   }
  +
  +void HTTPChannel::ReportError( char * szText1, char * szText2)
  +{
  +	long		dwMsg = GETLASTERROR
  +	string *	sMsg = PLATFORM_GET_ERROR_MESSAGE( dwMsg);
  +	char		szMsg[600];
  +
  +	sprintf( szMsg, "%s %d %s: '%s'\n", szText1, (int) dwMsg, szText2, sMsg->c_str());
  +
  +	m_LastError = szMsg;
  +}
  
  
  
  1.7       +1 -0      ws-axis/c/src/transport/axis3/HTTPChannel/HTTPChannel.hpp
  
  Index: HTTPChannel.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/transport/axis3/HTTPChannel/HTTPChannel.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HTTPChannel.hpp	28 Jan 2005 09:35:09 -0000	1.6
  +++ HTTPChannel.hpp	21 Mar 2005 15:33:01 -0000	1.7
  @@ -72,6 +72,7 @@
   	bool				StartSockets();
   	void				StopSockets();
   	int					applyTimeout();
  +	void				ReportError( char * szText1, char * szText2);
   
   private:
       URL				m_URL;				// URL