You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2001/10/24 22:03:03 UTC

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

tng         01/10/24 13:03:03

  Modified:    c/src/util/NetAccessors/WinSock BinHTTPURLInputStream.cpp
  Log:
  [Bug 2305] Include <stdlib.h> to BinHTTPURLInputStream.cpp.  By Peter A. Volchek.
  
  Revision  Changes    Path
  1.8       +30 -25    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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BinHTTPURLInputStream.cpp	2001/09/04 17:52:57	1.7
  +++ BinHTTPURLInputStream.cpp	2001/10/24 20:03:03	1.8
  @@ -1,37 +1,37 @@
   /*
    * The Apache Software License, Version 1.1
  - * 
  + *
    * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
    * reserved.
  - * 
  + *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
  - * 
  + *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  - * 
  + *    notice, this list of conditions and the following disclaimer.
  + *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
  - * 
  + *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
  - * 
  + *
    * 4. The names "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache\@apache.org.
  - * 
  + *
    * 5. Products derived from this software may not be called "Apache",
    *    nor may "Apache" appear in their name, without prior written
    *    permission of the Apache Software Foundation.
  - * 
  + *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  @@ -45,7 +45,7 @@
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
  - * 
  + *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation, and was
    * originally based on software copyright (c) 1999, International
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: BinHTTPURLInputStream.cpp,v $
  + * Revision 1.8  2001/10/24 20:03:03  tng
  + * [Bug 2305] Include <stdlib.h> to BinHTTPURLInputStream.cpp.  By Peter A. Volchek.
  + *
    * Revision 1.7  2001/09/04 17:52:57  peiyongz
    * Bugzilla# 3170: patch from Kevin Philips to handle Query in XMLURL.
    *
  @@ -94,13 +97,14 @@
   
   #define _WINSOCKAPI_
   
  -#define INCL_WINSOCK_API_TYPEDEFS 1 
  +#define INCL_WINSOCK_API_TYPEDEFS 1
   #include <winsock2.h>
   #include <windows.h>
   #include <tchar.h>
   
   #include <stdio.h>
   #include <string.h>
  +#include <stdlib.h>
   
   #include <util/XMLNetAccessor.hpp>
   #include <util/NetAccessors/WinSock/BinHTTPURLInputStream.hpp>
  @@ -153,8 +157,8 @@
   			gWSshutdown = (LPFN_SHUTDOWN) GetProcAddress(gWinsockLib,_T("shutdown"));
   			gWSclosesocket = (LPFN_CLOSESOCKET) GetProcAddress(gWinsockLib,_T("closesocket"));
   
  -			if(startup == NULL || 
  -				gWSACleanup == NULL || 
  +			if(startup == NULL ||
  +				gWSACleanup == NULL ||
   				gWSgethostbyname == NULL ||
   				gWSinet_addr == NULL ||
   				gWSgethostbyaddr == NULL ||
  @@ -182,7 +186,7 @@
   }
   
   void BinHTTPURLInputStream::Cleanup() {
  -	if(fInitialized) 
  +	if(fInitialized)
   	{
   		if(gWSACleanup) (*gWSACleanup)();
   		gWSACleanup = NULL;
  @@ -258,7 +262,7 @@
         : fSocketHandle(0)
         , fBytesProcessed(0)
   {
  -	if(!fInitialized) 
  +	if(!fInitialized)
   	{
   		Initialize();
   	}
  @@ -305,8 +309,8 @@
               ThrowXML(NetAccessorException,
                        XMLExcepts::NetAcc_TargetResolution);
           }
  -        if ((hostEntPtr = 
  -                gethostbyaddr((const char *) &numAddress, 
  +        if ((hostEntPtr =
  +                gethostbyaddr((const char *) &numAddress,
                                 sizeof(unsigned long), AF_INET)) == NULL)
           {
               // Call WSAGetLastError() to get the error number.
  @@ -344,8 +348,8 @@
       strcat(fBuffer, pathAsCharStar);
   
       if (queryAsCharStar != 0)
  -    {		
  -	fBuffer[strlen(fBuffer)] = chQuestion;
  +    {
  +        fBuffer[strlen(fBuffer)] = chQuestion;
           strcat(fBuffer, queryAsCharStar);
       }
   
  @@ -414,17 +418,17 @@
       // Make sure the header includes an HTTP 200 OK response.
       //
       char *p = strstr(fBuffer, "HTTP");
  -    if (p == 0) 
  +    if (p == 0)
       {
           ThrowXML(NetAccessorException, XMLExcepts::NetAcc_ReadSocket);
       }
   
       p = strchr(p, ' ');
  -    if (p == 0) 
  +    if (p == 0)
       {
           ThrowXML(NetAccessorException, XMLExcepts::NetAcc_ReadSocket);
       }
  -    
  +
       int httpResponse = atoi(p);
       if (httpResponse != 200)
       {
  @@ -474,7 +478,8 @@
               ThrowXML(NetAccessorException, XMLExcepts::NetAcc_ReadSocket);
           }
       }
  -    
  +
       fBytesProcessed += len;
       return len;
   }
  +
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org