mirror of
https://github.com/apache/httpd.git
synced 2025-08-07 04:02:58 +03:00
mod_h2 compiles warning free in maintainer-mode
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1696592 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -42,13 +42,13 @@ void h2_alt_svc_register_hooks(void)
|
|||||||
* - do not use quotation marks
|
* - do not use quotation marks
|
||||||
*/
|
*/
|
||||||
h2_alt_svc *h2_alt_svc_parse(const char *s, apr_pool_t *pool) {
|
h2_alt_svc *h2_alt_svc_parse(const char *s, apr_pool_t *pool) {
|
||||||
const char *sep = strchr(s, '=');
|
const char *sep = strchr((char *)s, '=');
|
||||||
if (sep) {
|
if (sep) {
|
||||||
const char *alpn = apr_pstrndup(pool, s, sep - s);
|
const char *alpn = apr_pstrndup(pool, s, sep - s);
|
||||||
const char *host = NULL;
|
const char *host = NULL;
|
||||||
int port = 0;
|
int port = 0;
|
||||||
s = sep + 1;
|
s = sep + 1;
|
||||||
sep = strchr(s, ':'); /* mandatory : */
|
sep = strchr((char *)s, ':'); /* mandatory : */
|
||||||
if (sep) {
|
if (sep) {
|
||||||
if (sep != s) { /* optional host */
|
if (sep != s) { /* optional host */
|
||||||
host = apr_pstrndup(pool, s, sep - s);
|
host = apr_pstrndup(pool, s, sep - s);
|
||||||
|
@@ -132,7 +132,7 @@ h2_mpm_type_t h2_conn_mpm_type(void) {
|
|||||||
return mpm_type;
|
return mpm_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
module *h2_conn_mpm_module(void) {
|
static module *h2_conn_mpm_module(void) {
|
||||||
check_modules();
|
check_modules();
|
||||||
return mpm_module;
|
return mpm_module;
|
||||||
}
|
}
|
||||||
@@ -366,7 +366,6 @@ conn_rec *h2_conn_create(conn_rec *master, apr_pool_t *pool)
|
|||||||
apr_status_t h2_conn_setup(h2_task_env *env, struct h2_worker *worker)
|
apr_status_t h2_conn_setup(h2_task_env *env, struct h2_worker *worker)
|
||||||
{
|
{
|
||||||
conn_rec *master = env->mplx->c;
|
conn_rec *master = env->mplx->c;
|
||||||
h2_config *cfg = h2_config_get(master);
|
|
||||||
|
|
||||||
ap_log_perror(APLOG_MARK, APLOG_TRACE3, 0, env->pool,
|
ap_log_perror(APLOG_MARK, APLOG_TRACE3, 0, env->pool,
|
||||||
"h2_conn(%ld): created from master", master->id);
|
"h2_conn(%ld): created from master", master->id);
|
||||||
|
@@ -313,86 +313,6 @@ static void fix_vary(request_rec *r)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Confirm that the status line is well-formed and matches r->status.
|
|
||||||
* If they don't match, a filter may have negated the status line set by a
|
|
||||||
* handler.
|
|
||||||
* Zap r->status_line if bad.
|
|
||||||
*/
|
|
||||||
static apr_status_t validate_status_line(request_rec *r)
|
|
||||||
{
|
|
||||||
char *end;
|
|
||||||
|
|
||||||
if (r->status_line) {
|
|
||||||
apr_size_t len = strlen(r->status_line);
|
|
||||||
if (len < 3
|
|
||||||
|| apr_strtoi64(r->status_line, &end, 10) != r->status
|
|
||||||
|| (end - 3) != r->status_line
|
|
||||||
|| (len >= 4 && ! apr_isspace(r->status_line[3]))) {
|
|
||||||
r->status_line = NULL;
|
|
||||||
return APR_EGENERAL;
|
|
||||||
}
|
|
||||||
/* Since we passed the above check, we know that length three
|
|
||||||
* is equivalent to only a 3 digit numeric http status.
|
|
||||||
* RFC2616 mandates a trailing space, let's add it.
|
|
||||||
*/
|
|
||||||
if (len == 3) {
|
|
||||||
r->status_line = apr_pstrcat(r->pool, r->status_line, " ", NULL);
|
|
||||||
return APR_EGENERAL;
|
|
||||||
}
|
|
||||||
return APR_SUCCESS;
|
|
||||||
}
|
|
||||||
return APR_EGENERAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Determine the protocol to use for the response. Potentially downgrade
|
|
||||||
* to HTTP/1.0 in some situations and/or turn off keepalives.
|
|
||||||
*
|
|
||||||
* also prepare r->status_line.
|
|
||||||
*/
|
|
||||||
static void basic_http_header_check(request_rec *r,
|
|
||||||
const char **protocol)
|
|
||||||
{
|
|
||||||
apr_status_t rv;
|
|
||||||
|
|
||||||
if (r->assbackwards) {
|
|
||||||
/* no such thing as a response protocol */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
rv = validate_status_line(r);
|
|
||||||
|
|
||||||
if (!r->status_line) {
|
|
||||||
r->status_line = ap_get_status_line(r->status);
|
|
||||||
} else if (rv != APR_SUCCESS) {
|
|
||||||
/* Status line is OK but our own reason phrase
|
|
||||||
* would be preferred if defined
|
|
||||||
*/
|
|
||||||
const char *tmp = ap_get_status_line(r->status);
|
|
||||||
if (!strncmp(tmp, r->status_line, 3)) {
|
|
||||||
r->status_line = tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Note that we must downgrade before checking for force responses. */
|
|
||||||
if (r->proto_num > HTTP_VERSION(1,0)
|
|
||||||
&& apr_table_get(r->subprocess_env, "downgrade-1.0")) {
|
|
||||||
r->proto_num = HTTP_VERSION(1,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* kludge around broken browsers when indicated by force-response-1.0
|
|
||||||
*/
|
|
||||||
if (r->proto_num == HTTP_VERSION(1,0)
|
|
||||||
&& apr_table_get(r->subprocess_env, "force-response-1.0")) {
|
|
||||||
*protocol = "HTTP/1.0";
|
|
||||||
r->connection->keepalive = AP_CONN_CLOSE;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
*protocol = AP_SERVER_PROTOCOL;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static void set_basic_http_header(request_rec *r, apr_table_t *headers)
|
static void set_basic_http_header(request_rec *r, apr_table_t *headers)
|
||||||
{
|
{
|
||||||
char *date = NULL;
|
char *date = NULL;
|
||||||
@@ -444,7 +364,6 @@ static int copy_header(void *ctx, const char *name, const char *value)
|
|||||||
|
|
||||||
static h2_response *create_response(h2_from_h1 *from_h1, request_rec *r)
|
static h2_response *create_response(h2_from_h1 *from_h1, request_rec *r)
|
||||||
{
|
{
|
||||||
apr_status_t status = APR_SUCCESS;
|
|
||||||
const char *clheader;
|
const char *clheader;
|
||||||
const char *ctype;
|
const char *ctype;
|
||||||
apr_table_t *headers;
|
apr_table_t *headers;
|
||||||
|
@@ -58,7 +58,7 @@ apr_status_t h2_request_rwrite(h2_request *req, request_rec *r, h2_mplx *m)
|
|||||||
req->method = r->method;
|
req->method = r->method;
|
||||||
req->authority = r->hostname;
|
req->authority = r->hostname;
|
||||||
req->path = r->uri;
|
req->path = r->uri;
|
||||||
if (!strchr(req->authority, ':') && r->parsed_uri.port_str) {
|
if (!strchr((char *)req->authority, ':') && r->parsed_uri.port_str) {
|
||||||
req->authority = apr_psprintf(req->pool, "%s:%s", req->authority,
|
req->authority = apr_psprintf(req->pool, "%s:%s", req->authority,
|
||||||
r->parsed_uri.port_str);
|
r->parsed_uri.port_str);
|
||||||
}
|
}
|
||||||
|
@@ -57,9 +57,6 @@ apr_status_t h2_switch_init(apr_pool_t *pool, server_rec *s)
|
|||||||
return APR_SUCCESS;
|
return APR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *const mod_ssl[] = { "mod_ssl.c", NULL};
|
|
||||||
static const char *const mod_core[] = { "core.c", NULL};
|
|
||||||
|
|
||||||
static int h2_protocol_propose(conn_rec *c, request_rec *r,
|
static int h2_protocol_propose(conn_rec *c, request_rec *r,
|
||||||
server_rec *s,
|
server_rec *s,
|
||||||
const apr_array_header_t *offers,
|
const apr_array_header_t *offers,
|
||||||
|
Reference in New Issue
Block a user