You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2015/11/11 17:40:18 UTC
svn commit: r1713887 [2/2] - /httpd/httpd/trunk/modules/http2/
Modified: httpd/httpd/trunk/modules/http2/h2_task.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_task.c?rev=1713887&r1=1713886&r2=1713887&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_task.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_task.c Wed Nov 11 16:40:18 2015
@@ -38,6 +38,7 @@
#include "h2_from_h1.h"
#include "h2_h2.h"
#include "h2_mplx.h"
+#include "h2_request.h"
#include "h2_session.h"
#include "h2_stream.h"
#include "h2_task_input.h"
@@ -152,46 +153,30 @@ static int h2_task_process_conn(conn_rec
}
-h2_task *h2_task_create(long session_id,
- int stream_id,
- apr_pool_t *stream_pool,
- h2_mplx *mplx, conn_rec *c)
+h2_task *h2_task_create(long session_id, const h2_request *req,
+ apr_pool_t *pool, h2_mplx *mplx,
+ conn_rec *c, int eos)
{
- h2_task *task = apr_pcalloc(stream_pool, sizeof(h2_task));
+ h2_task *task = apr_pcalloc(pool, sizeof(h2_task));
if (task == NULL) {
- ap_log_perror(APLOG_MARK, APLOG_ERR, APR_ENOMEM, stream_pool,
+ ap_log_perror(APLOG_MARK, APLOG_ERR, APR_ENOMEM, pool,
APLOGNO(02941) "h2_task(%ld-%d): create stream task",
- session_id, stream_id);
- h2_mplx_out_close(mplx, stream_id);
+ session_id, req->id);
+ h2_mplx_out_close(mplx, req->id);
return NULL;
}
- task->id = apr_psprintf(stream_pool, "%ld-%d", session_id, stream_id);
- task->stream_id = stream_id;
+ task->id = apr_psprintf(pool, "%ld-%d", session_id, req->id);
+ task->stream_id = req->id;
task->mplx = mplx;
-
task->c = c;
+
+ task->request = req;
+ task->input_eos = eos;
- ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, stream_pool,
- "h2_task(%s): created", task->id);
return task;
}
-void h2_task_set_request(h2_task *task,
- const char *method,
- const char *scheme,
- const char *authority,
- const char *path,
- apr_table_t *headers, int eos)
-{
- task->method = method;
- task->scheme = scheme;
- task->authority = authority;
- task->path = path;
- task->headers = headers;
- task->input_eos = eos;
-}
-
apr_status_t h2_task_destroy(h2_task *task)
{
(void)task;
@@ -216,8 +201,7 @@ apr_status_t h2_task_do(h2_task *task, h
if (status == APR_SUCCESS) {
task->input = h2_task_input_create(task, task->pool,
task->c->bucket_alloc);
- task->output = h2_task_output_create(task, task->pool,
- task->c->bucket_alloc);
+ task->output = h2_task_output_create(task, task->pool);
ap_process_connection(task->c, h2_worker_get_socket(worker));
ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, task->c,
"h2_task(%s): processing done", task->id);
@@ -270,7 +254,7 @@ static request_rec *h2_task_create_reque
r->allowed_methods = ap_make_method_list(p, 2);
- r->headers_in = apr_table_copy(r->pool, task->headers);
+ r->headers_in = apr_table_copy(r->pool, task->request->headers);
r->trailers_in = apr_table_make(r->pool, 5);
r->subprocess_env = apr_table_make(r->pool, 25);
r->headers_out = apr_table_make(r->pool, 12);
@@ -309,19 +293,19 @@ static request_rec *h2_task_create_reque
/* Time to populate r with the data we have. */
r->request_time = apr_time_now();
- r->method = task->method;
+ r->method = task->request->method;
/* Provide quick information about the request method as soon as known */
r->method_number = ap_method_number_of(r->method);
if (r->method_number == M_GET && r->method[0] == 'H') {
r->header_only = 1;
}
- ap_parse_uri(r, task->path);
+ ap_parse_uri(r, task->request->path);
r->protocol = (char*)"HTTP/2";
r->proto_num = HTTP_VERSION(2, 0);
r->the_request = apr_psprintf(r->pool, "%s %s %s",
- r->method, task->path, r->protocol);
+ r->method, task->request->path, r->protocol);
/* update what we think the virtual host is based on the headers we've
* now read. may update status.
Modified: httpd/httpd/trunk/modules/http2/h2_task.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_task.h?rev=1713887&r1=1713886&r2=1713887&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_task.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_task.h Wed Nov 11 16:40:18 2015
@@ -39,6 +39,7 @@ struct apr_thread_cond_t;
struct h2_conn;
struct h2_mplx;
struct h2_task;
+struct h2_request;
struct h2_resp_head;
struct h2_worker;
@@ -49,11 +50,7 @@ struct h2_task {
int stream_id;
struct h2_mplx *mplx;
- const char *method;
- const char *scheme;
- const char *authority;
- const char *path;
- apr_table_t *headers;
+ const struct h2_request *request;
int input_eos;
int serialize_headers;
@@ -68,20 +65,12 @@ struct h2_task {
struct apr_thread_cond_t *io; /* used to wait for events on */
};
-h2_task *h2_task_create(long session_id, int stream_id,
+h2_task *h2_task_create(long session_id, const struct h2_request *req,
apr_pool_t *pool, struct h2_mplx *mplx,
- conn_rec *c);
+ conn_rec *c, int eos);
apr_status_t h2_task_destroy(h2_task *task);
-void h2_task_set_request(h2_task *task,
- const char *method,
- const char *scheme,
- const char *authority,
- const char *path,
- apr_table_t *headers, int eos);
-
-
apr_status_t h2_task_do(h2_task *task, struct h2_worker *worker);
void h2_task_register_hooks(void);
Modified: httpd/httpd/trunk/modules/http2/h2_task_input.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_task_input.c?rev=1713887&r1=1713886&r2=1713887&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_task_input.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_task_input.c Wed Nov 11 16:40:18 2015
@@ -23,6 +23,7 @@
#include "h2_private.h"
#include "h2_conn.h"
#include "h2_mplx.h"
+#include "h2_request.h"
#include "h2_session.h"
#include "h2_stream.h"
#include "h2_task_input.h"
@@ -53,11 +54,11 @@ h2_task_input *h2_task_input_create(h2_t
if (task->serialize_headers) {
ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, task->c,
"h2_task_input(%s): serialize request %s %s",
- task->id, task->method, task->path);
+ task->id, task->request->method, task->request->path);
input->bb = apr_brigade_create(pool, bucket_alloc);
apr_brigade_printf(input->bb, NULL, NULL, "%s %s HTTP/1.1\r\n",
- task->method, task->path);
- apr_table_do(ser_header, input, task->headers, NULL);
+ task->request->method, task->request->path);
+ apr_table_do(ser_header, input, task->request->headers, NULL);
apr_brigade_puts(input->bb, NULL, NULL, "\r\n");
if (input->task->input_eos) {
APR_BRIGADE_INSERT_TAIL(input->bb, apr_bucket_eos_create(bucket_alloc));
Modified: httpd/httpd/trunk/modules/http2/h2_task_output.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_task_output.c?rev=1713887&r1=1713886&r2=1713887&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_task_output.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_task_output.c Wed Nov 11 16:40:18 2015
@@ -24,6 +24,7 @@
#include "h2_private.h"
#include "h2_conn.h"
#include "h2_mplx.h"
+#include "h2_request.h"
#include "h2_session.h"
#include "h2_stream.h"
#include "h2_from_h1.h"
@@ -33,12 +34,10 @@
#include "h2_util.h"
-h2_task_output *h2_task_output_create(h2_task *task, apr_pool_t *pool,
- apr_bucket_alloc_t *bucket_alloc)
+h2_task_output *h2_task_output_create(h2_task *task, apr_pool_t *pool)
{
h2_task_output *output = apr_pcalloc(pool, sizeof(h2_task_output));
- (void)bucket_alloc;
if (output) {
output->task = task;
output->state = H2_TASK_OUT_INIT;
@@ -73,8 +72,9 @@ static apr_status_t open_if_needed(h2_ta
ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, f->c,
"h2_task_output(%s): write without response "
"for %s %s %s",
- output->task->id, output->task->method,
- output->task->authority, output->task->path);
+ output->task->id, output->task->request->method,
+ output->task->request->authority,
+ output->task->request->path);
f->c->aborted = 1;
}
if (output->task->io) {
Modified: httpd/httpd/trunk/modules/http2/h2_task_output.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_task_output.h?rev=1713887&r1=1713886&r2=1713887&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_task_output.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_task_output.h Wed Nov 11 16:40:18 2015
@@ -40,8 +40,7 @@ struct h2_task_output {
struct h2_from_h1 *from_h1;
};
-h2_task_output *h2_task_output_create(struct h2_task *task, apr_pool_t *pool,
- apr_bucket_alloc_t *bucket_alloc);
+h2_task_output *h2_task_output_create(struct h2_task *task, apr_pool_t *pool);
void h2_task_output_destroy(h2_task_output *output);
Modified: httpd/httpd/trunk/modules/http2/h2_version.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_version.h?rev=1713887&r1=1713886&r2=1713887&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_version.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_version.h Wed Nov 11 16:40:18 2015
@@ -20,7 +20,7 @@
* @macro
* Version number of the h2 module as c string
*/
-#define MOD_HTTP2_VERSION "1.0.4-DEV"
+#define MOD_HTTP2_VERSION "1.0.5-DEV"
/**
* @macro
@@ -28,7 +28,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 0x010004
+#define MOD_HTTP2_VERSION_NUM 0x010005
#endif /* mod_h2_h2_version_h */
Modified: httpd/httpd/trunk/modules/http2/mod_http2.dsp
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/mod_http2.dsp?rev=1713887&r1=1713886&r2=1713887&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/mod_http2.dsp (original)
+++ httpd/httpd/trunk/modules/http2/mod_http2.dsp Wed Nov 11 16:40:18 2015
@@ -149,6 +149,10 @@ SOURCE=./h2_mplx.c
# End Source File
# Begin Source File
+SOURCE=./h2_push.c
+# End Source File
+# Begin Source File
+
SOURCE=./h2_request.c
# End Source File
# Begin Source File
@@ -189,10 +193,6 @@ SOURCE=./h2_task_queue.c
# End Source File
# Begin Source File
-SOURCE=./h2_to_h1.c
-# End Source File
-# Begin Source File
-
SOURCE=./h2_util.c
# End Source File
# Begin Source File