| /lighttpd1.4/src/ |
| H A D | response.c | 95 r->con->keep_alive_idle = r->conf.max_keep_alive_idle; in http_response_write_header() 100 && r->reqbody_length != r->reqbody_queue.bytes_in in http_response_write_header() 362 r->server_name = r->conf.server_name in http_response_config() 444 && (r->handler_module || !r->h2_connect_ext)) in http_response_prepare() 462 buffer_copy_buffer(&r->physical.rel_path, &r->uri.path); in http_response_prepare() 754 if (r->http_status >= 400 && r->http_status < 600) in http_response_write_prepare() 908 r->error_handler_saved_status = r->http_status; in http_response_call_error_handler() 909 r->error_handler_saved_method = r->http_method; in http_response_call_error_handler() 914 r->error_handler_saved_status = -r->http_status; in http_response_call_error_handler() 933 r->http_method = r->error_handler_saved_method; in http_response_has_error_handler() [all …]
|
| H A D | reqpool.c | 56 r->con = con; in request_init_data() 59 r->server_name = &r->uri.authority; in request_init_data() 88 r->keep_alive = 0; in request_reset() 91 r->h2id = 0; in request_reset() 99 r->te_chunked = 0; in request_reset() 189 r->server_name = &r->uri.authority; in request_reset_ex() 263 free(r); in request_pool_free() 286 reqpool = r; in request_release() 294 if (r) { in request_acquire() 302 r->con = con; in request_acquire() [all …]
|
| H A D | http-header-glue.c | 48 r->http_status = 500; in http_response_buffer_append_authority() 82 r->http_status = 500; in http_response_buffer_append_authority() 381 && (0 == r->http_status || 200 == r->http_status); in http_response_send_file() 619 r->keep_alive = 0; in http_response_backend_error() 628 switch (r->state) { in http_response_backend_done() 633 if (r->http_status < 500 && r->http_status != 400) in http_response_backend_done() 663 && r->gw_dechunk && !r->gw_dechunk->done in http_response_backend_done() 771 &r->write_queue, fd, toread, r->conf.errh) in http_response_append_splice() 773 &r->write_queue, fd, toread, r->conf.errh); in http_response_append_splice() 1077 if (0 == r->http_status || 101 == r->http_status) in http_response_check_1xx() [all …]
|
| H A D | request.c | 340 r->http_host = http_header_request_set_ptr(r, HTTP_HEADER_HOST, in http_request_header_set_Host() 467 if (0 == r->reqbody_length) r->reqbody_length = clen; in http_request_parse_single_header() 526 r->keep_alive = (HTTP_VERSION_1_0 != r->http_version); in http_request_parse_proto_loose() 609 buffer_copy_buffer(&r->target, r->http_host); in http_request_validate_pseudohdrs() 611 buffer_copy_buffer(&r->target_orig, &r->target); in http_request_validate_pseudohdrs() 983 if ((r->http_method == HTTP_METHOD_CONNECT && !r->h2_connect_ext) in http_request_parse_target() 1227 buffer_copy_buffer(&r->uri.authority, r->http_host); in http_request_parse() 1355 r->http_status = http_request_parse(r, scheme_port); in http_request_headers_process_h2() 1359 r->http_status = http_request_header_line_invalid(r, 400, in http_request_headers_process_h2() 1370 r->http_host ? r->http_host->ptr : "", in http_request_headers_process_h2() [all …]
|
| H A D | connections.c | 35 #define connection_set_state(r, n) ((r)->state = (n)) argument 190 if (r->http_status) plugins_call_handle_request_done(r); in connection_handle_response_end_state() 192 if (r->reqbody_length != r->reqbody_queue.bytes_in in connection_handle_response_end_state() 204 request_reset(r); in connection_handle_response_end_state() 208 r->bytes_read_ckpt = r->read_queue.bytes_in; in connection_handle_response_end_state() 209 r->bytes_written_ckpt = r->write_queue.bytes_out; in connection_handle_response_end_state() 370 r->write_queue.bytes_in = r->write_queue.bytes_out = 0; in connection_write_1xx_info() 471 if (r->handler_module && !r->resp_body_finished) { in connection_handle_write_state() 1074 r->reqbody_length = r->reqbody_queue.bytes_in; in connection_revents_err() 1227 request_st * const r = h2c->r[i]; in connection_state_machine_h2() local [all …]
|
| H A D | http_chunk.c | 71 if (r->resp_send_chunked) in http_chunk_append_read_fd_range() 83 if (r->resp_send_chunked) in http_chunk_append_read_fd_range() 99 if (r->resp_send_chunked) in http_chunk_append_file_ref_range() 160 if (r->resp_send_chunked in http_chunk_append_to_tempfile() 167 if (r->resp_send_chunked in http_chunk_append_to_tempfile() 180 if (r->resp_send_chunked in http_chunk_append_cq_to_tempfile() 277 if (r->gw_dechunk) { in http_chunk_close() 364 r->gw_dechunk->done = r->http_status; in http_chunk_decode_append_data() 378 if (r->resp_send_chunked) r->keep_alive = 0; in http_chunk_decode_append_data() 379 r->gw_dechunk->done = r->http_status; in http_chunk_decode_append_data() [all …]
|
| H A D | mod_echo.c | 38 && r->resp_body_started) { in mod_echo_request_body() 46 joblist_append(r->con); in mod_echo_request_body() 56 http_response_backend_done(r); in mod_echo_request_body() 87 rc = r->con->reqbody_read(r); in SUBREQUEST_FUNC() 96 return mod_echo_request_body(r); in SUBREQUEST_FUNC() 104 handler_t rc = r->con->reqbody_read(r); in SUBREQUEST_FUNC() 112 http_response_backend_done(r); in SUBREQUEST_FUNC() 122 if (NULL == r->handler_module in URIHANDLER_FUNC() 124 r->handler_module = p->self; in URIHANDLER_FUNC() 125 r->resp_body_started = 1; in URIHANDLER_FUNC() [all …]
|
| H A D | h2.c | 351 request_st * const r = h2c->r[i]; in h2_send_goaway_rst_stream() local 431 const request_st * const r = h2c->r[i]; in h2_send_refused_stream() local 511 request_st * const r = h2c->r[i]; in h2_recv_rst_stream() local 673 request_st * const r = h2c->r[i]; in h2_recv_priority_update() local 728 request_st * const r = h2c->r[i]; in h2_recv_priority() local 965 r->h2state = (r->h2state == H2_STATE_OPEN) in h2_recv_end_data() 1473 h2_retire_stream(r, r->con); in h2_parse_headers_frame() 2757 if (r->gw_dechunk && r->gw_dechunk->done in h2_send_end_stream() 2789 h2c->r[h2c->rused++] = r; in h2_init_stream() 2874 request_st * const r = h2c->r[i]; in h2_retire_con() local [all …]
|
| H A D | mod_cgi.c | 79 request_st *r; member 439 request_st * const r = hctx->r; in cgi_connection_close() local 565 r->con->srv->plugins_request_reset(r); in cgi_local_redir() 629 if (0 == r->http_status) r->http_status = 200; /* OK */ in cgi_process_rd_revents() 670 request_st * const r = hctx->r; in cgi_write_request() local 802 if (r->reqbody_length <= 1048576 && r->reqbody_length > 0) in cgi_create_env() 911 int serrh_fd = r->conf.serrh ? r->conf.serrh->fd : -1; in cgi_create_env() 1000 st = r->tmp_sce && buffer_is_equal(&r->tmp_sce->name, &r->physical.path) in URIHANDLER_FUNC() 1026 hctx->r = r; in URIHANDLER_FUNC() 1121 handler_t rc = r->con->reqbody_read(r); in SUBREQUEST_FUNC() [all …]
|
| H A D | http_cgi.c | 56 && r->http_status >= 300 && r->http_status < 400) { in http_cgi_local_redir() 60 r->target_orig.ptr); in http_cgi_local_redir() 70 if (r->reqbody_length) { in http_cgi_local_redir() 71 if (r->reqbody_length != r->reqbody_queue.bytes_in) in http_cgi_local_redir() 72 r->keep_alive = 0; in http_cgi_local_redir() 73 r->reqbody_length = 0; in http_cgi_local_redir() 77 if (r->http_status != 307 && r->http_status != 308) { in http_cgi_local_redir() 142 s = r->target_orig.ptr; in http_cgi_headers() 155 if (!buffer_is_equal(&r->target, &r->target_orig)) in http_cgi_headers() 231 if (r->conf.server_tag) { in http_cgi_headers() [all …]
|
| H A D | mod_webdav.c | 284 #define http_status_get(r) ((r)->http_status) argument 289 #define http_status_unset(r) ((r)->http_status = 0) argument 290 #define http_status_is_set(r) (0 != (r)->http_status) argument 4010 cbdata.r = r; in webdav_has_lock() 4182 handler_t rc = r->con->reqbody_read(r); in mod_webdav_propfind() 4363 pb.r = r; in mod_webdav_propfind() 4862 mod_webdav_write_cq(r, &r->reqbody_queue, fd); in mod_webdav_put_range() 4910 handler_t rc = r->con->reqbody_read(r); in mod_webdav_put() 5421 handler_t rc = r->con->reqbody_read(r); in mod_webdav_proppatch() 5641 handler_t rc = r->con->reqbody_read(r); in mod_webdav_lock() [all …]
|
| H A D | mod_status.c | 178 if (r->reqbody_length) { in mod_status_html_rtable_r() 179 buffer_append_int(b, (r->http_version <= HTTP_VERSION_1_1 || r->h2id) in mod_status_html_rtable_r() 382 if (r->conf.server_tag) in mod_status_handle_server_status_html() 393 if (!buffer_is_blank(r->server_name) && r->server_name != &r->uri.authority) { in mod_status_handle_server_status_html() 658 r->http_status = 204; in mod_status_handle_server_statistics() 672 r->http_status = 200; in mod_status_handle_server_statistics() 673 r->resp_body_finished = 1; in mod_status_handle_server_statistics() 690 r->http_status = 200; in mod_status_handle_server_status() 691 r->resp_body_finished = 1; in mod_status_handle_server_status() 749 if (r->conf.server_tag) in mod_status_handle_server_config() [all …]
|
| H A D | http_range.c | 198 http_range_multi (request_st * const r, in http_range_multi() argument 211 buffer * const tb = r->tmp_buf; in http_range_multi() 284 r->handler_module = NULL; in http_range_not_satisfiable() 313 http_range_single(r, ranges); in http_range_process() 317 http_range_multi(r, ranges, n); in http_range_process() 323 chunkqueue_length(&r->write_queue)); in http_range_process() 330 http_range_rfc7233 (request_st * const r) in http_range_rfc7233() argument 332 const int http_status = r->http_status; in http_range_rfc7233() 339 if (!r->resp_body_finished) in http_range_rfc7233() 371 if ((r->resp_htags in http_range_rfc7233() [all …]
|
| H A D | mod_wstunnel.c | 349 request_st * const r = hctx->gw.r; in wstunnel_create_env() local 358 r->http_status = (r->http_version > HTTP_VERSION_1_1) in wstunnel_create_env() 380 request_st * const r = hctx->gw.r; in wstunnel_stdin_append() local 456 if (!r->http_host || buffer_is_blank(r->http_host)) { in wstunnel_check_request() 729 request_st * const r = hctx->gw.r; in create_response_ietf_00() local 791 request_st * const r = hctx->gw.r; in create_response_rfc_6455() local 841 request_st * const r = hctx->gw.r; in mod_wstunnel_handshake_create_response() local 895 request_st * const r = hctx->gw.r; in send_ietf_00() local 934 request_st * const r = hctx->gw.r; in recv_ietf_00() local 1105 request_st * const r = hctx->gw.r; in send_rfc_6455() local [all …]
|
| H A D | response.h | 14 int http_response_parse(server *srv, request_st *r); 41 int http_response_send_1xx (request_st *r); 49 int http_response_buffer_append_authority(request_st *r, buffer *o); 50 int http_response_redirect_to_directory(request_st *r, int status); 53 void http_response_body_clear(request_st *r, int preserve_length); 54 void http_response_reset(request_st *r); 56 void http_response_backend_done (request_st *r); 57 void http_response_backend_error (request_st *r); 58 void http_response_upgrade_read_body_unknown(request_st *r); 67 void http_response_write_header(request_st *r); [all …]
|
| H A D | mod_authn_gssapi.c | 156 r->http_status = 400; in mod_authn_gssapi_send_400_bad_request() 157 r->handler_module = NULL; in mod_authn_gssapi_send_400_bad_request() 259 r->http_status = 500; in mod_authn_gssapi_send_500_server_error() 260 r->handler_module = NULL; in mod_authn_gssapi_send_500_server_error() 266 r->http_status = 401; in mod_authn_gssapi_send_401_unauthorized_negotiate() 267 r->handler_module = NULL; in mod_authn_gssapi_send_401_unauthorized_negotiate() 363 if (r->http_host && !buffer_is_blank(r->http_host)) in mod_authn_gssapi_check_spnego() 616 r->http_status = 401; in mod_authn_gssapi_send_401_unauthorized_basic() 617 r->handler_module = NULL; in mod_authn_gssapi_send_401_unauthorized_basic() 671 if (r->http_host && !buffer_is_blank(r->http_host)) in mod_authn_gssapi_basic() [all …]
|
| H A D | mod_dirlisting.c | 962 : r->conf.server_tag in http_list_directory_footer() 1190 if (r->conf.use_xattr) { in http_list_directory() 1337 log_perror(r->conf.errh,__FILE__,__LINE__,"%s",r->physical.path.ptr); in URIHANDLER_FUNC() 1338 r->http_status = 500; in URIHANDLER_FUNC() 1361 r->http_status = 503; in URIHANDLER_FUNC() 1385 r->http_status = 403; in URIHANDLER_FUNC() 1400 r->http_status = 200; in URIHANDLER_FUNC() 1401 r->resp_body_started = 1; in URIHANDLER_FUNC() 1497 r->http_status = 0; in mod_dirlisting_cache_check() 1595 if (mod_dirlisting_write_cq(fd, &r->write_queue, r->conf.errh) in mod_dirlisting_cache_add() [all …]
|
| H A D | http_header.c | 224 return light_btst(r->resp_htags, id) in http_header_response_get() 232 light_bset(r->resp_htags, id); in http_header_response_set_ptr() 239 if (light_btst(r->resp_htags, id)) { in http_header_response_unset() 254 ? light_bset(r->resp_htags, id) in http_header_response_set() 261 light_bset(r->resp_htags, id); in http_header_response_append() 272 r->resp_header_repeated = 1; in http_header_response_insert_addtl() 282 light_bset(r->resp_htags, id); in http_header_response_insert() 291 return light_btst(r->rqst_htags, id) in http_header_request_get() 299 light_bset(r->rqst_htags, id); in http_header_request_set_ptr() 321 ? light_bset(r->rqst_htags, id) in http_header_request_set() [all …]
|
| H A D | mod_indexfile.c | 86 ? &r->physical.path in __attribute_nonnull__() 105 r->http_status = 403; in __attribute_nonnull__() 109 r->http_status = 500; in __attribute_nonnull__() 110 log_perror(r->conf.errh, __FILE__, __LINE__, in __attribute_nonnull__() 112 r->uri.path.ptr, r->physical.path.ptr); in __attribute_nonnull__() 120 buffer_copy_buffer(&r->uri.path, v); in __attribute_nonnull__() 123 buffer_copy_path_len2(&r->physical.path, in __attribute_nonnull__() 130 buffer_append_string_buffer(&r->uri.path, v); in __attribute_nonnull__() 147 mod_indexfile_patch_config(r, p); in URIHANDLER_FUNC() 150 if (r->conf.log_request_handling) { in URIHANDLER_FUNC() [all …]
|
| /lighttpd1.4/src/t/ |
| H A D | test_request.c | 16 r->http_host = NULL; in test_request_reset() 17 r->rqst_htags = 0; in test_request_reset() 18 r->reqbody_length = 0; in test_request_reset() 19 buffer_clear(&r->target_orig); in test_request_reset() 20 buffer_clear(&r->target); in test_request_reset() 28 test_request_reset(r); in run_http_request_parse() 171 assert(r->http_host && buffer_eq_slen(r->http_host, CONST_STR_LEN("[::1]"))); in test_request_http_request_parse() 192 assert(r->http_host && buffer_eq_slen(r->http_host, CONST_STR_LEN("[::1]"))); in test_request_http_request_parse() 607 request_st r; in test_request() local 620 free(r.target.ptr); in test_request() [all …]
|
| H A D | test_mod_staticfile.c | 18 r->http_status = 0; in test_mod_staticfile_reset() 19 r->resp_htags = 0; in test_mod_staticfile_reset() 21 http_response_body_clear(r, 0); in test_mod_staticfile_reset() 29 http_response_send_file(r, &r->physical.path, NULL); in run_http_response_send_file() 43 test_mod_staticfile_reset(r); in test_http_response_send_file() 162 r->conf.etag_flags = 0; in test_http_response_send_file() 394 request_st r; in test_mod_staticfile() local 414 r.rqst_htags = 0; in test_mod_staticfile() 422 buffer_free(r.tmp_buf); in test_mod_staticfile() 425 free(r.uri.path.ptr); in test_mod_staticfile() [all …]
|
| H A D | test_mod_userdir.c | 12 r->http_status = 0; in test_mod_userdir_reset() 21 test_mod_userdir_reset(r); in test_mod_userdir_docroot_handler() 28 test_mod_userdir_reset(r); in test_mod_userdir_docroot_handler() 34 test_mod_userdir_reset(r); in test_mod_userdir_docroot_handler() 40 test_mod_userdir_reset(r); in test_mod_userdir_docroot_handler() 46 test_mod_userdir_reset(r); in test_mod_userdir_docroot_handler() 52 test_mod_userdir_reset(r); in test_mod_userdir_docroot_handler() 169 request_st r; in test_mod_userdir() local 181 r.con = &con; in test_mod_userdir() 186 free(r.uri.path.ptr); in test_mod_userdir() [all …]
|
| H A D | test_mod_alias.c | 12 request_st r; in test_mod_alias_check() local 13 memset(&r, 0, sizeof(request_st)); in test_mod_alias_check() 19 assert(HANDLER_GO_ON == mod_alias_remap(&r, aliases)); in test_mod_alias_check() 28 assert(HANDLER_GO_ON == mod_alias_remap(&r, aliases)); in test_mod_alias_check() 29 assert(0 == strcmp(r.physical.basedir.ptr, in test_mod_alias_check() 31 assert(0 == strcmp(r.physical.path.ptr, in test_mod_alias_check() 69 assert(403 == r.http_status); in test_mod_alias_check() 70 r.http_status = 0; in test_mod_alias_check() 90 assert(0 == strcmp(r.physical.path.ptr, "/ba/x")); in test_mod_alias_check() 103 free(r.physical.path.ptr); in test_mod_alias_check() [all …]
|
| H A D | test_mod_indexfile.c | 15 r->http_status = 0; in test_mod_indexfile_reset() 26 if (r->http_status != status in run_mod_indexfile_tryfiles() 60 test_mod_indexfile_reset(r); in test_mod_indexfile_tryfiles() 65 test_mod_indexfile_reset(r); in test_mod_indexfile_tryfiles() 72 test_mod_indexfile_reset(r); in test_mod_indexfile_tryfiles() 78 test_mod_indexfile_reset(r); in test_mod_indexfile_tryfiles() 94 request_st r; in test_mod_indexfile() local 106 fdlog_free(r.conf.errh); in test_mod_indexfile() 108 free(r.uri.path.ptr); in test_mod_indexfile() 109 free(r.physical.path.ptr); in test_mod_indexfile() [all …]
|
| H A D | test_mod_ssi.c | 15 r->http_status = 0; in test_mod_ssi_reset() 16 r->resp_htags = 0; in test_mod_ssi_reset() 18 http_response_body_clear(r, 0); in test_mod_ssi_reset() 59 test_mod_ssi_reset(r, hctx); in test_mod_ssi_read_fd() 72 test_mod_ssi_reset(r, hctx); in test_mod_ssi_read_fd() 78 test_mod_ssi_reset(r, hctx); in test_mod_ssi_read_fd() 146 request_st r; in test_mod_ssi() local 161 fdlog_free(r.conf.errh); in test_mod_ssi() 162 buffer_free(r.tmp_buf); in test_mod_ssi() 165 free(r.uri.path.ptr); in test_mod_ssi() [all …]
|