/[cvs]/ccvs/src/server.c
ViewVC logotype

Diff of /ccvs/src/server.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.440 by dprice, Sun Sep 4 22:33:52 2005 UTC revision 1.441 by dprice, Sun Sep 4 23:00:04 2005 UTC
# Line 553  supported_response (char *name) Line 553  supported_response (char *name)
553    
554    
555    
 /* Return true if two paths match, resolving symlinks.  
  */  
 static inline bool  
 isSamePath (const char *path1_in, const char *path2_in)  
 {  
     char *p1, *p2;  
     bool same;  
   
     if (!strcmp (path1_in, path2_in))  
         return true;  
   
     /* Path didn't match, but try to resolve any links that may be  
      * present.  
      */  
     if (!isdir (path1_in) || !isdir (path2_in))  
         /* To be resolvable, paths must exist on this server.  */  
         return false;  
   
     p1 = xcanonicalize_file_name (path1_in);  
     p2 = xcanonicalize_file_name (path2_in);  
     if (strcmp (p1, p2))  
         same = false;  
     else  
         same = true;  
   
     free (p1);  
     free (p2);  
     return same;  
 }  
   
   
   
 /* From GNULIB lib/canon-host.c.  */  
 extern char *canon_host (char const *host);  
   
 /* Return true if OTHERHOST resolves to this host in the DNS.  
  *  
  * GLOBALS  
  *   server_hostname    The name of this host, as determined by the call to  
  *                      xgethostname() in main().  
  *  
  * RETURNS  
  *   true       If OTHERHOST equals or resolves to HOSTNAME.  
  *   false      Otherwise.  
  */  
 static inline bool  
 isThisHost (const char *otherhost)  
 {  
     char *fqdno;  
     char *fqdns;  
     bool retval;  
   
     /* As an optimization, check the literal strings before looking up  
      * OTHERHOST in the DNS.  
      */  
     if (!strcasecmp (server_hostname, otherhost))  
         return true;  
   
     fqdno = canon_host (otherhost);  
     if (!fqdno)  
         error (1, 0, "Name lookup failed for `%s'", otherhost);  
     fqdns = canon_host (server_hostname);  
     if (!fqdns)  
         error (1, 0, "Name lookup failed for `%s'", server_hostname);  
   
     retval = !strcasecmp (fqdns, fqdno);  
   
     free (fqdno);  
     free (fqdns);  
     return retval;  
 }  
   
   
   
556  /*  /*
557   * Return true if we need to relay write requests to a primary server   * Return true if we need to relay write requests to a primary server
558   * and false otherwise.   * and false otherwise.

Legend:
Removed from v.1.440  
changed lines
  Added in v.1.441

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26