/[hydra]/hydra/src/virthost.c
ViewVC logotype

Diff of /hydra/src/virthost.c

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

revision 1.8 by nmav, Sat Sep 28 08:50:07 2002 UTC revision 1.9 by nmav, Sat Sep 28 16:04:01 2002 UTC
# Line 137  void add_virthost(const char *host, cons Line 137  void add_virthost(const char *host, cons
137   * virthost structure or NULL if not found   * virthost structure or NULL if not found
138   */   */
139    
140  virthost *find_virthost(const char *host, int hostlen)  virthost *find_virthost(const char *_host, int hostlen)
141  {  {
142      virthost *current;      virthost *current;
143      int hash;      int hash;
144        char host[MAX_SITENAME_LENGTH], *p;
145    
146      /* Find Hostname, IP, document root */      /* Find Hostname, IP, document root */
147      if (host==NULL) return NULL;      if (_host==NULL) return NULL;
148    
149      if (hostlen == 0)      if (hostlen == 0)
150          hostlen = strlen(host);          hostlen = strlen(_host);
151            
152        if (hostlen >= MAX_SITENAME_LENGTH)
153            return NULL;
154    
155        /* Remove port number.. Ie www.site.gr:8080
156         */
157        strcpy( host, _host);
158        p = strrchr( host, ':');
159        if (p) {
160            *p = 0;
161            hostlen = strlen( host);
162        }
163    
164      hash = get_host_hash_value( host);      hash = get_host_hash_value( host);
165    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26