httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1764236 - in /httpd/httpd/trunk: ./ modules/http2/
Date Tue, 11 Oct 2016 13:34:13 GMT
Author: icing
Date: Tue Oct 11 13:34:13 2016
New Revision: 1764236

URL: http://svn.apache.org/viewvc?rev=1764236&view=rev
Log:
mod_proxy_http2: renaming duplicate symbol clash between h2_proxy_util and h2_util externals

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/http2/NWGNUmod_http2
    httpd/httpd/trunk/modules/http2/h2_proxy_session.c
    httpd/httpd/trunk/modules/http2/h2_proxy_session.h
    httpd/httpd/trunk/modules/http2/h2_proxy_util.c
    httpd/httpd/trunk/modules/http2/h2_proxy_util.h
    httpd/httpd/trunk/modules/http2/h2_version.h
    httpd/httpd/trunk/modules/http2/mod_proxy_http2.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1764236&r1=1764235&r2=1764236&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Oct 11 13:34:13 2016
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy_http2: fixed duplicate symbols with mod_http2.
+  
   *) mod_dav: Fix a potential cause of unbounded memory usage or incorrect
      behavior in a routine that sends <DAV:response>'s to the output filters.
      [Evgeny Kotkov]

Modified: httpd/httpd/trunk/modules/http2/NWGNUmod_http2
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/NWGNUmod_http2?rev=1764236&r1=1764235&r2=1764236&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/NWGNUmod_http2 (original)
+++ httpd/httpd/trunk/modules/http2/NWGNUmod_http2 Tue Oct 11 13:34:13 2016
@@ -368,11 +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_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) >> $@

Modified: httpd/httpd/trunk/modules/http2/h2_proxy_session.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_proxy_session.c?rev=1764236&r1=1764235&r2=1764236&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_proxy_session.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_proxy_session.c Tue Oct 11 13:34:13 2016
@@ -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_cl
         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
     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_ses
     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_
         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_sessi
         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_
                       "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
         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
     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
         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
 
 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_pro
     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_p
                               "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_p
                 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_p
         }
         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 *se
 {
     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 *s
              * 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_sess
         }
         
         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 *
 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 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

Modified: httpd/httpd/trunk/modules/http2/h2_proxy_session.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_proxy_session.h?rev=1764236&r1=1764235&r2=1764236&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_proxy_session.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_proxy_session.h Tue Oct 11 13:34:13 2016
@@ -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 */
     

Modified: httpd/httpd/trunk/modules/http2/h2_proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_proxy_util.c?rev=1764236&r1=1764235&r2=1764236&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_proxy_util.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_proxy_util.c Tue Oct 11 13:34:13 2016
@@ -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 *ke
     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 v
     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_iha
     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 *v
     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, vo
     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 *
     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, i
     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, i
  * 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
     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
     }
 }
 
-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
 }
 
 
-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 nl
     }
 }
 
-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, in
     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,
 }
 
 /*******************************************************************************
- * 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
 #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, c
     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(a
     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 *
     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(ap
 {
     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(ap
     
     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
     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, cons
 {
     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
  * 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]);

Modified: httpd/httpd/trunk/modules/http2/h2_proxy_util.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_proxy_util.h?rev=1764236&r1=1764235&r2=1764236&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_proxy_util.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_proxy_util.h Tue Oct 11 13:34:13 2016
@@ -19,27 +19,27 @@
 /*******************************************************************************
  * 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 i
  * @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
  * @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
  * @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_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);
+} h2_proxy_ngheader;
+h2_proxy_ngheader *h2_util_ngheader_make_req(apr_pool_t *p, 
+                                             const struct h2_proxy_request *req);
+
+/*******************************************************************************
+ * h2_proxy_request helpers
+ ******************************************************************************/
+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);
 
 
 

Modified: httpd/httpd/trunk/modules/http2/h2_version.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_version.h?rev=1764236&r1=1764235&r2=1764236&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_version.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_version.h Tue Oct 11 13:34:13 2016
@@ -26,7 +26,7 @@
  * @macro
  * Version number of the http2 module as c string
  */
-#define MOD_HTTP2_VERSION "1.7.3-DEV"
+#define MOD_HTTP2_VERSION "1.7.4-DEV"
 
 /**
  * @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 */

Modified: httpd/httpd/trunk/modules/http2/mod_proxy_http2.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/mod_proxy_http2.c?rev=1764236&r1=1764235&r2=1764236&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/mod_proxy_http2.c (original)
+++ httpd/httpd/trunk/modules/http2/mod_proxy_http2.c Tue Oct 11 13:34:13 2016
@@ -342,7 +342,7 @@ static apr_status_t proxy_engine_run(h2_
     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, 
@@ -378,7 +378,7 @@ static apr_status_t proxy_engine_run(h2_
                 status = s2;
                 break;
             }
-            if (!ctx->next && h2_ihash_empty(ctx->session->streams)) {
+            if (!ctx->next && h2_proxy_ihash_empty(ctx->session->streams))
{
                 break;
             }
         }




Mime
View raw message