(file) Return to slp.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / slp / Attic

Diff for /pegasus/src/slp/Attic/slp.cpp between version 1.4 and 1.5

version 1.4, 2001/07/09 22:03:18 version 1.5, 2001/07/16 22:28:06
Line 27 
Line 27 
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
   
 #include "slp.h" #include "slp.h"
  
   #ifdef PEGASUS_OS_TRU64
   # include <unistd.h>
   extern "C" void usleep(unsigned int);
   #endif
   
   
 PEGASUS_USING_STD; PEGASUS_USING_STD;
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
Line 68 
Line 73 
  
 #endif #endif
  
 #ifdef PEGASUS_OS_HPUX  #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_TRU64)
  
 PEGASUS_EXPORT int gethostbyname_r(const char *name, PEGASUS_EXPORT int gethostbyname_r(const char *name,
                     struct hostent *resultbuf,                     struct hostent *resultbuf,
Line 88 
Line 93 
   }   }
   return(0);   return(0);
 } }
   
 #endif #endif
  
 PEGASUS_EXPORT void slp_get_addr_string_from_url(const Sint8 *url, String &addr) PEGASUS_EXPORT void slp_get_addr_string_from_url(const Sint8 *url, String &addr)
Line 99 
Line 105 
 #ifdef _WIN32 #ifdef _WIN32
     _snprintf(name, 254, "%s:%d", inet_ntoa(a.sin_addr), ntohs(a.sin_port) );     _snprintf(name, 254, "%s:%d", inet_ntoa(a.sin_addr), ntohs(a.sin_port) );
 #else #else
   
   // ATTN: Mike Brasher: Hack to get built of TRU64:
   #ifdef PEGASUS_OS_TRU64
       sprintf(name, "%s:%d", inet_ntoa(a.sin_addr), ntohs(a.sin_port) );
   #else
     snprintf(name, 254, "%s:%d", inet_ntoa(a.sin_addr), ntohs(a.sin_port) );     snprintf(name, 254, "%s:%d", inet_ntoa(a.sin_addr), ntohs(a.sin_port) );
 #endif #endif
   
   #endif
     addr.clear();     addr.clear();
     addr = name;     addr = name;
     delete [] name;     delete [] name;
Line 186 
Line 199 
       temp = (Uint8 *)malloc(hostbuflen);       temp = (Uint8 *)malloc(hostbuflen);
       if(temp != NULL) {       if(temp != NULL) {
         host = NULL;         host = NULL;
         while(temp != NULL && (result = gethostbyname_r(bptr, &hostbuf, (char *)temp, hostbuflen,          while(temp != NULL && (result = gethostbyname_r(bptr, &hostbuf,
               (char *)temp,
               hostbuflen,
                                                         &host, (int *)&err)) == ERANGE){                                                         &host, (int *)&err)) == ERANGE){
           hostbuflen *= 2;           hostbuflen *= 2;
           temp = (Uint8 *)realloc(temp, hostbuflen);           temp = (Uint8 *)realloc(temp, hostbuflen);
Line 389 
Line 404 
   if( init == NULL )   if( init == NULL )
     _cur = _next;     _cur = _next;
   else {   else {
     assert( init = _cur->_rep );      assert( (init = _cur->_rep) != 0 );
     _cur = _cur->_next;     _cur = _cur->_next;
   }   }
   return(_cur->_rep);   return(_cur->_rep);
Line 1523 
Line 1538 
     if(rcv > 0)     if(rcv > 0)
       if(one_only == true)       if(one_only == true)
         return(rcv);         return(rcv);
   
   #ifdef PEGASUS_OS_TRU64
       usleep(10 * 1000);
   #else
     _LSLP_SLEEP(10);     _LSLP_SLEEP(10);
   #endif
   }   }
   rcv += service_listener(extra_sock);   rcv += service_listener(extra_sock);
   return(rcv);   return(rcv);
Line 1549 
Line 1569 
   if( 0 < err ) {   if( 0 < err ) {
     struct sockaddr_in remote;     struct sockaddr_in remote;
  
 #ifdef PEGASUS_OS_HPUX  #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_TRU64)
     int size = sizeof(remote);     int size = sizeof(remote);
 #else #else
     socklen_t size = sizeof(remote);     socklen_t size = sizeof(remote);


Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2