Skip to content

Commit

Permalink
installing response read filter really early to catch terminations fr…
Browse files Browse the repository at this point in the history
…om other post read filters
  • Loading branch information
Stefan Eissing committed Jul 22, 2015
1 parent 91df7b8 commit 4dbbd18
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 14 deletions.
5 changes: 0 additions & 5 deletions mod_h2/h2_from_h1.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,3 @@ apr_status_t h2_response_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
return ap_pass_brigade(f->next, bb);
}

void h2_from_h1_die(h2_from_h1 *from_h1, int status, request_rec *r)
{
r->status = status;
from_h1->response = create_response(from_h1, r);
}
2 changes: 0 additions & 2 deletions mod_h2/h2_from_h1.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ apr_status_t h2_from_h1_read_response(h2_from_h1 *from_h1,

struct h2_response *h2_from_h1_get_response(h2_from_h1 *from_h1);

void h2_from_h1_die(h2_from_h1 *from_h1, int status, request_rec *r);

h2_from_h1_state_t h2_from_h1_get_state(h2_from_h1 *from_h1);

apr_status_t h2_response_output_filter(ap_filter_t *f, apr_bucket_brigade *bb);
Expand Down
7 changes: 6 additions & 1 deletion mod_h2/h2_h2.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ void h2_h2_register_hooks(void)
ap_hook_process_connection(h2_h2_remove_timeout,
mod_reqtimeout, NULL, APR_HOOK_LAST);

ap_hook_post_read_request(h2_h2_post_read_req, NULL, NULL, APR_HOOK_MIDDLE);
/* With "H2SerializeHeaders On", we install the filter in this hook
* that parses the response. This needs to happen before any other post
* read function terminates the request with an error. Otherwise we will
* never see the response.
*/
ap_hook_post_read_request(h2_h2_post_read_req, NULL, NULL, APR_HOOK_REALLY_FIRST);
}

int h2_h2_remove_timeout(conn_rec* c)
Expand Down
4 changes: 0 additions & 4 deletions mod_h2/h2_task_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,3 @@ apr_status_t h2_task_output_write(h2_task_output *output,
f, bb, output->env->io);
}

void h2_task_output_die(h2_task_output *output, int status, request_rec *r)
{
h2_from_h1_die(output->from_h1, status, r);
}
2 changes: 0 additions & 2 deletions mod_h2/h2_task_output.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,4 @@ void h2_task_output_close(h2_task_output *output);

int h2_task_output_has_started(h2_task_output *output);

void h2_task_output_die(h2_task_output *output, int status, request_rec *r);

#endif /* defined(__mod_h2__h2_task_output__) */
1 change: 1 addition & 0 deletions sandbox/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ test: \
#@$(INST_DIR)/bin/apachectl restart
@bash test_curl_altsvc.sh http://$(HTTP_AUTH) https://$(HTTPS_AUTH)
@bash test_alt_host.sh https://$(HTTPS_AUTH)
@bash test_alt_host.sh https://$(HTTPS_AUTH2)
@bash test_nghttp_get.sh https://$(HTTPS_AUTH)
@bash test_nghttp_post.sh https://$(HTTPS_AUTH)
@bash test_curl_get.sh https://$(HTTPS_AUTH)
Expand Down

0 comments on commit 4dbbd18

Please sign in to comment.