]> granicus.if.org Git - apache/commitdiff
Merge of r1764236 from trunk:
authorStefan Eissing <icing@apache.org>
Tue, 11 Oct 2016 13:40:08 +0000 (13:40 +0000)
committerStefan Eissing <icing@apache.org>
Tue, 11 Oct 2016 13:40:08 +0000 (13:40 +0000)
mod_proxy_http2: renaming duplicate symbol clash between h2_proxy_util and h2_util externals

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1764238 13f79535-47bb-0310-9956-ffa450edef68

17 files changed:
CHANGES
modules/http2/NWGNUmod_http2
modules/http2/h2_mplx.c
modules/http2/h2_proxy_session.c
modules/http2/h2_proxy_session.h
modules/http2/h2_proxy_util.c
modules/http2/h2_proxy_util.h
modules/http2/h2_push.c
modules/http2/h2_push.h
modules/http2/h2_request.c
modules/http2/h2_session.c
modules/http2/h2_stream.c
modules/http2/h2_task.c
modules/http2/h2_util.c
modules/http2/h2_version.h
modules/http2/mod_http2.c
modules/http2/mod_proxy_http2.c

diff --git a/CHANGES b/CHANGES
index 173451da5cab11d54a06065e714d9b7835a1b8bd..3c18fdb1c0ebe00c1f85caf6b30f4bbdf0c29dac 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.24
 
+  *) mod_proxy_http2: fixed duplicate symbols with mod_http2.
+     [Stefan Eissing]
+  
   *) mod_http2: rewrite of how responses and trailers are transferred between
      master and slave connection. Reduction of internal states for tasks
      and streams, stability. Heuristic id generation for slave connections
index 9df167dd4fb89fb69e7644a7cb14ce816e314817..8f67a8dc0b1ab1b3c90410510894b9b2dc877b45 100644 (file)
@@ -368,12 +368,6 @@ $(OBJDIR)/mod_http2.imp : NWGNUmod_http2
        @echo $(DL) h2_log2,$(DL) >> $@
        @echo $(DL) h2_proxy_res_ignore_header,$(DL) >> $@
        @echo $(DL) h2_headers_add_h1,$(DL) >> $@
-       @echo $(DL) h2_req_create,$(DL) >> $@
-       @echo $(DL) h2_req_createn,$(DL) >> $@
-       @echo $(DL) h2_req_make,$(DL) >> $@
-       @echo $(DL) h2_util_camel_case_header,$(DL) >> $@
-       @echo $(DL) h2_util_frame_print,$(DL) >> $@
-       @echo $(DL) h2_util_ngheader_make_req,$(DL) >> $@
        @echo $(DL) nghttp2_is_fatal,$(DL) >> $@
        @echo $(DL) nghttp2_option_del,$(DL) >> $@
        @echo $(DL) nghttp2_option_new,$(DL) >> $@
index 4501e0a734f18c00528066574a02e9bd06411331..fae814930240ab5cd2017f344e1543cb47642c25 100644 (file)
@@ -1195,7 +1195,7 @@ static apr_status_t unschedule_slow_tasks(h2_mplx *m)
     /* Try to get rid of streams that occupy workers. Look for safe requests
      * that are repeatable. If none found, fail the connection.
      */
-    n = (m->workers_busy - m->workers_limit - h2_ihash_count(m->redo_tasks));
+    n = (m->workers_busy - m->workers_limit - (int)h2_ihash_count(m->redo_tasks));
     while (n > 0 && (task = get_latest_repeatable_unsubmitted_task(m))) {
         h2_task_rst(task, H2_ERR_CANCEL);
         h2_ihash_add(m->redo_tasks, task);
index 22f37e08578e20b2aff6ee90be23819565338493..77a7b76315053755ebec7c5ccd59ba6b7fa1a16a 100644 (file)
@@ -35,7 +35,7 @@ typedef struct h2_proxy_stream {
 
     const char *url;
     request_rec *r;
-    h2_request *req;
+    h2_proxy_request *req;
     int standalone;
 
     h2_stream_state_t state;
@@ -64,7 +64,7 @@ static apr_status_t proxy_session_pre_close(void *theconn)
         ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, session->c, 
                       "proxy_session(%s): pool cleanup, state=%d, streams=%d",
                       session->id, session->state, 
-                      (int)h2_ihash_count(session->streams));
+                      (int)h2_proxy_ihash_count(session->streams));
         session->aborted = 1;
         dispatch_event(session, H2_PROXYS_EV_PRE_CLOSE, 0, NULL);
         nghttp2_session_del(session->ngh2);
@@ -136,7 +136,7 @@ static int on_frame_recv(nghttp2_session *ngh2, const nghttp2_frame *frame,
     if (APLOGcdebug(session->c)) {
         char buffer[256];
         
-        h2_util_frame_print(frame, buffer, sizeof(buffer)/sizeof(buffer[0]));
+        h2_proxy_util_frame_print(frame, buffer, sizeof(buffer)/sizeof(buffer[0]));
         ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, APLOGNO(03341)
                       "h2_proxy_session(%s): recv FRAME[%s]",
                       session->id, buffer);
@@ -174,7 +174,7 @@ static int before_frame_send(nghttp2_session *ngh2,
     if (APLOGcdebug(session->c)) {
         char buffer[256];
 
-        h2_util_frame_print(frame, buffer, sizeof(buffer)/sizeof(buffer[0]));
+        h2_proxy_util_frame_print(frame, buffer, sizeof(buffer)/sizeof(buffer[0]));
         ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, APLOGNO(03343)
                       "h2_proxy_session(%s): sent FRAME[%s]",
                       session->id, buffer);
@@ -240,7 +240,7 @@ static apr_status_t h2_proxy_stream_add_header_out(h2_proxy_stream *stream,
         char *hname, *hvalue;
     
         hname = apr_pstrndup(stream->pool, n, nlen);
-        h2_util_camel_case_header(hname, nlen);
+        h2_proxy_util_camel_case_header(hname, nlen);
         hvalue = apr_pstrndup(stream->pool, v, vlen);
         
         ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, stream->session->c, 
@@ -383,7 +383,7 @@ static int on_stream_close(nghttp2_session *ngh2, int32_t stream_id,
         ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, APLOGNO(03360)
                       "h2_proxy_session(%s): stream=%d, closed, err=%d", 
                       session->id, stream_id, error_code);
-        stream = h2_ihash_get(session->streams, stream_id);
+        stream = h2_proxy_ihash_get(session->streams, stream_id);
         if (stream) {
             stream->error_code = error_code;
         }
@@ -488,7 +488,7 @@ static ssize_t stream_data_read(nghttp2_session *ngh2, int32_t stream_id,
                       "h2_proxy_stream(%s-%d): suspending", 
                       stream->session->id, stream_id);
         stream->suspended = 1;
-        h2_iq_add(stream->session->suspended, stream->id, NULL, NULL);
+        h2_proxy_iq_add(stream->session->suspended, stream->id, NULL, NULL);
         return NGHTTP2_ERR_DEFERRED;
     }
     else {
@@ -522,8 +522,8 @@ h2_proxy_session *h2_proxy_session_setup(const char *id, proxy_conn_rec *p_conn,
         session->state = H2_PROXYS_ST_INIT;
         session->window_bits_stream = window_bits_stream;
         session->window_bits_connection = window_bits_connection;
-        session->streams = h2_ihash_create(pool, offsetof(h2_proxy_stream, id));
-        session->suspended = h2_iq_create(pool, 5);
+        session->streams = h2_proxy_ihash_create(pool, offsetof(h2_proxy_stream, id));
+        session->suspended = h2_proxy_iq_create(pool, 5);
         session->done = done;
     
         session->input = apr_brigade_create(session->pool, session->c->bucket_alloc);
@@ -603,7 +603,7 @@ static apr_status_t open_stream(h2_proxy_session *session, const char *url,
     stream->input = apr_brigade_create(stream->pool, session->c->bucket_alloc);
     stream->output = apr_brigade_create(stream->pool, session->c->bucket_alloc);
     
-    stream->req = h2_req_create(1, stream->pool, 0);
+    stream->req = h2_proxy_req_create(1, stream->pool, 0);
 
     status = apr_uri_parse(stream->pool, url, &puri);
     if (status != APR_SUCCESS)
@@ -617,7 +617,7 @@ static apr_status_t open_stream(h2_proxy_session *session, const char *url,
         authority = apr_psprintf(stream->pool, "%s:%d", authority, puri.port);
     }
     path = apr_uri_unparse(stream->pool, &puri, APR_URI_UNP_OMITSITEPART);
-    h2_req_make(stream->req, stream->pool, r->method, scheme,
+    h2_proxy_req_make(stream->req, stream->pool, r->method, scheme,
                 authority, path, r->headers_in);
 
     /* Tuck away all already existing cookies */
@@ -631,7 +631,7 @@ static apr_status_t open_stream(h2_proxy_session *session, const char *url,
 
 static apr_status_t submit_stream(h2_proxy_session *session, h2_proxy_stream *stream)
 {
-    h2_ngheader *hd;
+    h2_proxy_ngheader *hd;
     nghttp2_data_provider *pp = NULL;
     nghttp2_data_provider provider;
     int rv;
@@ -664,7 +664,7 @@ static apr_status_t submit_stream(h2_proxy_session *session, h2_proxy_stream *st
     if (rv > 0) {
         stream->id = rv;
         stream->state = H2_STREAM_ST_OPEN;
-        h2_ihash_add(session->streams, stream);
+        h2_proxy_ihash_add(session->streams, stream);
         dispatch_event(session, H2_PROXYS_EV_STREAM_SUBMITTED, rv, NULL);
         
         return APR_SUCCESS;
@@ -806,7 +806,7 @@ static apr_status_t check_suspended(h2_proxy_session *session)
                               "h2_proxy_stream(%s-%d): resuming", 
                               session->id, stream_id);
                 stream->suspended = 0;
-                h2_iq_remove(session->suspended, stream_id);
+                h2_proxy_iq_remove(session->suspended, stream_id);
                 nghttp2_session_resume_data(session->ngh2, stream_id);
                 dispatch_event(session, H2_PROXYS_EV_STREAM_RESUMED, 0, NULL);
                 check_suspended(session);
@@ -816,7 +816,7 @@ static apr_status_t check_suspended(h2_proxy_session *session)
                 ap_log_cerror(APLOG_MARK, APLOG_WARNING, status, session->c, 
                               APLOGNO(03382) "h2_proxy_stream(%s-%d): check input", 
                               session->id, stream_id);
-                h2_iq_remove(session->suspended, stream_id);
+                h2_proxy_iq_remove(session->suspended, stream_id);
                 dispatch_event(session, H2_PROXYS_EV_STREAM_RESUMED, 0, NULL);
                 check_suspended(session);
                 return APR_SUCCESS;
@@ -824,7 +824,7 @@ static apr_status_t check_suspended(h2_proxy_session *session)
         }
         else {
             /* gone? */
-            h2_iq_remove(session->suspended, stream_id);
+            h2_proxy_iq_remove(session->suspended, stream_id);
             check_suspended(session);
             return APR_SUCCESS;
         }
@@ -893,7 +893,7 @@ static void ev_init(h2_proxy_session *session, int arg, const char *msg)
 {
     switch (session->state) {
         case H2_PROXYS_ST_INIT:
-            if (h2_ihash_empty(session->streams)) {
+            if (h2_proxy_ihash_empty(session->streams)) {
                 transit(session, "init", H2_PROXYS_ST_IDLE);
             }
             else {
@@ -1000,7 +1000,7 @@ static void ev_no_io(h2_proxy_session *session, int arg, const char *msg)
              * CPU cycles. Ideally, we'd like to do a blocking read, but that
              * is not possible if we have scheduled tasks and wait
              * for them to produce something. */
-            if (h2_ihash_empty(session->streams)) {
+            if (h2_proxy_ihash_empty(session->streams)) {
                 if (!is_accepting_streams(session)) {
                     /* We are no longer accepting new streams and have
                      * finished processing existing ones. Time to leave. */
@@ -1070,8 +1070,8 @@ static void ev_stream_done(h2_proxy_session *session, int stream_id,
         }
         
         stream->state = H2_STREAM_ST_CLOSED;
-        h2_ihash_remove(session->streams, stream_id);
-        h2_iq_remove(session->suspended, stream_id);
+        h2_proxy_ihash_remove(session->streams, stream_id);
+        h2_proxy_iq_remove(session->suspended, stream_id);
         if (session->done) {
             session->done(session, stream->r, complete, touched);
         }
@@ -1308,15 +1308,15 @@ static int done_iter(void *udata, void *val)
 void h2_proxy_session_cleanup(h2_proxy_session *session, 
                               h2_proxy_request_done *done)
 {
-    if (session->streams && !h2_ihash_empty(session->streams)) {
+    if (session->streams && !h2_proxy_ihash_empty(session->streams)) {
         cleanup_iter_ctx ctx;
         ctx.session = session;
         ctx.done = done;
         ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, APLOGNO(03366)
                       "h2_proxy_session(%s): terminated, %d streams unfinished",
-                      session->id, (int)h2_ihash_count(session->streams));
-        h2_ihash_iter(session->streams, done_iter, &ctx);
-        h2_ihash_clear(session->streams);
+                      session->id, (int)h2_proxy_ihash_count(session->streams));
+        h2_proxy_ihash_iter(session->streams, done_iter, &ctx);
+        h2_proxy_ihash_clear(session->streams);
     }
 }
 
@@ -1347,13 +1347,13 @@ static int win_update_iter(void *udata, void *val)
 void h2_proxy_session_update_window(h2_proxy_session *session, 
                                     conn_rec *c, apr_off_t bytes)
 {
-    if (session->streams && !h2_ihash_empty(session->streams)) {
+    if (session->streams && !h2_proxy_ihash_empty(session->streams)) {
         win_update_ctx ctx;
         ctx.session = session;
         ctx.c = c;
         ctx.bytes = bytes;
         ctx.updated = 0;
-        h2_ihash_iter(session->streams, win_update_iter, &ctx);
+        h2_proxy_ihash_iter(session->streams, win_update_iter, &ctx);
         
         if (!ctx.updated) {
             /* could not find the stream any more, possibly closed, update
index 7f0a194097f720fbe0ea5dffe8443bb7ce597325..0a3d86042efa4f7da1bcc5b67d9d33862eadba42 100644 (file)
@@ -20,8 +20,8 @@
 
 #include <nghttp2/nghttp2.h>
 
-struct h2_iqueue;
-struct h2_ihash_t;
+struct h2_proxy_iqueue;
+struct h2_proxy_ihash_t;
 
 typedef enum {
     H2_PROXYS_ST_INIT,             /* send initial SETTINGS, etc. */
@@ -73,8 +73,8 @@ struct h2_proxy_session {
     h2_proxys_state state;
     apr_interval_time_t wait_timeout;
 
-    struct h2_ihash_t *streams;
-    struct h2_iqueue *suspended;
+    struct h2_proxy_ihash_t *streams;
+    struct h2_proxy_iqueue *suspended;
     apr_size_t remote_max_concurrent;
     int last_stream_id;     /* last stream id processed by backend, or 0 */
     
index 215f8e4a4e95f98a84a2ee9aa22627a1b07dbb1d..024d36e5c0834948819f8546ef0f3beea838d8b6 100644 (file)
@@ -27,7 +27,7 @@
 #include "h2_proxy_util.h"
 
 /* h2_log2(n) iff n is a power of 2 */
-unsigned char h2_log2(int n)
+unsigned char h2_proxy_log2(int n)
 {
     int lz = 0;
     if (!n) {
@@ -59,7 +59,7 @@ unsigned char h2_log2(int n)
 /*******************************************************************************
  * ihash - hash for structs with int identifier
  ******************************************************************************/
-struct h2_ihash_t {
+struct h2_proxy_ihash_t {
     apr_hash_t *hash;
     size_t ioff;
 };
@@ -69,31 +69,31 @@ static unsigned int ihash(const char *key, apr_ssize_t *klen)
     return (unsigned int)(*((int*)key));
 }
 
-h2_ihash_t *h2_ihash_create(apr_pool_t *pool, size_t offset_of_int)
+h2_proxy_ihash_t *h2_proxy_ihash_create(apr_pool_t *pool, size_t offset_of_int)
 {
-    h2_ihash_t *ih = apr_pcalloc(pool, sizeof(h2_ihash_t));
+    h2_proxy_ihash_t *ih = apr_pcalloc(pool, sizeof(h2_proxy_ihash_t));
     ih->hash = apr_hash_make_custom(pool, ihash);
     ih->ioff = offset_of_int;
     return ih;
 }
 
-size_t h2_ihash_count(h2_ihash_t *ih)
+size_t h2_proxy_ihash_count(h2_proxy_ihash_t *ih)
 {
     return apr_hash_count(ih->hash);
 }
 
-int h2_ihash_empty(h2_ihash_t *ih)
+int h2_proxy_ihash_empty(h2_proxy_ihash_t *ih)
 {
     return apr_hash_count(ih->hash) == 0;
 }
 
-void *h2_ihash_get(h2_ihash_t *ih, int id)
+void *h2_proxy_ihash_get(h2_proxy_ihash_t *ih, int id)
 {
     return apr_hash_get(ih->hash, &id, sizeof(id));
 }
 
 typedef struct {
-    h2_ihash_iter_t *iter;
+    h2_proxy_ihash_iter_t *iter;
     void *ctx;
 } iter_ctx;
 
@@ -104,7 +104,7 @@ static int ihash_iter(void *ctx, const void *key, apr_ssize_t klen,
     return ictx->iter(ictx->ctx, (void*)val); /* why is this passed const?*/
 }
 
-int h2_ihash_iter(h2_ihash_t *ih, h2_ihash_iter_t *fn, void *ctx)
+int h2_proxy_ihash_iter(h2_proxy_ihash_t *ih, h2_proxy_ihash_iter_t *fn, void *ctx)
 {
     iter_ctx ictx;
     ictx.iter = fn;
@@ -112,30 +112,30 @@ int h2_ihash_iter(h2_ihash_t *ih, h2_ihash_iter_t *fn, void *ctx)
     return apr_hash_do(ihash_iter, &ictx, ih->hash);
 }
 
-void h2_ihash_add(h2_ihash_t *ih, void *val)
+void h2_proxy_ihash_add(h2_proxy_ihash_t *ih, void *val)
 {
     apr_hash_set(ih->hash, ((char *)val + ih->ioff), sizeof(int), val);
 }
 
-void h2_ihash_remove(h2_ihash_t *ih, int id)
+void h2_proxy_ihash_remove(h2_proxy_ihash_t *ih, int id)
 {
     apr_hash_set(ih->hash, &id, sizeof(id), NULL);
 }
 
-void h2_ihash_remove_val(h2_ihash_t *ih, void *val)
+void h2_proxy_ihash_remove_val(h2_proxy_ihash_t *ih, void *val)
 {
     int id = *((int*)((char *)val + ih->ioff));
     apr_hash_set(ih->hash, &id, sizeof(id), NULL);
 }
 
 
-void h2_ihash_clear(h2_ihash_t *ih)
+void h2_proxy_ihash_clear(h2_proxy_ihash_t *ih)
 {
     apr_hash_clear(ih->hash);
 }
 
 typedef struct {
-    h2_ihash_t *ih;
+    h2_proxy_ihash_t *ih;
     void **buffer;
     size_t max;
     size_t len;
@@ -151,7 +151,7 @@ static int collect_iter(void *x, void *val)
     return 0;
 }
 
-size_t h2_ihash_shift(h2_ihash_t *ih, void **buffer, size_t max)
+size_t h2_proxy_ihash_shift(h2_proxy_ihash_t *ih, void **buffer, size_t max)
 {
     collect_ctx ctx;
     size_t i;
@@ -160,15 +160,15 @@ size_t h2_ihash_shift(h2_ihash_t *ih, void **buffer, size_t max)
     ctx.buffer = buffer;
     ctx.max = max;
     ctx.len = 0;
-    h2_ihash_iter(ih, collect_iter, &ctx);
+    h2_proxy_ihash_iter(ih, collect_iter, &ctx);
     for (i = 0; i < ctx.len; ++i) {
-        h2_ihash_remove_val(ih, buffer[i]);
+        h2_proxy_ihash_remove_val(ih, buffer[i]);
     }
     return ctx.len;
 }
 
 typedef struct {
-    h2_ihash_t *ih;
+    h2_proxy_ihash_t *ih;
     int *buffer;
     size_t max;
     size_t len;
@@ -184,7 +184,7 @@ static int icollect_iter(void *x, void *val)
     return 0;
 }
 
-size_t h2_ihash_ishift(h2_ihash_t *ih, int *buffer, size_t max)
+size_t h2_proxy_ihash_ishift(h2_proxy_ihash_t *ih, int *buffer, size_t max)
 {
     icollect_ctx ctx;
     size_t i;
@@ -193,9 +193,9 @@ size_t h2_ihash_ishift(h2_ihash_t *ih, int *buffer, size_t max)
     ctx.buffer = buffer;
     ctx.max = max;
     ctx.len = 0;
-    h2_ihash_iter(ih, icollect_iter, &ctx);
+    h2_proxy_ihash_iter(ih, icollect_iter, &ctx);
     for (i = 0; i < ctx.len; ++i) {
-        h2_ihash_remove(ih, buffer[i]);
+        h2_proxy_ihash_remove(ih, buffer[i]);
     }
     return ctx.len;
 }
@@ -204,16 +204,16 @@ size_t h2_ihash_ishift(h2_ihash_t *ih, int *buffer, size_t max)
  * iqueue - sorted list of int
  ******************************************************************************/
 
-static void iq_grow(h2_iqueue *q, int nlen);
-static void iq_swap(h2_iqueue *q, int i, int j);
-static int iq_bubble_up(h2_iqueue *q, int i, int top, 
-                        h2_iq_cmp *cmp, void *ctx);
-static int iq_bubble_down(h2_iqueue *q, int i, int bottom, 
-                          h2_iq_cmp *cmp, void *ctx);
+static void iq_grow(h2_proxy_iqueue *q, int nlen);
+static void iq_swap(h2_proxy_iqueue *q, int i, int j);
+static int iq_bubble_up(h2_proxy_iqueue *q, int i, int top, 
+                        h2_proxy_iq_cmp *cmp, void *ctx);
+static int iq_bubble_down(h2_proxy_iqueue *q, int i, int bottom, 
+                          h2_proxy_iq_cmp *cmp, void *ctx);
 
-h2_iqueue *h2_iq_create(apr_pool_t *pool, int capacity)
+h2_proxy_iqueue *h2_proxy_iq_create(apr_pool_t *pool, int capacity)
 {
-    h2_iqueue *q = apr_pcalloc(pool, sizeof(h2_iqueue));
+    h2_proxy_iqueue *q = apr_pcalloc(pool, sizeof(h2_proxy_iqueue));
     if (q) {
         q->pool = pool;
         iq_grow(q, capacity);
@@ -222,18 +222,18 @@ h2_iqueue *h2_iq_create(apr_pool_t *pool, int capacity)
     return q;
 }
 
-int h2_iq_empty(h2_iqueue *q)
+int h2_proxy_iq_empty(h2_proxy_iqueue *q)
 {
     return q->nelts == 0;
 }
 
-int h2_iq_count(h2_iqueue *q)
+int h2_proxy_iq_count(h2_proxy_iqueue *q)
 {
     return q->nelts;
 }
 
 
-void h2_iq_add(h2_iqueue *q, int sid, h2_iq_cmp *cmp, void *ctx)
+void h2_proxy_iq_add(h2_proxy_iqueue *q, int sid, h2_proxy_iq_cmp *cmp, void *ctx)
 {
     int i;
     
@@ -251,7 +251,7 @@ void h2_iq_add(h2_iqueue *q, int sid, h2_iq_cmp *cmp, void *ctx)
     }
 }
 
-int h2_iq_remove(h2_iqueue *q, int sid)
+int h2_proxy_iq_remove(h2_proxy_iqueue *q, int sid)
 {
     int i;
     for (i = 0; i < q->nelts; ++i) {
@@ -271,12 +271,12 @@ int h2_iq_remove(h2_iqueue *q, int sid)
     return 0;
 }
 
-void h2_iq_clear(h2_iqueue *q)
+void h2_proxy_iq_clear(h2_proxy_iqueue *q)
 {
     q->nelts = 0;
 }
 
-void h2_iq_sort(h2_iqueue *q, h2_iq_cmp *cmp, void *ctx)
+void h2_proxy_iq_sort(h2_proxy_iqueue *q, h2_proxy_iq_cmp *cmp, void *ctx)
 {
     /* Assume that changes in ordering are minimal. This needs,
      * best case, q->nelts - 1 comparisons to check that nothing
@@ -304,7 +304,7 @@ void h2_iq_sort(h2_iqueue *q, h2_iq_cmp *cmp, void *ctx)
 }
 
 
-int h2_iq_shift(h2_iqueue *q)
+int h2_proxy_iq_shift(h2_proxy_iqueue *q)
 {
     int sid;
     
@@ -319,7 +319,7 @@ int h2_iq_shift(h2_iqueue *q)
     return sid;
 }
 
-static void iq_grow(h2_iqueue *q, int nlen)
+static void iq_grow(h2_proxy_iqueue *q, int nlen)
 {
     if (nlen > q->nalloc) {
         int *nq = apr_pcalloc(q->pool, sizeof(int) * nlen);
@@ -339,15 +339,15 @@ static void iq_grow(h2_iqueue *q, int nlen)
     }
 }
 
-static void iq_swap(h2_iqueue *q, int i, int j)
+static void iq_swap(h2_proxy_iqueue *q, int i, int j)
 {
     int x = q->elts[i];
     q->elts[i] = q->elts[j];
     q->elts[j] = x;
 }
 
-static int iq_bubble_up(h2_iqueue *q, int i, int top, 
-                        h2_iq_cmp *cmp, void *ctx) 
+static int iq_bubble_up(h2_proxy_iqueue *q, int i, int top, 
+                        h2_proxy_iq_cmp *cmp, void *ctx) 
 {
     int prev;
     while (((prev = (q->nalloc + i - 1) % q->nalloc), i != top) 
@@ -358,8 +358,8 @@ static int iq_bubble_up(h2_iqueue *q, int i, int top,
     return i;
 }
 
-static int iq_bubble_down(h2_iqueue *q, int i, int bottom, 
-                          h2_iq_cmp *cmp, void *ctx)
+static int iq_bubble_down(h2_proxy_iqueue *q, int i, int bottom, 
+                          h2_proxy_iq_cmp *cmp, void *ctx)
 {
     int next;
     while (((next = (q->nalloc + i + 1) % q->nalloc), i != bottom) 
@@ -371,7 +371,7 @@ static int iq_bubble_down(h2_iqueue *q, int i, int bottom,
 }
 
 /*******************************************************************************
- * h2_ngheader
+ * h2_proxy_ngheader
  ******************************************************************************/
 #define H2_HD_MATCH_LIT_CS(l, name)  \
     ((strlen(name) == sizeof(l) - 1) && !apr_strnatcasecmp(l, name))
@@ -397,7 +397,7 @@ static int count_header(void *ctx, const char *key, const char *value)
 #define NV_ADD_LIT_CS(nv, k, v)     add_header(nv, k, sizeof(k) - 1, v, strlen(v))
 #define NV_ADD_CS_CS(nv, k, v)      add_header(nv, k, strlen(k), v, strlen(v))
 
-static int add_header(h2_ngheader *ngh, 
+static int add_header(h2_proxy_ngheader *ngh, 
                       const char *key, size_t key_len,
                       const char *value, size_t val_len)
 {
@@ -418,11 +418,11 @@ static int add_table_header(void *ctx, const char *key, const char *value)
     return 1;
 }
 
-h2_ngheader *h2_util_ngheader_make_req(apr_pool_t *p, 
-                                       const struct h2_request *req)
+h2_proxy_ngheader *h2_util_ngheader_make_req(apr_pool_t *p, 
+                                       const struct h2_proxy_request *req)
 {
     
-    h2_ngheader *ngh;
+    h2_proxy_ngheader *ngh;
     size_t n;
     
     AP_DEBUG_ASSERT(req);
@@ -434,7 +434,7 @@ h2_ngheader *h2_util_ngheader_make_req(apr_pool_t *p,
     n = 4;
     apr_table_do(count_header, &n, req->headers, NULL);
     
-    ngh = apr_pcalloc(p, sizeof(h2_ngheader));
+    ngh = apr_pcalloc(p, sizeof(h2_proxy_ngheader));
     ngh->nv =  apr_pcalloc(p, n * sizeof(nghttp2_nv));
     NV_ADD_LIT_CS(ngh, ":scheme", req->scheme);
     NV_ADD_LIT_CS(ngh, ":authority", req->authority);
@@ -485,18 +485,18 @@ static int ignore_header(const literal *lits, size_t llen,
     return 0;
 }
 
-static int h2_req_ignore_header(const char *name, size_t len)
+static int h2_proxy_req_ignore_header(const char *name, size_t len)
 {
     return ignore_header(H2_LIT_ARGS(IgnoredRequestHeaders), name, len);
 }
 
 int h2_proxy_res_ignore_header(const char *name, size_t len)
 {
-    return (h2_req_ignore_header(name, len) 
+    return (h2_proxy_req_ignore_header(name, len) 
             || ignore_header(H2_LIT_ARGS(IgnoredProxyRespHds), name, len));
 }
 
-void h2_util_camel_case_header(char *s, size_t len)
+void h2_proxy_util_camel_case_header(char *s, size_t len)
 {
     size_t start = 1;
     size_t i;
@@ -528,7 +528,7 @@ static apr_status_t h2_headers_add_h1(apr_table_t *headers, apr_pool_t *pool,
 {
     char *hname, *hvalue;
     
-    if (h2_req_ignore_header(name, nlen)) {
+    if (h2_proxy_req_ignore_header(name, nlen)) {
         return APR_SUCCESS;
     }
     else if (H2_HD_MATCH_LIT("cookie", name, nlen)) {
@@ -553,18 +553,18 @@ static apr_status_t h2_headers_add_h1(apr_table_t *headers, apr_pool_t *pool,
     
     hname = apr_pstrndup(pool, name, nlen);
     hvalue = apr_pstrndup(pool, value, vlen);
-    h2_util_camel_case_header(hname, nlen);
+    h2_proxy_util_camel_case_header(hname, nlen);
     apr_table_mergen(headers, hname, hvalue);
     
     return APR_SUCCESS;
 }
 
-static h2_request *h2_req_createn(int id, apr_pool_t *pool, const char *method, 
+static h2_proxy_request *h2_proxy_req_createn(int id, apr_pool_t *pool, const char *method, 
                                   const char *scheme, const char *authority, 
                                   const char *path, apr_table_t *header, 
                                   int serialize)
 {
-    h2_request *req = apr_pcalloc(pool, sizeof(h2_request));
+    h2_proxy_request *req = apr_pcalloc(pool, sizeof(h2_proxy_request));
     
     req->method         = method;
     req->scheme         = scheme;
@@ -577,9 +577,9 @@ static h2_request *h2_req_createn(int id, apr_pool_t *pool, const char *method,
     return req;
 }
 
-h2_request *h2_req_create(int id, apr_pool_t *pool, int serialize)
+h2_proxy_request *h2_proxy_req_create(int id, apr_pool_t *pool, int serialize)
 {
-    return h2_req_createn(id, pool, NULL, NULL, NULL, NULL, NULL, serialize);
+    return h2_proxy_req_createn(id, pool, NULL, NULL, NULL, NULL, NULL, serialize);
 }
 
 typedef struct {
@@ -591,13 +591,13 @@ static int set_h1_header(void *ctx, const char *key, const char *value)
 {
     h1_ctx *x = ctx;
     size_t klen = strlen(key);
-    if (!h2_req_ignore_header(key, klen)) {
+    if (!h2_proxy_req_ignore_header(key, klen)) {
         h2_headers_add_h1(x->headers, x->pool, key, klen, value, strlen(value));
     }
     return 1;
 }
 
-apr_status_t h2_req_make(h2_request *req, apr_pool_t *pool,
+apr_status_t h2_proxy_req_make(h2_proxy_request *req, apr_pool_t *pool,
                          const char *method, const char *scheme, 
                          const char *authority, const char *path, 
                          apr_table_t *headers)
@@ -624,7 +624,7 @@ apr_status_t h2_req_make(h2_request *req, apr_pool_t *pool,
  * frame logging
  ******************************************************************************/
 
-int h2_util_frame_print(const nghttp2_frame *frame, char *buffer, size_t maxlen)
+int h2_proxy_util_frame_print(const nghttp2_frame *frame, char *buffer, size_t maxlen)
 {
     char scratch[128];
     size_t s_len = sizeof(scratch)/sizeof(scratch[0]);
index ebf77ecbde11f4e81bf4f422fb897b2e034fc751..2e4c94efd0cc7dcc0a654ad3a96648dd64bdf434 100644 (file)
 /*******************************************************************************
  * some debugging/format helpers
  ******************************************************************************/
-struct h2_request;
+struct h2_proxy_request;
 struct nghttp2_frame;
 
-int h2_util_frame_print(const nghttp2_frame *frame, char *buffer, size_t maxlen);
+int h2_proxy_util_frame_print(const nghttp2_frame *frame, char *buffer, size_t maxlen);
 
 /*******************************************************************************
  * ihash - hash for structs with int identifier
  ******************************************************************************/
-typedef struct h2_ihash_t h2_ihash_t;
-typedef int h2_ihash_iter_t(void *ctx, void *val);
+typedef struct h2_proxy_ihash_t h2_proxy_ihash_t;
+typedef int h2_proxy_ihash_iter_t(void *ctx, void *val);
 
 /**
  * Create a hash for structures that have an identifying int member.
  * @param pool the pool to use
  * @param offset_of_int the offsetof() the int member in the struct
  */
-h2_ihash_t *h2_ihash_create(apr_pool_t *pool, size_t offset_of_int);
+h2_proxy_ihash_t *h2_proxy_ihash_create(apr_pool_t *pool, size_t offset_of_int);
 
-size_t h2_ihash_count(h2_ihash_t *ih);
-int h2_ihash_empty(h2_ihash_t *ih);
-void *h2_ihash_get(h2_ihash_t *ih, int id);
+size_t h2_proxy_ihash_count(h2_proxy_ihash_t *ih);
+int h2_proxy_ihash_empty(h2_proxy_ihash_t *ih);
+void *h2_proxy_ihash_get(h2_proxy_ihash_t *ih, int id);
 
 /**
  * Iterate over the hash members (without defined order) and invoke
@@ -49,26 +49,26 @@ void *h2_ihash_get(h2_ihash_t *ih, int id);
  * @param ctx user supplied data passed into each iteration call
  * @return 0 if one iteration returned 0, otherwise != 0
  */
-int h2_ihash_iter(h2_ihash_t *ih, h2_ihash_iter_t *fn, void *ctx);
+int h2_proxy_ihash_iter(h2_proxy_ihash_t *ih, h2_proxy_ihash_iter_t *fn, void *ctx);
 
-void h2_ihash_add(h2_ihash_t *ih, void *val);
-void h2_ihash_remove(h2_ihash_t *ih, int id);
-void h2_ihash_remove_val(h2_ihash_t *ih, void *val);
-void h2_ihash_clear(h2_ihash_t *ih);
+void h2_proxy_ihash_add(h2_proxy_ihash_t *ih, void *val);
+void h2_proxy_ihash_remove(h2_proxy_ihash_t *ih, int id);
+void h2_proxy_ihash_remove_val(h2_proxy_ihash_t *ih, void *val);
+void h2_proxy_ihash_clear(h2_proxy_ihash_t *ih);
 
-size_t h2_ihash_shift(h2_ihash_t *ih, void **buffer, size_t max);
-size_t h2_ihash_ishift(h2_ihash_t *ih, int *buffer, size_t max);
+size_t h2_proxy_ihash_shift(h2_proxy_ihash_t *ih, void **buffer, size_t max);
+size_t h2_proxy_ihash_ishift(h2_proxy_ihash_t *ih, int *buffer, size_t max);
 
 /*******************************************************************************
  * iqueue - sorted list of int with user defined ordering
  ******************************************************************************/
-typedef struct h2_iqueue {
+typedef struct h2_proxy_iqueue {
     int *elts;
     int head;
     int nelts;
     int nalloc;
     apr_pool_t *pool;
-} h2_iqueue;
+} h2_proxy_iqueue;
 
 /**
  * Comparator for two int to determine their order.
@@ -81,26 +81,26 @@ typedef struct h2_iqueue {
  *     < 0: s1 should be sorted before s2
  *     > 0: s2 should be sorted before s1
  */
-typedef int h2_iq_cmp(int i1, int i2, void *ctx);
+typedef int h2_proxy_iq_cmp(int i1, int i2, void *ctx);
 
 /**
  * Allocate a new queue from the pool and initialize.
  * @param id the identifier of the queue
  * @param pool the memory pool
  */
-h2_iqueue *h2_iq_create(apr_pool_t *pool, int capacity);
+h2_proxy_iqueue *h2_proxy_iq_create(apr_pool_t *pool, int capacity);
 
 /**
  * Return != 0 iff there are no tasks in the queue.
  * @param q the queue to check
  */
-int h2_iq_empty(h2_iqueue *q);
+int h2_proxy_iq_empty(h2_proxy_iqueue *q);
 
 /**
  * Return the number of int in the queue.
  * @param q the queue to get size on
  */
-int h2_iq_count(h2_iqueue *q);
+int h2_proxy_iq_count(h2_proxy_iqueue *q);
 
 /**
  * Add a stream id to the queue. 
@@ -110,7 +110,7 @@ int h2_iq_count(h2_iqueue *q);
  * @param cmp the comparator for sorting
  * @param ctx user data for comparator 
  */
-void h2_iq_add(h2_iqueue *q, int sid, h2_iq_cmp *cmp, void *ctx);
+void h2_proxy_iq_add(h2_proxy_iqueue *q, int sid, h2_proxy_iq_cmp *cmp, void *ctx);
 
 /**
  * Remove the stream id from the queue. Return != 0 iff task
@@ -119,12 +119,12 @@ void h2_iq_add(h2_iqueue *q, int sid, h2_iq_cmp *cmp, void *ctx);
  * @param sid the stream id to remove
  * @return != 0 iff task was found in queue
  */
-int h2_iq_remove(h2_iqueue *q, int sid);
+int h2_proxy_iq_remove(h2_proxy_iqueue *q, int sid);
 
 /**
  * Remove all entries in the queue.
  */
-void h2_iq_clear(h2_iqueue *q);
+void h2_proxy_iq_clear(h2_proxy_iqueue *q);
 
 /**
  * Sort the stream idqueue again. Call if the task ordering
@@ -134,7 +134,7 @@ void h2_iq_clear(h2_iqueue *q);
  * @param cmp the comparator for sorting
  * @param ctx user data for the comparator 
  */
-void h2_iq_sort(h2_iqueue *q, h2_iq_cmp *cmp, void *ctx);
+void h2_proxy_iq_sort(h2_proxy_iqueue *q, h2_proxy_iq_cmp *cmp, void *ctx);
 
 /**
  * Get the first stream id from the queue or NULL if the queue is empty. 
@@ -143,38 +143,54 @@ void h2_iq_sort(h2_iqueue *q, h2_iq_cmp *cmp, void *ctx);
  * @param q the queue to get the first task from
  * @return the first stream id of the queue, 0 if empty
  */
-int h2_iq_shift(h2_iqueue *q);
+int h2_proxy_iq_shift(h2_proxy_iqueue *q);
 
 /*******************************************************************************
  * common helpers
  ******************************************************************************/
-/* h2_log2(n) iff n is a power of 2 */
-unsigned char h2_log2(int n);
+/* h2_proxy_log2(n) iff n is a power of 2 */
+unsigned char h2_proxy_log2(int n);
 
 /*******************************************************************************
  * HTTP/2 header helpers
  ******************************************************************************/
-void h2_util_camel_case_header(char *s, size_t len);
+void h2_proxy_util_camel_case_header(char *s, size_t len);
 int h2_proxy_res_ignore_header(const char *name, size_t len);
 
 /*******************************************************************************
  * nghttp2 helpers
  ******************************************************************************/
-typedef struct h2_ngheader {
+typedef struct h2_proxy_ngheader {
     nghttp2_nv *nv;
     apr_size_t nvlen;
-} h2_ngheader;
-h2_ngheader *h2_util_ngheader_make_req(apr_pool_t *p, 
-                                       const struct h2_request *req);
+} h2_proxy_ngheader;
+h2_proxy_ngheader *h2_util_ngheader_make_req(apr_pool_t *p, 
+                                             const struct h2_proxy_request *req);
 
 /*******************************************************************************
- * h2_request helpers
+ * h2_proxy_request helpers
  ******************************************************************************/
-struct h2_request *h2_req_create(int id, apr_pool_t *pool, int serialize);
-apr_status_t h2_req_make(struct h2_request *req, apr_pool_t *pool,
-                         const char *method, const char *scheme, 
-                         const char *authority, const char *path, 
-                         apr_table_t *headers);
+typedef struct h2_proxy_request h2_proxy_request;
+
+struct h2_proxy_request {
+    const char *method; /* pseudo header values, see ch. 8.1.2.3 */
+    const char *scheme;
+    const char *authority;
+    const char *path;
+    
+    apr_table_t *headers;
+    
+    apr_time_t request_time;
+    
+    unsigned int chunked : 1;   /* iff requst body needs to be forwarded as chunked */
+    unsigned int serialize : 1; /* iff this request is written in HTTP/1.1 serialization */
+};
+
+h2_proxy_request *h2_proxy_req_create(int id, apr_pool_t *pool, int serialize);
+apr_status_t h2_proxy_req_make(h2_proxy_request *req, apr_pool_t *pool,
+                               const char *method, const char *scheme, 
+                               const char *authority, const char *path, 
+                               apr_table_t *headers);
 
 
 
index 6de93bd7d5a103b2c8785ef00f77f850aecad1b1..455b7f060021870d11be27a9d599970e5531b5f7 100644 (file)
@@ -163,10 +163,10 @@ static char *mk_str(link_ctx *ctx, size_t end)
     if (ctx->i < end) {
         return apr_pstrndup(ctx->pool, ctx->s + ctx->i, end - ctx->i);
     }
-    return "";
+    return (char*)"";
 }
 
-static int read_qstring(link_ctx *ctx, char **ps)
+static int read_qstring(link_ctx *ctx, const char **ps)
 {
     if (skip_ws(ctx) && read_chr(ctx, '\"')) {
         size_t end;
@@ -179,7 +179,7 @@ static int read_qstring(link_ctx *ctx, char **ps)
     return 0;
 }
 
-static int read_ptoken(link_ctx *ctx, char **ps)
+static int read_ptoken(link_ctx *ctx, const char **ps)
 {
     if (skip_ws(ctx)) {
         size_t i;
@@ -209,7 +209,7 @@ static int read_link(link_ctx *ctx)
     return 0;
 }
 
-static int read_pname(link_ctx *ctx, char **pname)
+static int read_pname(link_ctx *ctx, const char **pname)
 {
     if (skip_ws(ctx)) {
         size_t i;
@@ -225,7 +225,7 @@ static int read_pname(link_ctx *ctx, char **pname)
     return 0;
 }
 
-static int read_pvalue(link_ctx *ctx, char **pvalue)
+static int read_pvalue(link_ctx *ctx, const char **pvalue)
 {
     if (skip_ws(ctx) && read_chr(ctx, '=')) {
         if (read_qstring(ctx, pvalue) || read_ptoken(ctx, pvalue)) {
@@ -238,7 +238,7 @@ static int read_pvalue(link_ctx *ctx, char **pvalue)
 static int read_param(link_ctx *ctx)
 {
     if (skip_ws(ctx) && read_chr(ctx, ';')) {
-        char *name, *value = "";
+        const char *name, *value = "";
         if (read_pname(ctx, &name)) {
             read_pvalue(ctx, &value); /* value is optional */
             apr_table_setn(ctx->params, name, value);
@@ -530,9 +530,9 @@ static unsigned int val_apr_hash(const char *str)
 static void calc_apr_hash(h2_push_diary *diary, apr_uint64_t *phash, h2_push *push) 
 {
     apr_uint64_t val;
-#if APR_UINT64MAX > APR_UINT_MAX
-    val = (val_apr_hash(push->req->scheme) << 32);
-    val ^= (val_apr_hash(push->req->authority) << 16);
+#if APR_UINT64_MAX > UINT_MAX
+    val = ((apr_uint64_t)(val_apr_hash(push->req->scheme)) << 32);
+    val ^= ((apr_uint64_t)(val_apr_hash(push->req->authority)) << 16);
     val ^= val_apr_hash(push->req->path);
 #else
     val = val_apr_hash(push->req->scheme);
@@ -555,7 +555,7 @@ static apr_int32_t ceil_power_of_2(apr_int32_t n)
 }
 
 static h2_push_diary *diary_create(apr_pool_t *p, h2_push_digest_type dtype, 
-                                   apr_size_t N)
+                                   int N)
 {
     h2_push_diary *diary = NULL;
     
@@ -590,7 +590,7 @@ static h2_push_diary *diary_create(apr_pool_t *p, h2_push_digest_type dtype,
     return diary;
 }
 
-h2_push_diary *h2_push_diary_create(apr_pool_t *p, apr_size_t N)
+h2_push_diary *h2_push_diary_create(apr_pool_t *p, int N)
 {
     return diary_create(p, H2_PUSH_DIGEST_SHA256, N);
 }
@@ -818,7 +818,7 @@ apr_status_t h2_push_diary_digest_get(h2_push_diary *diary, apr_pool_t *pool,
                                       int maxP, const char *authority, 
                                       const char **pdata, apr_size_t *plen)
 {
-    apr_size_t nelts, N, i;
+    int nelts, N, i;
     unsigned char log2n, log2pmax;
     gset_encoder encoder;
     apr_uint64_t *hashes;
@@ -968,7 +968,7 @@ apr_status_t h2_push_diary_digest_set(h2_push_diary *diary, const char *authorit
 {
     gset_decoder decoder;
     unsigned char log2n, log2p;
-    apr_size_t N, i;
+    int N, i;
     apr_pool_t *pool = diary->entries->pool;
     h2_push_diary_entry e;
     apr_status_t status = APR_SUCCESS;
index 7e85f13c6be53b02f65babadc2c9fee83e0e5c3c..d4c8a7a012eac4ce8b20dc3dd4c02c51c34656b3 100644 (file)
@@ -68,7 +68,7 @@ apr_array_header_t *h2_push_collect(apr_pool_t *p,
  * @param N the max number of entries, rounded up to 2^x
  * @return the created diary, might be NULL of max_entries is 0
  */
-h2_push_diary *h2_push_diary_create(apr_pool_t *p, apr_size_t N);
+h2_push_diary *h2_push_diary_create(apr_pool_t *p, int N);
 
 /**
  * Filters the given pushes against the diary and returns only those pushes
index a3fd8d1879af67314e61b6e9c3df3d7b84e60ccd..ac692ca5937a9858ff48e7d4578625efff584279 100644 (file)
@@ -270,7 +270,7 @@ request_rec *h2_request_create_rec(const h2_request *req, conn_rec *c)
 
     rpath = (req->path ? req->path : "");
     ap_parse_uri(r, rpath);
-    r->protocol = "HTTP/2.0";
+    r->protocol = (char*)"HTTP/2.0";
     r->proto_num = HTTP_VERSION(2, 0);
 
     r->the_request = apr_psprintf(r->pool, "%s %s %s", 
index 81f14685ffed4beab5527896659f0f972453caf1..2ac4bcfc99aa12989382f5cf38ed58054c1520b6 100644 (file)
@@ -1290,7 +1290,7 @@ apr_status_t h2_session_set_prio(h2_session *session, h2_stream *stream,
         nghttp2_priority_spec ps;
         int id_parent, id_grandpa, w_parent, w;
         int rv = 0;
-        char *ptype = "AFTER";
+        const char *ptype = "AFTER";
         h2_dependency dep = prio->dependency;
         
         id_parent = nghttp2_stream_get_stream_id(s_parent);
@@ -1598,7 +1598,7 @@ static apr_status_t h2_session_receive(void *ctx, const char *data,
         n = nghttp2_session_mem_recv(session->ngh2, (const uint8_t *)data, len);
         if (n < 0) {
             if (nghttp2_is_fatal((int)n)) {
-                dispatch_event(session, H2_SESSION_EV_PROTO_ERROR, (int)n, nghttp2_strerror(n));
+                dispatch_event(session, H2_SESSION_EV_PROTO_ERROR, (int)n, nghttp2_strerror((int)n));
                 return APR_EGENERAL;
             }
         }
index bce39ca1fba7e7e4956bf44160589219ed6fd810..fd4e96cec9a6a40461251818de7414b52b8c7192 100644 (file)
@@ -54,7 +54,7 @@ static int state_transition[][7] = {
 /*CL*/{  1, 1, 0, 0, 1, 1, 1 },
 };
 
-static void H2_STREAM_OUT_LOG(int lvl, h2_stream *s, char *tag)
+static void H2_STREAM_OUT_LOG(int lvl, h2_stream *s, const char *tag)
 {
     if (APLOG_C_IS_LEVEL(s->session->c, lvl)) {
         conn_rec *c = s->session->c;
index 5affec3dce9d9ddbec3739f24f7558a845211a86..f00201fb5ba291b5af333a685a2b00c33d625b87 100644 (file)
@@ -49,7 +49,8 @@
 #include "h2_worker.h"
 #include "h2_util.h"
 
-static void H2_TASK_OUT_LOG(int lvl, h2_task *task, apr_bucket_brigade *bb, char *tag)
+static void H2_TASK_OUT_LOG(int lvl, h2_task *task, apr_bucket_brigade *bb, 
+                            const char *tag)
 {
     if (APLOG_C_IS_LEVEL(task->c, lvl)) {
         conn_rec *c = task->c;
index 3a3900dd09f1c91ea7caf0480dc24ceab0a5bb9a..0678c4352bd3239f33634356fc01864e4acb87e3 100644 (file)
@@ -618,7 +618,7 @@ static apr_status_t last_not_included(apr_bucket_brigade *bb,
 {
     apr_bucket *b;
     apr_status_t status = APR_SUCCESS;
-    int files_allowed = pfile_buckets_allowed? *pfile_buckets_allowed : 0;
+    int files_allowed = pfile_buckets_allowed? (int)*pfile_buckets_allowed : 0;
     
     if (maxlen >= 0) {
         /* Find the bucket, up to which we reach maxlen/mem bytes */
index e7c28655f8273417b513c1adebed9caf05cfe6c9..85f98fe0698ce884a22b342565994cf1245071f5 100644 (file)
@@ -26,7 +26,7 @@
  * @macro
  * Version number of the http2 module as c string
  */
-#define MOD_HTTP2_VERSION "1.7.3"
+#define MOD_HTTP2_VERSION "1.7.4"
 
 /**
  * @macro
@@ -34,7 +34,7 @@
  * release. This is a 24 bit number with 8 bits for major number, 8 bits
  * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
  */
-#define MOD_HTTP2_VERSION_NUM 0x010703
+#define MOD_HTTP2_VERSION_NUM 0x010704
 
 
 #endif /* mod_h2_h2_version_h */
index 9495724dbc6970740b6bf132cac150f28b084218..854e677a34ad25040f78d5b20219133137cdf7ef 100644 (file)
@@ -343,7 +343,7 @@ static char *http2_var_lookup(apr_pool_t *p, server_rec *s,
             return (char *)vdef->lookup(p, s, c, r, ctx);
         }
     }
-    return "";
+    return (char*)"";
 }
 
 static int h2_h2_fixups(request_rec *r)
index 2754df02e7550f8bda93cfddf50855bb4bb61259..c20d059c74beca552ee1cd8fb9aa14c2bde24688 100644 (file)
@@ -65,7 +65,7 @@ typedef struct h2_proxy_ctx {
     apr_pool_t *engine_pool;    
     apr_size_t req_buffer_size;
     request_rec *next;
-    apr_size_t capacity;
+    int capacity;
     
     unsigned standalone : 1;
     unsigned is_ssl : 1;
@@ -168,7 +168,7 @@ static int proxy_http2_canon(request_rec *r, char *url)
             path = url;   /* this is the raw path */
         }
         else {
-            path = ap_proxy_canonenc(r->pool, url, strlen(url),
+            path = ap_proxy_canonenc(r->pool, url, (int)strlen(url),
                                      enc_path, 0, r->proxyreq);
             search = r->args;
         }
@@ -342,7 +342,7 @@ static apr_status_t proxy_engine_run(h2_proxy_ctx *ctx) {
     ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, ctx->owner, 
                   "eng(%s): setup session", ctx->engine_id);
     ctx->session = h2_proxy_session_setup(ctx->engine_id, ctx->p_conn, ctx->conf, 
-                                          30, h2_log2(ctx->req_buffer_size), 
+                                          30, h2_proxy_log2(ctx->req_buffer_size), 
                                           request_done);
     if (!ctx->session) {
         ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, ctx->owner, 
@@ -367,7 +367,7 @@ static apr_status_t proxy_engine_run(h2_proxy_ctx *ctx) {
             /* ongoing processing, call again */
             if (ctx->session->remote_max_concurrent > 0
                 && ctx->session->remote_max_concurrent != ctx->capacity) {
-                ctx->capacity = ctx->session->remote_max_concurrent;
+                ctx->capacity = (int)ctx->session->remote_max_concurrent;
             }
             s2 = next_request(ctx, 0);
             if (s2 == APR_ECONNABORTED) {
@@ -378,7 +378,7 @@ static apr_status_t proxy_engine_run(h2_proxy_ctx *ctx) {
                 status = s2;
                 break;
             }
-            if (!ctx->next && h2_ihash_empty(ctx->session->streams)) {
+            if (!ctx->next && h2_proxy_ihash_empty(ctx->session->streams)) {
                 break;
             }
         }