mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
various fixes, mod_cgid interop, response/trailer forwarding rewritten, stability
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1763158 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -903,11 +903,11 @@ apr_size_t h2_util_bucket_print(char *buffer, apr_size_t bmax,
|
||||
off += apr_snprintf(buffer+off, bmax-off, "eor");
|
||||
}
|
||||
else {
|
||||
off += apr_snprintf(buffer+off, bmax-off, "meta(unknown)");
|
||||
off += apr_snprintf(buffer+off, bmax-off, "%s", b->type->name);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const char *btype = "data";
|
||||
const char *btype = b->type->name;
|
||||
if (APR_BUCKET_IS_FILE(b)) {
|
||||
btype = "file";
|
||||
}
|
||||
@@ -972,7 +972,8 @@ apr_size_t h2_util_bb_print(char *buffer, apr_size_t bmax,
|
||||
apr_status_t h2_append_brigade(apr_bucket_brigade *to,
|
||||
apr_bucket_brigade *from,
|
||||
apr_off_t *plen,
|
||||
int *peos)
|
||||
int *peos,
|
||||
h2_bucket_gate *should_append)
|
||||
{
|
||||
apr_bucket *e;
|
||||
apr_off_t len = 0, remain = *plen;
|
||||
@@ -983,7 +984,10 @@ apr_status_t h2_append_brigade(apr_bucket_brigade *to,
|
||||
while (!APR_BRIGADE_EMPTY(from)) {
|
||||
e = APR_BRIGADE_FIRST(from);
|
||||
|
||||
if (APR_BUCKET_IS_METADATA(e)) {
|
||||
if (!should_append(e)) {
|
||||
goto leave;
|
||||
}
|
||||
else if (APR_BUCKET_IS_METADATA(e)) {
|
||||
if (APR_BUCKET_IS_EOS(e)) {
|
||||
*peos = 1;
|
||||
apr_bucket_delete(e);
|
||||
@@ -1002,7 +1006,7 @@ apr_status_t h2_append_brigade(apr_bucket_brigade *to,
|
||||
|
||||
if (remain < e->length) {
|
||||
if (remain <= 0) {
|
||||
return APR_SUCCESS;
|
||||
goto leave;
|
||||
}
|
||||
apr_bucket_split(e, (apr_size_t)remain);
|
||||
}
|
||||
@@ -1013,7 +1017,7 @@ apr_status_t h2_append_brigade(apr_bucket_brigade *to,
|
||||
len += e->length;
|
||||
remain -= e->length;
|
||||
}
|
||||
|
||||
leave:
|
||||
*plen = len;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
@@ -1282,7 +1286,6 @@ h2_request *h2_req_create(int id, apr_pool_t *pool, const char *method,
|
||||
{
|
||||
h2_request *req = apr_pcalloc(pool, sizeof(h2_request));
|
||||
|
||||
req->id = id;
|
||||
req->method = method;
|
||||
req->scheme = scheme;
|
||||
req->authority = authority;
|
||||
@@ -1380,11 +1383,11 @@ int h2_util_frame_print(const nghttp2_frame *frame, char *buffer, size_t maxlen)
|
||||
/*******************************************************************************
|
||||
* push policy
|
||||
******************************************************************************/
|
||||
void h2_push_policy_determine(struct h2_request *req, apr_pool_t *p, int push_enabled)
|
||||
int h2_push_policy_determine(apr_table_t *headers, apr_pool_t *p, int push_enabled)
|
||||
{
|
||||
h2_push_policy policy = H2_PUSH_NONE;
|
||||
if (push_enabled) {
|
||||
const char *val = apr_table_get(req->headers, "accept-push-policy");
|
||||
const char *val = apr_table_get(headers, "accept-push-policy");
|
||||
if (val) {
|
||||
if (ap_find_token(p, val, "fast-load")) {
|
||||
policy = H2_PUSH_FAST_LOAD;
|
||||
@@ -1407,6 +1410,6 @@ void h2_push_policy_determine(struct h2_request *req, apr_pool_t *p, int push_en
|
||||
policy = H2_PUSH_DEFAULT;
|
||||
}
|
||||
}
|
||||
req->push_policy = policy;
|
||||
return policy;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user