| /mOS-networking-stack/samples/lighttpd-1.4.32/src/ |
| H A D | connections.c | 90 i = con->ndx; in connection_del() 105 con->ndx = -1; in connection_del() 123 if (con->ssl) SSL_free(con->ssl); 128 fdevent_event_del(srv->ev, &(con->fde_ndx), con->fd); 330 UNUSED(con); 454 if ((!con->http_status || con->http_status == 200) && con->uri.path->used && 679 con = calloc(1, sizeof(*con)); 830 if (con->x) buffer_reset(con->x); 862 if (con->x) con->x->used = 0; 1388 SSL_set_app_data(con->ssl, con); [all …]
|
| H A D | response.c | 49 con->request_count > con->conf.max_keep_alive_requests) || in http_response_write_header() 53 con->keep_alive_idle = con->conf.max_keep_alive_idle; in http_response_write_header() 214 (con->http_status != 0 && con->http_status != 200)) { in http_response_prepare() 224 if (con->mode == DIRECT && con->physical.path->used == 0) { in http_response_prepare() 288 con->request.uri->used = qstr - con->request.uri->ptr; in http_response_prepare() 289 con->request.uri->ptr[con->request.uri->used++] = '\0'; in http_response_prepare() 295 buffer_copy_string_len(con->uri.path_raw, con->request.uri->ptr, qstr - con->request.uri->ptr); in http_response_prepare() 356 if (con->conf.is_ssl && con->conf.ssl_verifyclient) { in http_response_prepare() 588 if (con->uri.path->ptr[con->uri.path->used - 2] != '/') { in http_response_prepare() 711 con->uri.path->ptr[con->uri.path->used - 1] = '\0'; in http_response_prepare() [all …]
|
| H A D | request.c | 23 UNUSED(con); in request_check_hostname() 308 "fd:", con->fd, in http_request_parse() 318 …buffer_copy_string_len(con->parse_request, con->request.request->ptr + 2, con->request.request->us… in http_request_parse() 321 buffer_copy_string_buffer(con->parse_request, con->request.request); in http_request_parse() 507 buffer_copy_string_buffer(con->request.orig_uri, con->request.uri); in http_request_parse() 532 con->keep_alive = 0; in http_request_parse() 553 con->keep_alive = 0; in http_request_parse() 1068 con->header_len = i; in http_request_parse() 1077 con->keep_alive = 1; in http_request_parse() 1110 0 != request_check_hostname(srv, con, con->request.http_host)) { in http_request_parse() [all …]
|
| H A D | http-header-glue.c | 126 if (con->conf.is_ssl) { in http_response_redirect_to_directory() 145 con->http_status = 500; in http_response_redirect_to_directory() 211 con->http_status = 301; in http_response_redirect_to_directory() 212 con->file_finished = 1; in http_response_redirect_to_directory() 260 if (etag_is_equal(con->physical.etag, con->request.http_if_none_match)) { in http_response_handle_cachable() 290 con->mode = DIRECT; in http_response_handle_cachable() 300 con->mode = DIRECT; in http_response_handle_cachable() 316 con->http_status = 304; in http_response_handle_cachable() 320 con->http_status = 412; in http_response_handle_cachable() 321 con->mode = DIRECT; in http_response_handle_cachable() [all …]
|
| H A D | mod_staticfile.c | 164 if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) { in http_response_parse_range() 190 con->http_status = 416; in http_response_parse_range() 281 con->http_status = 416; in http_response_parse_range() 411 if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) { in URIHANDLER_FUNC() 412 con->http_status = 403; in URIHANDLER_FUNC() 424 con->http_status = 403; in URIHANDLER_FUNC() 436 con->http_status = 404; in URIHANDLER_FUNC() 494 if (con->request.http_range && con->conf.range_requests) { in URIHANDLER_FUNC() 539 http_chunk_append_file(srv, con, con->physical.path, 0, sce->st.st_size); in URIHANDLER_FUNC() 541 con->http_status = 200; in URIHANDLER_FUNC() [all …]
|
| H A D | mod_cgi.c | 331 con->http_status = 302; in cgi_response_parse() 370 con->file_finished = 1; in cgi_demux_response() 520 connection *con; in cgi_connection_close() local 590 con->mode = DIRECT; in cgi_connection_close() 654 con->mode = DIRECT; in cgi_handle_fdevent() 673 con->file_started = 1; in cgi_handle_fdevent() 914 …ntohs(con->dst_addr.plain.sa_family == AF_INET6 ? con->dst_addr.ipv6.sin6_port : con->dst_addr.ipv… in cgi_create_env() 1163 con->mode = p->id; in cgi_create_env() 1266 con->mode = DIRECT; in URIHANDLER_FUNC() 1379 con->mode = DIRECT; in SUBREQUEST_FUNC() [all …]
|
| H A D | http_chunk.c | 48 chunkqueue_append_buffer(con->write_queue, b); in http_chunk_append_len() 57 if (!con) return -1; in http_chunk_append_file() 59 cq = con->write_queue; in http_chunk_append_file() 62 http_chunk_append_len(srv, con, len); in http_chunk_append_file() 77 if (!con) return -1; in http_chunk_append_buffer() 79 cq = con->write_queue; in http_chunk_append_buffer() 97 if (!con) return -1; in http_chunk_append_mem() 99 cq = con->write_queue; in http_chunk_append_mem() 111 http_chunk_append_len(srv, con, len - 1); in http_chunk_append_mem() 125 if (!con) { in http_chunkqueue_length() [all …]
|
| H A D | mod_webdav.c | 481 UNUSED(con); in webdav_gen_prop_tag() 666 UNUSED(con); in webdav_copy_file() 998 UNUSED(con); in webdav_parse_chunkqueue() 1203 UNUSED(con); in webdav_has_lock() 1241 switch (stat_cache_get_entry(srv, con, con->physical.path, &sce)) { in URIHANDLER_FUNC() 1537 if (!webdav_has_lock(srv, con, p, con->uri.path)) { in URIHANDLER_FUNC() 1622 if (!webdav_has_lock(srv, con, p, con->uri.path)) { in URIHANDLER_FUNC() 1795 if (!webdav_has_lock(srv, con, p, con->uri.path)) { in URIHANDLER_FUNC() 1931 webdav_delete_dir(srv, con, p, &(con->physical), b); /* content */ in URIHANDLER_FUNC() 2036 webdav_delete_file(srv, con, p, &(con->physical), b); in URIHANDLER_FUNC() [all …]
|
| H A D | plugin.h | 11 static handler_t x(server *srv, connection *con, void *p_d) 67 handler_t plugins_call_handle_uri_raw(server *srv, connection *con); 68 handler_t plugins_call_handle_uri_clean(server *srv, connection *con); 70 handler_t plugins_call_handle_subrequest(server *srv, connection *con); 71 handler_t plugins_call_handle_request_done(server *srv, connection *con); 72 handler_t plugins_call_handle_docroot(server *srv, connection *con); 73 handler_t plugins_call_handle_physical(server *srv, connection *con); 75 handler_t plugins_call_handle_joblist(server *srv, connection *con); 76 handler_t plugins_call_connection_reset(server *srv, connection *con); 87 int config_setup_connection(server *srv, connection *con); [all …]
|
| H A D | mod_proxy.c | 337 connection *con; in proxy_connection_close() local 342 con = hctx->remote_conn; in proxy_connection_close() 464 proxy_set_header(con, "X-Host", con->request.http_host->ptr); in proxy_create_env() 466 proxy_set_header(con, "X-Forwarded-Proto", con->conf.is_ssl ? "https" : "http"); in proxy_create_env() 932 con->mode = DIRECT; in SUBREQUEST_FUNC() 985 con->mode = DIRECT; in proxy_handle_fdevent() 1078 con->mode = DIRECT; in proxy_handle_fdevent() 1085 con->mode = DIRECT; in proxy_handle_fdevent() 1130 fn = con->uri.path; in mod_proxy_check_extension() 1214 con->uri.path, in mod_proxy_check_extension() [all …]
|
| H A D | configfile-glue.c | 234 if (con->conf.log_condition_handling) { in config_check_cond_nocache() 255 if (con->conf.log_condition_handling) { in config_check_cond_nocache() 294 l = con->uri.authority; in config_check_cond_nocache() 319 l = con->tlsext_server_name; in config_check_cond_nocache() 386 l = con->dst_addr_buf; in config_check_cond_nocache() 391 l = con->uri.scheme; in config_check_cond_nocache() 395 l = con->uri.path; in config_check_cond_nocache() 399 l = con->uri.query; in config_check_cond_nocache() 466 if (con->conf.log_condition_handling) { in config_check_cond_nocache() 558 con->cond_cache[i].patterncount = 0; in config_cond_cache_reset_item() [all …]
|
| H A D | mod_ssi.c | 279 if (con->authed_user->used) { in build_ssi_cgi_vars() 281 con->authed_user->ptr); in build_ssi_cgi_vars() 437 stat_cache_get_entry(srv, con, con->physical.path, &sce); in process_ssi_stmt() 578 buffer_copy_string_len(p->stat_fn, con->uri.path->ptr, sl - con->uri.path->ptr + 1); in process_ssi_stmt() 1058 chunkqueue_append_file(con->write_queue, con->physical.path, i, s.size - i); in mod_ssi_handle_request() 1071 con->file_started = 1; in mod_ssi_handle_request() 1072 con->file_finished = 1; in mod_ssi_handle_request() 1073 con->mode = p->id; in mod_ssi_handle_request() 1088 stat_cache_get_entry(srv, con, con->physical.path, &sce); in mod_ssi_handle_request() 1164 con->http_status = 500; in URIHANDLER_FUNC() [all …]
|
| H A D | mod_fastcgi.c | 1470 connection *con; in fcgi_connection_close() local 1907 … ntohs(con->dst_addr.plain.sa_family ? con->dst_addr.ipv6.sin6_port : con->dst_addr.ipv4.sin_port) in fcgi_create_env() 2019 if (!buffer_is_equal(con->request.uri, con->request.orig_uri)) { in fcgi_create_env() 2038 FCGI_ENV_ADD_CHECK(fcgi_env_add_request_headers(srv, con, p), con); in fcgi_create_env() 3207 if (con->http_status != 400) con->http_status = 503; in SUBREQUEST_FUNC() 3399 con->uri.path, "?", con->uri.query, in fcgi_handle_fdevent() 3470 fn = uri_path_handler ? con->uri.path : con->physical.path; in fcgi_check_extension() 3571 "all handlers for", con->uri.path, "?", con->uri.query, in fcgi_check_extension() 3646 con->uri.path->ptr[con->uri.path->used - 1] = '\0'; in fcgi_check_extension() 3654 con->uri.path->used -= con->request.pathinfo->used - 1; in fcgi_check_extension() [all …]
|
| H A D | mod_magnet.c | 254 connection *con; in magnet_stat() local 361 connection *con; in magnet_reqhdr_get() local 384 connection *con; in magnet_reqhdr_pairs() local 538 connection *con; in magnet_env_get() local 566 connection *con; in magnet_env_set() local 595 connection *con; in magnet_env_next() local 639 connection *con; in magnet_cgi_get() local 658 connection *con; in magnet_cgi_set() local 674 connection *con; in magnet_cgi_pairs() local 876 con->mode = DIRECT; in magnet_attract() [all …]
|
| H A D | mod_compress.c | 248 UNUSED(con); in deflate_file_to_buffer_gzip() 322 UNUSED(con); in deflate_file_to_buffer_deflate() 369 UNUSED(con); in deflate_file_to_buffer_bzip2() 434 …if (0 == strncmp(con->physical.path->ptr, con->physical.doc_root->ptr, con->physical.doc_root->use… in deflate_file_to_file() 435 buffer_append_string(p->ofn, con->physical.path->ptr + con->physical.doc_root->used - 1); in deflate_file_to_file() 660 con->file_finished = 1; in deflate_file_to_buffer() 661 con->file_started = 1; in deflate_file_to_buffer() 728 if (con->mode != DIRECT || con->http_status) return HANDLER_GO_ON; in PHYSICALPATH_FUNC() 748 if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) { in PHYSICALPATH_FUNC() 749 con->http_status = 403; in PHYSICALPATH_FUNC() [all …]
|
| H A D | mod_extforward.c | 362 if (con->conf.log_request_handling) { in URIHANDLER_FUNC() 381 if (con->conf.log_request_handling) { in URIHANDLER_FUNC() 447 if (con->plugin_ctx[p->id]) { in URIHANDLER_FUNC() 451 con->plugin_ctx[p->id] = NULL; in URIHANDLER_FUNC() 454 con->plugin_ctx[p->id] = handler_ctx_init(con->dst_addr, con->dst_addr_buf); in URIHANDLER_FUNC() 456 con->dst_addr = sock; in URIHANDLER_FUNC() 457 con->dst_addr_buf = buffer_init(); in URIHANDLER_FUNC() 465 clean_cond_cache(srv, con); in URIHANDLER_FUNC() 484 buffer_free(con->dst_addr_buf); in CONNECTION_FUNC() 490 con->plugin_ctx[p->id] = NULL; in CONNECTION_FUNC() [all …]
|
| H A D | mod_indexfile.c | 119 if (!config_check_cond(srv, con, dc)) continue; in mod_indexfile_patch_connection() 142 if (con->mode != DIRECT) return HANDLER_GO_ON; in URIHANDLER_FUNC() 145 if (con->uri.path->ptr[con->uri.path->used - 2] != '/') return HANDLER_GO_ON; in URIHANDLER_FUNC() 147 mod_indexfile_patch_connection(srv, con, p); in URIHANDLER_FUNC() 149 if (con->conf.log_request_handling) { in URIHANDLER_FUNC() 169 con->http_status = 403; in URIHANDLER_FUNC() 170 buffer_reset(con->physical.path); in URIHANDLER_FUNC() 179 con->http_status = 500; in URIHANDLER_FUNC() 183 con->uri.path, in URIHANDLER_FUNC() 184 "->", con->physical.path); in URIHANDLER_FUNC() [all …]
|
| H A D | mod_scgi.c | 1197 connection *con; in scgi_connection_cleanup() local 1534 … ntohs(con->dst_addr.plain.sa_family ? con->dst_addr.ipv6.sin6_port : con->dst_addr.ipv4.sin_port) in scgi_create_env() 1601 if (!buffer_is_equal(con->request.uri, con->request.orig_uri)) { in scgi_create_env() 2472 connection *con; in scgi_connection_close() local 2640 con->uri.path, in scgi_handle_fdevent() 2713 fn = uri_path_handler ? con->uri.path : con->physical.path; in scgi_check_extension() 2841 buffer_copy_string(con->request.pathinfo, con->uri.path->ptr); in scgi_check_extension() 2843 con->uri.path->ptr[con->uri.path->used - 1] = '\0'; in scgi_check_extension() 2851 con->uri.path->used -= con->request.pathinfo->used - 1; in scgi_check_extension() 2852 con->uri.path->ptr[con->uri.path->used - 1] = '\0'; in scgi_check_extension() [all …]
|
| H A D | mod_cml.c | 215 mod_cml_patch_connection(srv, con, p); in URIHANDLER_FUNC() 243 if (con->conf.log_request_handling) { in URIHANDLER_FUNC() 246 con->http_status = 500; in URIHANDLER_FUNC() 249 if (con->conf.log_request_handling) { in URIHANDLER_FUNC() 253 buffer_reset(con->physical.path); in URIHANDLER_FUNC() 259 con->http_status = 500; in URIHANDLER_FUNC() 269 mod_cml_patch_connection(srv, con, p); in URIHANDLER_FUNC() 281 switch(cache_call_lua(srv, con, p, con->physical.path)) { in URIHANDLER_FUNC() 287 con->http_status = 500; in URIHANDLER_FUNC() 294 buffer_reset(con->physical.path); in URIHANDLER_FUNC() [all …]
|
| H A D | server.c | 754 connection *con; in start_server() local 762 if (srv->cur_ts - con->read_idle_ts > con->conf.max_read_idle) { in start_server() 772 if (srv->cur_ts - con->read_idle_ts > con->keep_alive_idle) { in start_server() 839 con->fd, in start_server() 840 con->fcgi.fd, in start_server() 929 connection *con; in start_server() local 1998 if (srv->cur_ts - con->read_idle_ts > con->conf.max_read_idle) { in main() 2008 if (srv->cur_ts - con->read_idle_ts > con->keep_alive_idle) { in main() 2075 con->fd, in main() 2076 con->fcgi.fd, in main() [all …]
|
| H A D | mod_simple_vhost.c | 155 buffer_copy_string_buffer(out, con->conf.document_root); in build_doc_root() 159 if (HANDLER_ERROR == stat_cache_get_entry(srv, con, out, &sce)) { in build_doc_root() 195 if (!config_check_cond(srv, con, dc)) continue; in mod_simple_vhost_patch_connection() 229 mod_simple_vhost_patch_connection(srv, con, p); in mod_simple_vhost_docroot() 232 con->uri.authority->used && in mod_simple_vhost_docroot() 239 if ((con->uri.authority->used == 0) || in mod_simple_vhost_docroot() 240 build_doc_root(srv, con, p, p->doc_root, con->uri.authority)) { in mod_simple_vhost_docroot() 242 if (build_doc_root(srv, con, p, in mod_simple_vhost_docroot() 248 buffer_copy_string_buffer(con->physical.doc_root, p->doc_root); in mod_simple_vhost_docroot() 254 buffer_copy_string_buffer(con->server_name, con->uri.authority); in mod_simple_vhost_docroot() [all …]
|
| H A D | mod_cml_lua.c | 258 if (!buffer_is_empty(con->request.pathinfo)) { in cache_parse_lua() 274 buffer_copy_string_buffer(b, con->uri.query); in cache_parse_lua() 350 if (HANDLER_ERROR == stat_cache_get_entry(srv, con, b, &sce)) { in cache_parse_lua() 398 con->file_finished = 1; in cache_parse_lua() 427 chunkqueue_reset(con->write_queue); in cache_parse_lua() 431 chunkqueue_reset(con->write_queue); in cache_parse_lua() 437 buffer_copy_string_buffer(con->uri.path, p->baseurl); in cache_parse_lua() 438 buffer_append_string_buffer(con->uri.path, p->trigger_handler); in cache_parse_lua() 440 buffer_copy_string_buffer(con->physical.path, p->basedir); in cache_parse_lua() 443 chunkqueue_reset(con->write_queue); in cache_parse_lua() [all …]
|
| H A D | response.h | 8 int http_response_parse(server *srv, connection *con); 9 int http_response_write_header(server *srv, connection *con); 11 int response_header_insert(server *srv, connection *con, const char *key, size_t keylen, const char… 12 int response_header_overwrite(server *srv, connection *con, const char *key, size_t keylen, const c… 13 int response_header_append(server *srv, connection *con, const char *key, size_t keylen, const char… 15 handler_t http_response_prepare(server *srv, connection *con); 16 int http_response_redirect_to_directory(server *srv, connection *con); 17 int http_response_handle_cachable(server *srv, connection *con, buffer * mtime);
|
| H A D | mod_rewrite.c | 338 if (con->plugin_ctx[p->id]) { in URIHANDLER_FUNC() 340 con->plugin_ctx[p->id] = NULL; in URIHANDLER_FUNC() 350 if (con->plugin_ctx[p->id]) { in process_rewrite_rules() 351 hctx = con->plugin_ctx[p->id]; in process_rewrite_rules() 394 buffer_reset(con->request.uri); in process_rewrite_rules() 420 config_append_cond_match_buffer(con, p->conf.context, con->request.uri, num); in process_rewrite_rules() 432 if (con->plugin_ctx[p->id] == NULL) { in process_rewrite_rules() 434 con->plugin_ctx[p->id] = hctx; in process_rewrite_rules() 436 hctx = con->plugin_ctx[p->id]; in process_rewrite_rules() 463 if (HANDLER_ERROR != stat_cache_get_entry(srv, con, con->physical.path, &sce)) { in URIHANDLER_FUNC() [all …]
|
| H A D | mod_evhost.c | 166 static int mod_evhost_parse_host(connection *con,array *host) { in mod_evhost_parse_host() argument 168 register char *ptr = con->uri.authority->ptr + con->uri.authority->used - 1; in mod_evhost_parse_host() 175 for(;ptr > con->uri.authority->ptr;ptr--) { in mod_evhost_parse_host() 196 if (colon != con->uri.authority->ptr) { in mod_evhost_parse_host() 241 if (!config_check_cond(srv, con, dc)) continue; in mod_evhost_patch_connection() 268 if (con->uri.authority->used == 0) return HANDLER_GO_ON; in mod_evhost_uri_handler() 270 mod_evhost_patch_connection(srv, con, p); in mod_evhost_uri_handler() 279 mod_evhost_parse_host(con, parsed_host); in mod_evhost_uri_handler() 294 char *colon = strchr(con->uri.authority->ptr, ':'); in mod_evhost_uri_handler() 300 …buffer_append_string_len(p->tmp_buf, con->uri.authority->ptr, colon - con->uri.authority->ptr); /*… in mod_evhost_uri_handler() [all …]
|