You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ra...@locus.apache.org on 2000/03/24 01:32:15 UTC

cvs commit: xml-xerces/c/src/util/NetAccessors/WinSock BinHTTPURLInputStream.cpp

rahulj      00/03/23 16:32:15

  Modified:    c/src/util/NetAccessors/WinSock BinHTTPURLInputStream.cpp
  Log:
  Connect to the port specified in the URL, rather than the default one.
  
  Revision  Changes    Path
  1.3       +8 -1      xml-xerces/c/src/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp
  
  Index: BinHTTPURLInputStream.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BinHTTPURLInputStream.cpp	2000/03/22 00:21:10	1.2
  +++ BinHTTPURLInputStream.cpp	2000/03/24 00:32:15	1.3
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: BinHTTPURLInputStream.cpp,v $
  + * Revision 1.3  2000/03/24 00:32:15  rahulj
  + * Connect to the port specified in the URL, rather than the default one.
  + *
    * Revision 1.2  2000/03/22 00:21:10  rahulj
    * Now we throw exceptions when errors occur.
    * Simplified the code, based on the assumption that
  @@ -132,6 +135,7 @@
       const XMLCh*        hostName = urlSource.getHost();
       char*               hostNameAsCharStar = localTranscode(hostName);
       ArrayJanitor<char>  janBuf1(hostNameAsCharStar);
  +    unsigned short      portNumber = (unsigned short) urlSource.getPortNum();
       struct hostent*     hostEntPtr = 0;
       struct sockaddr_in  sa;
       char                obuf[1024];  // URL's should be < 1018 bytes.
  @@ -159,7 +163,7 @@
       memcpy((void *) &sa.sin_addr,
              (const void *) hostEntPtr->h_addr, hostEntPtr->h_length);
       sa.sin_family = hostEntPtr->h_addrtype;
  -    sa.sin_port = htons(80);
  +    sa.sin_port = htons(portNumber);
   
       SOCKET s = socket(hostEntPtr->h_addrtype, SOCK_STREAM, 0);
       if (s == INVALID_SOCKET)