cvs commit: apache/src http_protocol.c
akosut 96/08/19 10:22:58 Modified:src http_protocol.c Log: Add a missing CRLF. *sigh* Revision ChangesPath 1.39 +1 -1 apache/src/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache/src/http_protocol.c,v retrieving revision 1.38 retrieving revision 1.39 diff -C3 -r1.38 -r1.39 *** http_protocol.c 1996/08/18 20:26:30 1.38 --- http_protocol.c 1996/08/19 17:22:56 1.39 *** *** 1249,1255 #endif bputs("Connection: Keep-Alive\015\012", c->client); } ! else bputs("Connection: close", c->client); bputs("\015\012", c->client); return; } --- 1249,1255 #endif bputs("Connection: Keep-Alive\015\012", c->client); } ! else bputs("Connection: close\015\012", c->client); bputs("\015\012", c->client); return; }
cvs commit: apache/src util.c
akosut 96/08/19 10:54:53 Modified:src util.c Log: Fix backslash-quoting in getword_conf() Reviewed by: Roy T. Fielding, Someone Else (I forget who, exactly) Revision ChangesPath 1.16 +8 -7 apache/src/util.c Index: util.c === RCS file: /export/home/cvs/apache/src/util.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C3 -r1.15 -r1.16 *** util.c1996/07/29 02:32:34 1.15 --- util.c1996/08/19 17:54:52 1.16 *** *** 458,471 * all honored */ ! char *substring_conf (pool *p, char *start, int len) { char *result = palloc (p, len + 2); char *resp = result; int i; for (i = 0; i < len; ++i) { ! if (start[i] == '\\') *resp++ = start[++i]; else *resp++ = start[i]; --- 458,472 * all honored */ ! char *substring_conf (pool *p, char *start, int len, char quote) { char *result = palloc (p, len + 2); char *resp = result; int i; for (i = 0; i < len; ++i) { ! if (start[i] == '\\' && (start[i+1] == '/' ! || (quote && start[i+1] == quote))) *resp++ = start[++i]; else *resp++ = start[i]; *** *** 490,508 if ((quote = *str) == '"' || quote == '\'') { strend = str + 1; while (*strend && *strend != quote) { ! if (*strend == '\\' && strend[1]) strend += 2; else ++strend; } ! res = substring_conf (p, str + 1, strend - str - 1); if (*strend == quote) ++strend; } else { strend = str; while (*strend && !isspace (*strend)) ! if (*strend == '\\' && strend[1]) strend += 2; ! else ++strend; ! res = substring_conf (p, str, strend - str); } while (*strend && isspace(*strend)) ++ strend; --- 491,509 if ((quote = *str) == '"' || quote == '\'') { strend = str + 1; while (*strend && *strend != quote) { ! if (*strend == '\\' && strend[1] && strend[1] == quote) ! strend += 2; else ++strend; } ! res = substring_conf (p, str + 1, strend - str - 1, quote); if (*strend == quote) ++strend; } else { strend = str; while (*strend && !isspace (*strend)) ! ++strend; ! res = substring_conf (p, str, strend - str, 0); } while (*strend && isspace(*strend)) ++ strend;
cvs commit: apache/src http_protocol.c
akosut 96/08/19 11:05:34 Modified:src http_protocol.c Log: Make Apache correctly read continued headers Submitted by: Paul Sutton Reviewed by: Alexei Kosut, Roy T. Fielding Revision ChangesPath 1.40 +36 -8 apache/src/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache/src/http_protocol.c,v retrieving revision 1.39 retrieving revision 1.40 diff -C3 -r1.39 -r1.40 *** http_protocol.c 1996/08/19 17:22:56 1.39 --- http_protocol.c 1996/08/19 18:05:32 1.40 *** *** 530,545 char w[MAX_STRING_LEN]; char *t; conn_rec *c = r->connection; ! while(getline(w, MAX_STRING_LEN-1, c->client)) { ! if(!w[0]) ! return; ! if(!(t = strchr(w,':'))) ! continue; ! *t++ = '\0'; ! while(isspace(*t)) ++t; ! table_merge (r->headers_in, w, t); } } --- 530,573 char w[MAX_STRING_LEN]; char *t; conn_rec *c = r->connection; + int len = 0; + char lookahead[2]; ! if (getline(w, MAX_STRING_LEN-1, c->client)) { ! do { ! if(!w[len]) ! return; ! /* w[] contains the _current_ line. Lets read the ! * first char of the _next_ line into lookahead[] and see ! * if it is a continuation line */ ! if (!getline(lookahead, 2, c->client) || ! *lookahead == '\0' || ! (*lookahead != ' ' && *lookahead != '\t')) { ! /* Not a continuation line -- _next_ line is either ! * a read error, empty, or doesn't start with SPACE or TAB ! * -- so store the _current_ line now */ ! if(!(t = strchr(w,':'))) ! continue; ! *t++ = '\0'; ! while(isspace(*t)) ++t; ! table_merge (r->headers_in, w, t); ! ! if (!*lookahead) /* did we read an empty line? */ ! return; ! ! /* Put what we read as the start of the new _current_ line */ ! w[0] = '\0'; ! } ! /* To get here, here have got a lookahead character in ! * *lookahead, so append it onto the end of w[], then ! * read the next line onto the end of that. Move ! * len on to point to the first char read from the next ! * line of input... we use this at the top of the loop ! * to check whether we actually read anything. */ ! } while (len = strlen(w), ! w[len++] = *lookahead, ! getline (w+len, MAX_STRING_LEN-1-len, c->client)); } }
cvs commit: apache/src mod_log_config.c
akosut 96/08/19 11:12:37 Modified:src mod_log_config.c Log: Add CustomLog capability to mod_log_config. Submitted by: Paul Sutton Reviewed by: Alexei Kosut, Mark J Cox Revision ChangesPath 1.9 +231 -75 apache/src/mod_log_config.c Index: mod_log_config.c === RCS file: /export/home/cvs/apache/src/mod_log_config.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C3 -r1.8 -r1.9 *** mod_log_config.c 1996/08/06 19:33:31 1.8 --- mod_log_config.c 1996/08/19 18:12:35 1.9 *** *** 54,63 /* * This is module implements the TransferLog directive (same as the ! * common log module), and an additional directive, LogFormat. * ! * The argument to LogFormat is a string, which can include literal ! * characters copied into the log files, and '%' directives as follows: * * %...b: bytes sent. * %...h: remote host --- 54,112 /* * This is module implements the TransferLog directive (same as the ! * common log module), and additional directives, LogFormat and CustomLog. * ! * ! * Syntax: ! * ! *TransferLog fn Logs transfers to fn in standard log format, unless ! *a custom format is set with LogFormat ! *LogFormat formatSet a log format from TransferLog files ! *CustomLog fn format ! *Log to file fn with format given by the format ! *argument ! * ! * There can be any number of TransferLog and CustomLog ! * commands. Each request will be logged to _ALL_ the ! * named files, in the appropriate format. ! * ! * If no TransferLog or CustomLog directive appears in a VirtualHost, ! * the request will be logged to the log file(s) defined outside ! * the virtual host section. If a TransferLog or CustomLog directive ! * appears in the VirtualHost section, the log files defined outside ! * the VirtualHost will _not_ be used. This makes this module compatable ! * with the CLF and config log modules, where the use of TransferLog ! * inside the VirtualHost section overrides its use outside. ! * ! * Examples: ! * ! *TransferLoglogs/access_log ! * ! *LogFormat "... custom format ..." ! *TransferLoglog/virtual_only ! *CustomLog log/virtual_useragents "%t %{user-agent}i" ! * ! * ! * This will log using CLF to access_log any requests handled by the ! * main server, while any requests to the virtual host will be logged ! * with the "... custom format..." to virtual_only _AND_ using ! * the custom user-agent log to virtual_useragents. ! * ! * Note that the NCSA referer and user-agent logs are easily added with ! * CustomLog: ! * CustomLog logs/referer "%{referer}i -> %U" ! * CustomLog logs/agent"%{user-agent}i" ! * ! * Except: no RefererIgnore functionality ! * logs '-' if no Referer or User-Agent instead of nothing ! * ! * But using this method allows much easier modification of the ! * log format, e.g. to log hosts along with UA: ! * CustomLog logs/referer "%{referer}i %U %h" ! * ! * The argument to LogFormat and CustomLog is a string, which can include ! * literal characters copied into the log files, and '%' directives as ! * follows: * * %...b: bytes sent. * %...h: remote host *** *** 117,122 --- 166,201 static mode_t xfer_mode = ( S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ); #endif + /* + * multi_log_state is our per-(virtual)-server configuration. We store + * an array of the logs we are going to use, each of type config_log_state. + * If a default log format is given by LogFormat, store in default_format + * (backward compat. with mod_log_config). We also store a pointer to + * the logs specified for the main server for virtual servers, so that + * if this vhost has now logs defined, we can use the main server's + * logs instead. + * + * So, for the main server, config_logs contains a list of the log files + * and server_config_logs in empty. For a vhost, server_config_logs + * points to the same array as config_logs in the main server, and + * config_logs points to the array of logs defined inside this vhost, + * which might be empty. + */ + + typedef struct { + array_header *default_format; + array_header *config_logs; + array_header *server_config_logs; + } multi_log_state; + + /* + * config_log_state holds the status of a single log file. fname cannot + * be NULL. format might be NULL, in which case the default_format from + * the multi_log_state should be used, or if that is NULL as well, use + * the CLF. log_fd is -1 before the log file is opened and set
cvs commit: apache/src http_config.c http_core.c http_main.c http_protocol.c httpd.h
akosut 96/08/19 11:33:03 Modified:src http_config.c http_core.c http_main.c http_protocol.c httpd.h Log: Allow for multiple IP addresses per virtual host. Submitted by: Dean Gaudet Reviewed by: Alexei Kosut, Mark J Cox Revision ChangesPath 1.20 +86 -6 apache/src/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache/src/http_config.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C3 -r1.19 -r1.20 *** http_config.c 1996/08/15 13:56:53 1.19 --- http_config.c 1996/08/19 18:32:56 1.20 *** *** 685,693 --- 685,763 * are with the command table in http_core.c. */ + /* + * Parses a host of the form [:port] + * paddr is used to create a list in the order of input + * **paddr is the ->next pointer of the last entry (or s->addrs) + * *paddr is the variable used to keep track of **paddr between calls + */ + static void get_addresses (pool *p, char *w, server_addr_rec ***paddr) + { + struct hostent *hep; + unsigned long my_addr; + int ports; + server_addr_rec *sar; + char *t; + int i; + + if( *w == 0 ) return; + + t = strchr(w, ':'); + ports = 0; + if (t != NULL && strcmp(t+1, "*") != 0) ports = atoi(t+1); + + if (t != NULL) *t = '\0'; + if (strcmp(w, "*") == 0) { + sar = pcalloc( p, sizeof( server_addr_rec ) ); + **paddr = sar; + *paddr = &sar->next; + sar->host_addr.s_addr = htonl(INADDR_ANY); + sar->host_port = ports; + sar->virthost = pstrdup(p, w); + if (t != NULL) *t = ':'; + return; + } + + #ifdef DGUX + my_addr = inet_network(w); + #else + my_addr = inet_addr(w); + #endif + if (my_addr != ((unsigned long) 0x)) { + sar = pcalloc( p, sizeof( server_addr_rec ) ); + **paddr = sar; + *paddr = &sar->next; + sar->host_addr.s_addr = my_addr; + sar->host_port = ports; + sar->virthost = pstrdup(p, w); + if (t != NULL) *t = ':'; + return; + } + + hep = gethostbyname(w); + + if ((!hep) || (hep->h_addrtype != AF_INET || !hep->h_addr_list[0])) { + fprintf (stderr, "Cannot resolve host name %s --- exiting!\n", w); + exit(1); + } + + for( i = 0; hep->h_addr_list[i]; ++i ) { + sar = pcalloc( p, sizeof( server_addr_rec ) ); + **paddr = sar; + *paddr = &sar->next; + sar->host_addr = *(struct in_addr *)hep->h_addr_list[i]; + sar->host_port = ports; + sar->virthost = pstrdup(p, w); + } + + if (t != NULL) *t = ':'; + } + server_rec *init_virtual_host (pool *p, char *hostname) { server_rec *s = (server_rec *)pcalloc (p, sizeof (server_rec)); + char *t; + server_addr_rec **addrs; #ifdef RLIMIT_NOFILE struct rlimit limits; *** *** 708,719 s->timeout = 0; s->keep_alive_timeout = 0; s->keep_alive = -1; ! s->host_addr.s_addr = get_virthost_addr (hostname, &s->host_port); ! s->port = s->host_port; /* set them the same, by default */ s->next = NULL; s->is_virtual = 1; - s->virthost = pstrdup(p, hostname); s->names = NULL; s->module_config = create_empty_config (p); --- 778,798 s->timeout = 0; s->keep_alive_timeout = 0; s->keep_alive = -1; ! /* start the list of addreses */ ! addrs = &s->addrs; ! while( hostname[0] ) { ! get_addresses( p, getword_conf( p, &hostname ), &addrs ); ! } ! /* terminate the list */ ! *addrs = NULL; ! if( s->addrs == NULL ) { ! fprintf( stderr, "virtual host must have at least one address\n" ); ! exit(1); ! } ! s->port = s->addrs->host_port; /* set them the same, by default */ s->next = NULL; s->is_virtual = 1; s->names = NULL; s->module_config = create_empty_config (p); *** *** 804,818 s->keep_alive_timeout = DEFAULT_KEEPALIVE_TIMEOUT; s->keep_alive = DEFAULT_KEEPALIVE; s->next = NULL; ! s->host_addr.s_addr = htonl (INADDR_ANY); /* NOT virtual host; * don't match any real network * interface. */ ! s->host_port = 0; /* matches any port */ s->module_config = create_server_config (p, s); s->lookup_defaults = create_default_per_dir_config (p); ! return s; } --- 883,898 s->keep_alive_timeout = DEFAULT_KEEPALIVE_TIMEOUT; s->keep_alive = DEFAULT_KEEPALIVE; s->next = NULL; ! s->
cvs commit: apache/src http_main.c
ben 96/08/19 11:44:17 Modified:src http_main.c Log: Add directive listing option. Revision ChangesPath 1.61 +22 -2 apache/src/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apache/src/http_main.c,v retrieving revision 1.60 retrieving revision 1.61 diff -C3 -r1.60 -r1.61 *** http_main.c 1996/08/19 18:32:58 1.60 --- http_main.c 1996/08/19 18:44:16 1.61 *** *** 340,348 void usage(char *bin) { ! fprintf(stderr,"Usage: %s [-d directory] [-f file] [-v]\n",bin); fprintf(stderr,"-d directory : specify an alternate initial ServerRoot\n"); fprintf(stderr,"-f file : specify an alternate ServerConfigFile\n"); exit(1); } --- 340,350 void usage(char *bin) { ! fprintf(stderr,"Usage: %s [-d directory] [-f file] [-v] [-h]\n",bin); fprintf(stderr,"-d directory : specify an alternate initial ServerRoot\n"); fprintf(stderr,"-f file : specify an alternate ServerConfigFile\n"); + fprintf(stderr,"-v : show version number\n"); + fprintf(stderr,"-h : list directives\n"); exit(1); } *** *** 1811,1816 --- 1813,1833 } /* standalone_main */ + void show_directives() + { + extern module *prelinked_modules[]; + extern char *module_names[]; + command_rec *pc; + int n; + int t; + + for(t=0 ; prelinked_modules[t] ; ++t) + ; + for(n=0 ; prelinked_modules[n] ; ++n) + for(pc=prelinked_modules[n]->cmds ; pc && pc->name ; ++pc) + printf("%s\t%s\t%s\n",pc->name,pc->errmsg,module_names[t-n-1]); + } + extern char *optarg; extern int optind; *** *** 1841,1847 strcpy (server_root, HTTPD_ROOT); strcpy (server_confname, SERVER_CONFIG_FILE); ! while((c = getopt(argc,argv,"Xd:f:v")) != -1) { switch(c) { case 'd': strcpy (server_root, optarg); --- 1858,1864 strcpy (server_root, HTTPD_ROOT); strcpy (server_confname, SERVER_CONFIG_FILE); ! while((c = getopt(argc,argv,"Xd:f:vh")) != -1) { switch(c) { case 'd': strcpy (server_root, optarg); *** *** 1852,1857 --- 1869,1877 case 'v': printf("Server version %s.\n",SERVER_VERSION); exit(1); + case 'h': + show_directives(); + exit(1); case 'X': ++one_process; /* Weird debugging mode. */ break;
cvs commit: apache/src CHANGES
ben 96/08/19 13:59:22 Modified:src CHANGES Log: Document -h flag. Revision ChangesPath 1.52 +5 -1 apache/src/CHANGES
cvs commit: apache/src CHANGES mod_auth_anon.c mod_auth_msql.c
ben 96/08/19 14:18:31 Modified:src CHANGES mod_auth_anon.c mod_auth_msql.c Log: Fix misspellings of Authoritative. Revision ChangesPath 1.53 +3 -1 apache/src/CHANGES 1.7 +7 -7 apache/src/mod_auth_anon.c Index: mod_auth_anon.c === RCS file: /export/home/cvs/apache/src/mod_auth_anon.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C3 -r1.6 -r1.7 *** mod_auth_anon.c 1996/07/08 18:58:59 1.6 --- mod_auth_anon.c 1996/08/19 21:18:27 1.7 *** *** 108,114 int auth_anon_logemail; int auth_anon_verifyemail; int auth_anon_mustemail; ! int auth_anon_authorative; } anon_auth_config_rec; --- 108,114 int auth_anon_logemail; int auth_anon_verifyemail; int auth_anon_mustemail; ! int auth_anon_authoritative; } anon_auth_config_rec; *** *** 126,132 sec -> auth_anon_logemail =1; sec -> auth_anon_verifyemail=0; sec -> auth_anon_mustemail =1; ! sec -> auth_anon_authorative=0; return sec; } --- 126,132 sec -> auth_anon_logemail =1; sec -> auth_anon_verifyemail=0; sec -> auth_anon_mustemail =1; ! sec -> auth_anon_authoritative=0; return sec; } *** *** 151,159 sec->auth_anon_verifyemail=arg; return NULL; } ! char *anon_set_authorative_flag (cmd_parms *cmd, anon_auth_config_rec *sec, int arg) { ! sec->auth_anon_authorative=arg; return NULL; } --- 151,159 sec->auth_anon_verifyemail=arg; return NULL; } ! char *anon_set_authoritative_flag (cmd_parms *cmd, anon_auth_config_rec *sec, int arg) { ! sec->auth_anon_authoritative=arg; return NULL; } *** *** 190,196 "Limited to 'on' or 'off'" }, { "Anonymous_LogEmail", anon_set_logemail_flag, NULL, OR_AUTHCFG, FLAG, "Limited to 'on' or 'off'" }, ! { "Anonymous_Authorative", anon_set_authorative_flag, NULL, OR_AUTHCFG, FLAG, "Limited to 'on' or 'off'" }, { NULL } --- 190,196 "Limited to 'on' or 'off'" }, { "Anonymous_LogEmail", anon_set_logemail_flag, NULL, OR_AUTHCFG, FLAG, "Limited to 'on' or 'off'" }, ! { "Anonymous_Authoritative", anon_set_authoritative_flag, NULL, OR_AUTHCFG, FLAG, "Limited to 'on' or 'off'" }, { NULL } *** *** 247,254 } return OK; } else { ! if (sec->auth_anon_authorative) { ! sprintf(errstr,"Anonymous: Authorative, Passwd <%s> not accepted", send_pw ? send_pw : "\'none\'"); log_error(errstr,r->server); return AUTH_REQUIRED; --- 247,254 } return OK; } else { ! if (sec->auth_anon_authoritative) { ! sprintf(errstr,"Anonymous: Authoritative, Passwd <%s> not accepted", send_pw ? send_pw : "\'none\'"); log_error(errstr,r->server); return AUTH_REQUIRED; 1.12 +21 -21apache/src/mod_auth_msql.c Index: mod_auth_msql.c === RCS file: /export/home/cvs/apache/src/mod_auth_msql.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C3 -r1.11 -r1.12 *** mod_auth_msql.c 1996/07/08 18:59:00 1.11 --- mod_auth_msql.c 1996/08/19 21:18:28 1.12 *** *** 143,149 * use a differt table with multiple entries. * * Auth_MSQL_nopasswd off ! * Auth_MSQL_Authorativeon * Auth_MSQL_EncryptedPasswords on * * These three optional fields (all set to the sensible defaults, --- 143,149 * use a differt table with multiple entries. * * Auth_MSQL_nopasswd off ! * Auth_MSQL_Authoritativeon * Auth_MSQL_EncryptedPasswords on * * These three optional fields (all set to the sensible defaults, *** *** 203,209 * Normally this table is compulsory, but it is * possible to use a fall-through to other methods * and use the mSQL module for group control only; ! * see the Authorative directive below. * * Auth_MSQLgrp_table Contains at least the fields with the * username and the groupname. A user which --- 203,209 * Normally this table is compulsory, but it is * possible t
cvs commit: apache/src util.c
ben 96/08/19 15:58:33 Modified:src util.c Log: Remove strange unused code of unknown provenance. Revision ChangesPath 1.17 +0 -38 apache/src/util.c Index: util.c === RCS file: /export/home/cvs/apache/src/util.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C3 -r1.16 -r1.17 *** util.c1996/08/19 17:54:52 1.16 --- util.c1996/08/19 22:58:28 1.17 *** *** 66,109 #include #endif - #ifdef NOTDEF - extern char** environ; - - /* taken from bdflush-1.5 for Linux source code */ - void inststr(char *dst[], int argc, char *src) - { - if (strlen(src) <= strlen(dst[0])) - { - char *ptr; - - for (ptr = dst[0]; *ptr; *(ptr++) = '\0'); - - strcpy(dst[0], src); - } else - { - /* stolen from the source to perl 4.036 (assigning to $0) */ - char *ptr, *ptr2; - int count; - ptr = dst[0] + strlen(dst[0]); - for (count = 1; count < argc; count++) { - if (dst[count] == ptr + 1) - ptr += strlen(++ptr); - } - if (environ[0] == ptr + 1) { - for (count = 0; environ[count]; count++) - if (environ[count] == ptr + 1) - ptr += strlen(++ptr); - } - count = 0; - for (ptr2 = dst[0]; ptr2 <= ptr; ptr2++) { - *ptr2 = '\0'; - count++; - } - strncpy(dst[0], src, count); - } - } - #endif - char *get_time() { time_t t; char *time_string; --- 66,71