Commit 716b5b6f authored by Stefan Eissing's avatar Stefan Eissing
Browse files

Merge of 1761479,1761548,1762703,1763158 from trunk

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
     to better keep promise of connection ids unique at given point int time.
     Fix for mod_cgid interop in high load situtations. 
     Fix for handling of incoming trailers when no request body is sent.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1763163 13f79535-47bb-0310-9956-ffa450edef68
parent dda7b91d
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2,8 +2,16 @@

Changes with Apache 2.4.24

  *) 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
     to better keep promise of connection ids unique at given point int time.
     Fix for mod_cgid interop in high load situtations. 
     Fix for handling of incoming trailers when no request body is sent.
     [Stefan Eissing]
  
  *) mod_http2: fix suspended handling for streams. Output could become
     blocked in rare cases.
     blocked in rare cases. [Stefan Eissing]

  *) mpm_winnt: Prevent a denial of service when the 'data' AcceptFilter is in
     use by replacing it with the 'connect' filter. PR 59970. [Jacob Champion]
+1 −1
Original line number Diff line number Diff line
@@ -387,7 +387,7 @@ SET(mod_http2_extra_sources
  modules/http2/h2_from_h1.c         modules/http2/h2_h2.c
  modules/http2/h2_bucket_beam.c
  modules/http2/h2_mplx.c            modules/http2/h2_push.c
  modules/http2/h2_request.c         modules/http2/h2_response.c
  modules/http2/h2_request.c         modules/http2/h2_headers.c
  modules/http2/h2_session.c         modules/http2/h2_stream.c 
  modules/http2/h2_switch.c          modules/http2/h2_ngn_shed.c 
  modules/http2/h2_task.c            modules/http2/h2_util.c
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ FILES_nlm_objs = \
	$(OBJDIR)/h2_ngn_shed.o \
	$(OBJDIR)/h2_push.o \
	$(OBJDIR)/h2_request.o \
	$(OBJDIR)/h2_response.o \
	$(OBJDIR)/h2_headers.o \
	$(OBJDIR)/h2_session.o \
	$(OBJDIR)/h2_stream.o \
	$(OBJDIR)/h2_switch.o \
+1 −1
Original line number Diff line number Diff line
@@ -30,11 +30,11 @@ h2_ctx.lo dnl
h2_filter.lo dnl
h2_from_h1.lo dnl
h2_h2.lo dnl
h2_headers.lo dnl
h2_mplx.lo dnl
h2_ngn_shed.lo dnl
h2_push.lo dnl
h2_request.lo dnl
h2_response.lo dnl
h2_session.lo dnl
h2_stream.lo dnl
h2_switch.lo dnl
+10 −21
Original line number Diff line number Diff line
@@ -47,6 +47,9 @@ extern const char *H2_MAGIC_TOKEN;
#define H2_HEADER_PATH_LEN   5
#define H2_CRLF             "\r\n"

/* Max data size to write so it fits inside a TLS record */
#define H2_DATA_CHUNK_SIZE          ((16*1024) - 100 - 9) 

/* Maximum number of padding bytes in a frame, rfc7540 */
#define H2_MAX_PADLEN               256
/* Initial default window size, RFC 7540 ch. 6.5.2 */
@@ -115,39 +118,25 @@ typedef struct h2_session_props {
typedef struct h2_request h2_request;

struct h2_request {
    int id;             /* stream id */
    int initiated_on;   /* initiating stream id (PUSH) or 0 */
    
    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_table_t *trailers;

    apr_time_t request_time;
    apr_off_t content_length;
    
    unsigned int chunked : 1;   /* iff requst body needs to be forwarded as chunked */
    unsigned int eoh     : 1; /* iff end-of-headers has been seen and request is complete */
    unsigned int body    : 1; /* iff this request has a body */
    unsigned int serialize : 1; /* iff this request is written in HTTP/1.1 serialization */
    unsigned int push_policy; /* which push policy to use for this request */
};

typedef struct h2_response h2_response;
typedef struct h2_headers h2_headers;

struct h2_response {
    int         stream_id;
    int         rst_error;
    int         http_status;
    apr_off_t   content_length;
struct h2_headers {
    int         status;
    apr_table_t *headers;
    apr_table_t *trailers;
    struct h2_response *next;
    
    const char  *sos_filter;
    apr_table_t *notes;
};

typedef apr_status_t h2_io_data_cb(void *ctx, const char *data, apr_off_t len);
@@ -157,6 +146,6 @@ typedef int h2_stream_pri_cmp(int stream_id1, int stream_id2, void *ctx);
/* Note key to attach connection task id to conn_rec/request_rec instances */

#define H2_TASK_ID_NOTE         "http2-task-id"

#define H2_FILTER_DEBUG_NOTE    "http2-debug"

#endif /* defined(__mod_h2__h2__) */
Loading