Lines Matching refs:c

25  	$(CC) $(CFLAGS) -c $*.c
27 -SRC = thttpd.c libhttpd.c fdwatch.c mmc.c timers.c match.c tdate_parse.c syslog.c
28 +SRC = thttpd.c libhttpd.c fdwatch.c mmc.c timers.c match.c tdate_parse.c syslog.c php_thttpd.c
30 OBJ = $(SRC:.c=.o) @LIBOBJS@
89 diff -ur thttpd-2.21b/fdwatch.c thttpd-2.21b-cool/fdwatch.c
90 --- thttpd-2.21b/fdwatch.c Fri Apr 13 07:36:08 2001
91 +++ thttpd-2.21b-cool/fdwatch.c Sat Sep 20 14:43:20 2003
120 diff -ur thttpd-2.21b/libhttpd.c thttpd-2.21b-cool/libhttpd.c
121 --- thttpd-2.21b/libhttpd.c Tue Apr 24 00:42:40 2001
122 +++ thttpd-2.21b-cool/libhttpd.c Sat Sep 20 14:43:29 2003
290 + s.c = hc->response;
370 + hc->response = s.c;
585 char c;
592 c = hc->read_buf[hc->checked_idx];
887 - "%s %c%04d", date_nozone, sign, zone );
941 + write(fd, bentries.c, bentries.len);
968 + return httpd_ntoa_buf.c;
1299 diff -ur thttpd-2.21b/mmc.c thttpd-2.21b-cool/mmc.c
1300 --- thttpd-2.21b/mmc.c Fri Apr 13 23:02:15 2001
1301 +++ thttpd-2.21b-cool/mmc.c Sat Sep 20 14:43:20 2003
1416 diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c
1417 --- thttpd-2.21b/thttpd.c Tue Apr 24 00:41:57 2001
1418 +++ thttpd-2.21b-cool/thttpd.c Sat Sep 20 14:43:20 2003
1484 static void handle_read( connecttab* c, struct timeval* tvP );
1485 static void handle_send( connecttab* c, struct timeval* tvP );
1486 +static void handle_send_resp( connecttab* c, struct timeval* tvP );
1487 +static void handle_read_body( connecttab* c, struct timeval* tvP );
1488 static void handle_linger( connecttab* c, struct timeval* tvP );
1489 static int check_throttles( connecttab* c );
1491 static void clear_throttles( connecttab* c, struct timeval* tvP );
1493 -static void clear_connection( connecttab* c, struct timeval* tvP );
1494 +static void clear_connection( connecttab* c, struct timeval* tvP, int );
1495 static void really_clear_connection( connecttab* c, struct timeval* tvP );
1507 +static void boot_request(connecttab *c, struct timeval *tvP);
1514 +#define RUN_HANDLER(type, c) if (handler_array[type]) handler_array[type](c, &tv)
1539 connecttab* c;
1643 c = (connecttab*) fdwatch_get_client_data( ridx );
1644 if ( c == (connecttab*) 0 )
1646 - hc = c->hc;
1647 - if ( c->conn_state == CNST_READING &&
1649 - handle_read( c, &tv );
1650 - else if ( c->conn_state == CNST_SENDING &&
1652 - handle_send( c, &tv );
1653 - else if ( c->conn_state == CNST_LINGERING &&
1655 - handle_linger( c, &tv );
1657 + fdwatch_check_fd(c->hc->conn_fd);
1659 + RUN_HANDLER(c->conn_state, c);
1725 - c = &connects[cnum];
1727 + c = free_connects[--next_free_connect];
1731 if ( c->hc == (httpd_conn*) 0 )
1737 + free_connects[next_free_connect++] = c;
1740 c->conn_state = CNST_READING;
1742 client_data.p = c;
1743 - c->idle_read_timer = tmr_create(
1746 - if ( c->idle_read_timer == (Timer*) 0 )
1751 - c->idle_send_timer = (Timer*) 0;
1752 c->wakeup_timer = (Timer*) 0;
1753 c->linger_timer = (Timer*) 0;
1754 c->bytes_sent = 0;
1755 c->numtnums = 0;
1756 + c->keep_alive = 0;
1757 + c->last_io = httpd_time_now;
1760 httpd_set_ndelay( c->hc->conn_fd );
1787 +setup_read_body(connecttab *c, struct timeval *tvP)
1789 + httpd_conn *hc = c->hc;
1793 + c->conn_state = CNST_READING_BODY;
1825 + clear_connection( c, tvP, 0 );
1834 + fdwatch_add_fd( hc->conn_fd, c, FDW_READ );
1838 +setup_sending(connecttab *c, int state, struct timeval *tvP)
1840 + httpd_conn *hc = c->hc;
1843 + c->conn_state = state;
1844 + c->started_at = tvP->tv_sec;
1845 + c->wouldblock_delay = 0;
1846 + client_data.p = c;
1849 + fdwatch_add_fd( hc->conn_fd, c, FDW_WRITE );
1852 +static void handle_request( connecttab *c, struct timeval *tvP);
1856 handle_read( connecttab* c, struct timeval* tvP )
1860 httpd_conn* hc = c->hc;
1867 - clear_connection( c, tvP );
1868 + clear_connection( c, tvP, 0 );
1879 - clear_connection( c, tvP );
1881 + if (! c->keep_alive) {
1884 + clear_connection( c, tvP, 0 );
1888 + clear_connection( c, tvP, 0 );
1899 + if (c->hc->file_address == (char *) 1) {
1903 + c->last_io = httpd_time_now;
1914 + client_data.p = c;
1918 + handle_request(c, tvP);
1924 +handle_request( connecttab *c, struct timeval *tvP)
1926 + httpd_conn* hc = c->hc;
1935 - clear_connection( c, tvP );
1936 + clear_connection( c, tvP, 0 );
1943 - clear_connection( c, tvP );
1944 + clear_connection( c, tvP, 0 );
1952 - clear_connection( c, tvP );
1953 + clear_connection( c, tvP, 0 );
1956 + boot_request(c, tvP);
1959 +static void boot_request(connecttab *c, struct timeval *tvP)
1961 + httpd_conn *hc = c->hc;
1966 - clear_connection( c, tvP );
1967 + clear_connection( c, tvP, 0 );
1972 + setup_read_body( c, tvP );
1982 c->bytes_sent = hc->bytes_sent;
1983 - clear_connection( c, tvP );
1984 + clear_connection( c, tvP, 1 );
1988 + c->last_io = (time_t) LONG_MAX;
1989 + c->wouldblock_delay = 0;
1992 if ( c->bytes_sent >= c->bytes_to_send )
1995 - clear_connection( c, tvP );
1996 + clear_connection( c, tvP, 1 );
2001 - c->conn_state = CNST_SENDING;
2002 - c->started_at = tvP->tv_sec;
2003 - c->wouldblock_delay = 0;
2004 - client_data.p = c;
2005 - tmr_cancel( c->idle_read_timer );
2006 - c->idle_read_timer = (Timer*) 0;
2007 - c->idle_send_timer = tmr_create(
2010 - if ( c->idle_send_timer == (Timer*) 0 )
2017 - fdwatch_add_fd( hc->conn_fd, c, FDW_WRITE );
2018 + setup_sending(c, CNST_SENDING, tvP);
2023 handle_send( connecttab* c, struct timeval* tvP )
2026 iv[1].iov_base = &(hc->file_address[c->bytes_sent]);
2027 iv[1].iov_len = MIN( c->bytes_to_send - c->bytes_sent, c->limit );
2039 - clear_connection( c, tvP );
2040 + clear_connection( c, tvP, 0 );
2045 - tmr_reset( tvP, c->idle_send_timer );
2046 + c->last_io = httpd_time_now;
2060 if ( c->bytes_sent >= c->bytes_to_send )
2063 - clear_connection( c, tvP );
2064 + clear_connection( c, tvP, 1 );
2083 +handle_read_body(connecttab *c, struct timeval *tvP)
2085 + httpd_conn *hc = c->hc;
2094 + clear_connection(c, tvP, 0);
2098 + c->last_io = httpd_time_now;
2103 + boot_request(c, tvP);
2109 +handle_send_resp(connecttab *c, struct timeval *tvP)
2111 + httpd_conn* hc = c->hc;
2123 + c->last_io = httpd_time_now;
2130 + clear_connection(c, tvP, dokeep);
2140 check_throttles( connecttab* c )
2146 -clear_connection( connecttab* c, struct timeval* tvP )
2147 +clear_connection( connecttab* c, struct timeval* tvP, int doKeep )
2153 - httpd_write_response( c->hc );
2154 + if (c->hc->responselen && c->conn_state != CNST_SENDING_RESP) {
2155 + setup_sending(c, CNST_SENDING_RESP, tvP);
2157 - if ( c->idle_read_timer != (Timer*) 0 )
2159 - tmr_cancel( c->idle_read_timer );
2160 - c->idle_read_timer = 0;
2162 - if ( c->idle_send_timer != (Timer*) 0 )
2164 - tmr_cancel( c->idle_send_timer );
2165 - c->idle_send_timer = 0;
2169 if ( c->wakeup_timer != (Timer*) 0 )
2171 tmr_cancel( c->wakeup_timer );
2176 - if ( c->hc->should_linger )
2178 + if ( c->hc->do_keep_alive && doKeep)
2180 - c->conn_state = CNST_LINGERING;
2181 + httpd_conn *hc = c->hc;
2182 + c->conn_state = CNST_READING;
2184 + client_data.p = c;
2185 + c->bytes_sent = 0;
2186 + c->numtnums = 0;
2187 + c->keep_alive = 1;
2189 + httpd_complete_request( c->hc, tvP );
2191 fdwatch_del_fd( c->hc->conn_fd );
2192 fdwatch_add_fd( c->hc->conn_fd, c, FDW_READ );
2194 + httpd_request_reset( c->hc, 1 );
2201 httpd_set_ndelay( c->hc->conn_fd );
2202 + handle_request(c, tvP);
2204 + else if ( c->hc->should_linger )
2206 + c->conn_state = CNST_LINGERING;
2208 client_data.p = c;
2209 c->linger_timer = tmr_create(
2216 + httpd_complete_request( c->hc, tvP );
2218 + fdwatch_del_fd( c->hc->conn_fd );
2219 + fdwatch_add_fd( c->hc->conn_fd, c, FDW_READ );
2221 + httpd_set_ndelay( c->hc->conn_fd );
2226 + httpd_complete_request( c->hc, tvP );
2227 really_clear_connection( c, tvP );
2233 tmr_cancel( c->linger_timer );
2234 c->linger_timer = 0;
2236 + free_connects[next_free_connect++] = c;
2237 c->conn_state = CNST_FREE;
2245 - connecttab* c;
2247 - c = (connecttab*) client_data.p;
2248 - c->idle_read_timer = (Timer*) 0;
2249 - if ( c->conn_state != CNST_FREE )
2253 - httpd_ntoa( &c->hc->client_addr ) );
2254 - httpd_send_err( c->hc, 408, httpd_err408title, "", httpd_err408form, "" );
2255 - clear_connection( c, nowP );
2263 - connecttab* c;
2265 - c = (connecttab*) client_data.p;
2266 - c->idle_send_timer = (Timer*) 0;
2267 - if ( c->conn_state != CNST_FREE )
2271 - httpd_ntoa( &c->hc->client_addr ) );
2272 - clear_connection( c, nowP );
2316 + hs->log_date_len = sprintf( hs->log_date, "%s %c%04d", date_nozone, sign,
2331 + connecttab *c = connects, *ce = c + maxconnects;
2336 + while (c < ce) {
2337 + switch (c->conn_state) {
2341 + if ((now - c->last_io) > IDLE_SEND_TIMELIMIT) {
2342 + clear_connection( c, nowP, 0 );
2349 + if ((now - c->last_io) > IDLE_READ_TIMELIMIT) {
2350 + clear_connection( c, nowP, 0 );
2357 + c++;