costin      2003/02/17 08:59:47

  Modified:    jk/native/common jk_connect.c
  Log:
  Return more usefull information from recv, to help debug.
  
  Revision  Changes    Path
  1.8       +7 -5      jakarta-tomcat-connectors/jk/native/common/jk_connect.c
  
  Index: jk_connect.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_connect.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- jk_connect.c      6 Dec 2002 18:52:50 -0000       1.7
  +++ jk_connect.c      17 Feb 2003 16:59:47 -0000      1.8
  @@ -263,11 +263,11 @@
       return sent;
   }
   
  -/** receive len bytes.
  +/** receive len bytes. Used in ajp_common.
    * @param sd  opened socket.
    * @param b   buffer to store the data.
    * @param len length to receive.
  - * @return    -1: receive failed or connection closed.
  + * @return    <0: receive failed or connection closed.
    *            >0: length of the received data.
    */
   int jk_tcp_socket_recvfull(int sd, 
  @@ -283,6 +283,7 @@
                                0);    
           if(-1 == this_time) {
   #if defined(WIN32) || (defined(NETWARE) && defined(__NOVELL_LIBC__))
  +            /* I assume SOCKET_ERROR == -1 */
               if(SOCKET_ERROR == this_time) { 
                   errno = WSAGetLastError() - WSABASEERR;
               }
  @@ -290,8 +291,9 @@
   
               if(EAGAIN == errno) {
                   continue;
  -            } 
  -            return -1;
  +            }
  +            /** Pass the errno to the caller */
  +            return (errno>0) ? -errno : errno;
           }
           if(0 == this_time) {
               return -1; 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to