View | Details | Raw Unified | Return to bug 217088 | Differences between
and this patch

Collapse All | Expand All

(-)www/h2o/Makefile (-23 / +15 lines)
Lines 2-9 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	h2o
4
PORTNAME=	h2o
5
PORTVERSION=	2.0.4
5
PORTVERSION=	2.1.0
6
PORTREVISION=	2
7
DISTVERSIONPREFIX=	v
6
DISTVERSIONPREFIX=	v
8
CATEGORIES=	www
7
CATEGORIES=	www
9
8
Lines 14-20 Link Here
14
13
15
USE_GITHUB=	yes
14
USE_GITHUB=	yes
16
15
17
USES=		cmake compiler:c11 perl5 shebangfix
16
USES=		cmake compiler:c11 cpe perl5 shebangfix ssl
17
CPE_VENDOR=	h2o_project
18
USE_PERL5=	run
18
USE_PERL5=	run
19
SHEBANG_FILES=	share/h2o/start_server
19
SHEBANG_FILES=	share/h2o/start_server
20
20
Lines 36-74 Link Here
36
36
37
USE_RC_SUBR=	${PORTNAME}
37
USE_RC_SUBR=	${PORTNAME}
38
38
39
OPTIONS_DEFINE=	LIBRESSL MRUBY
39
OPTIONS_DEFINE=		MRUBY
40
OPTIONS_DEFAULT=	LIBRESSL MRUBY
40
OPTIONS_DEFAULT=	MRUBY
41
OPTIONS_SUB=	yes
41
OPTIONS_SUB=		yes
42
LIBRESSL_DESC=	Build with bundled LibreSSL instead of OpenSSL
42
MRUBY_DESC=		Build with mruby handler support
43
MRUBY_DESC=	Build with mruby handler support
44
43
45
CMAKE_ARGS+=	-DEXTRA_LIBRARIES=OFF -DWITHOUT_LIBS=ON
44
CMAKE_ARGS+=		-DEXTRA_LIBRARIES=OFF -DWITHOUT_LIBS=ON
45
CMAKE_VERBOSE=		yes
46
46
47
.include <bsd.port.options.mk>
47
.include <bsd.port.options.mk>
48
48
49
LIBRESSL_CMAKE_ON=	-DWITH_BUNDLED_SSL=ON
50
LIBRESSL_CMAKE_OFF=	-DWITH_BUNDLED_SSL=OFF
51
LIBRESSL_USES_OFF=	ssl
52
MRUBY_CMAKE_ON=		-DWITH_MRUBY=ON
49
MRUBY_CMAKE_ON=		-DWITH_MRUBY=ON
53
MRUBY_CMAKE_OFF=		-DWITH_MRUBY=OFF
50
MRUBY_CMAKE_OFF=	-DWITH_MRUBY=OFF
54
51
55
.if ${PORT_OPTIONS:MLIBRESSL}
56
USES_SSL=	yes
57
.else
58
USES_SSL=	no
59
.endif
60
61
.if ${PORT_OPTIONS:MMRUBY}
52
.if ${PORT_OPTIONS:MMRUBY}
62
USE_RUBY=	yes
53
USE_RUBY=	yes
54
RUBY_NO_RUN_DEPENDS=	yes
63
BUILD_DEPENDS+=	bison:devel/bison
55
BUILD_DEPENDS+=	bison:devel/bison
64
.endif
56
.endif
65
57
66
post-patch:
58
post-patch:
67
	@${REINPLACE_CMD} -e 's|exec perl|exec ${LOCALBASE}/bin/perl|' \
59
	@${REINPLACE_CMD} -e 's|exec perl|exec ${LOCALBASE}/bin/perl|' \
68
			${WRKSRC}/share/h2o/annotate-backtrace-symbols \
60
		${WRKSRC}/share/h2o/annotate-backtrace-symbols \
69
			${WRKSRC}/share/h2o/fetch-ocsp-response \
61
		${WRKSRC}/share/h2o/fetch-ocsp-response \
70
			${WRKSRC}/share/h2o/kill-on-close \
62
		${WRKSRC}/share/h2o/kill-on-close \
71
			${WRKSRC}/share/h2o/start_server
63
		${WRKSRC}/share/h2o/start_server
72
64
73
post-install:
65
post-install:
74
	${MKDIR} ${STAGEDIR}${DOCSDIR} \
66
	${MKDIR} ${STAGEDIR}${DOCSDIR} \
(-)www/h2o/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1473753131
1
TIMESTAMP = 1484725591
2
SHA256 (h2o-h2o-v2.0.4_GH0.tar.gz) = c0efa18f0ffb0f68ee4b60a6ed1feb54c770458c59e48baa2d9d0906ef9c68c0
2
SHA256 (h2o-h2o-v2.1.0_GH0.tar.gz) = 41f3853f3083c2fe8e70d3ab7be02c3de3c26fb77ba5fc56fdaf46712418b999
3
SIZE (h2o-h2o-v2.0.4_GH0.tar.gz) = 15015392
3
SIZE (h2o-h2o-v2.1.0_GH0.tar.gz) = 15207573
(-)www/h2o/files/patch-CMakeLists.txt (-6 / +6 lines)
Lines 1-12 Link Here
1
--- CMakeLists.txt.orig	2016-03-04 12:09:30 UTC
1
--- CMakeLists.txt.orig	2017-01-17 23:43:27 UTC
2
+++ CMakeLists.txt
2
+++ CMakeLists.txt
3
@@ -419,7 +419,8 @@ INSTALL(TARGETS h2o
3
@@ -462,7 +462,8 @@ INSTALL(TARGETS h2o
4
     LIBRARY DESTINATION lib)
4
     LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
5
 
5
 
6
 IF (NOT WITHOUT_LIBS)
6
 IF (NOT WITHOUT_LIBS)
7
-    INSTALL(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h")
7
-    INSTALL(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h")
8
+    INSTALL(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h"
8
+    INSTALL(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h"
9
+        EXCLUDE PATTERN "h2o" EXCLUDE PATTERN "h2o/socket")
9
+        EXCLUDE PATTERN "h2o" EXCLUDE PATTERN "h2o/socket")
10
     IF (LIBUV_FOUND)
10
     IF (LIBUV_FOUND)
11
         INSTALL(FILES "${CMAKE_BINARY_DIR}/libh2o.pc" DESTINATION lib/pkgconfig)
11
         INSTALL(FILES "${CMAKE_BINARY_DIR}/libh2o.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
12
     ENDIF ()
12
     ENDIF ()
(-)www/h2o/files/patch-lib_core_request.c (-145 lines)
Lines 1-145 Link Here
1
--- lib/core/request.c.orig	2016-09-13 06:57:03 UTC
2
+++ lib/core/request.c
3
@@ -31,21 +31,24 @@
4
 
5
 #define INITIAL_INBUFSZ 8192
6
 
7
-struct st_delegate_request_deferred_t {
8
+struct st_deferred_request_action_t {
9
+    h2o_timeout_entry_t timeout;
10
     h2o_req_t *req;
11
+};
12
+
13
+struct st_delegate_request_deferred_t {
14
+    struct st_deferred_request_action_t super;
15
     h2o_handler_t *current_handler;
16
-    h2o_timeout_entry_t _timeout;
17
 };
18
 
19
 struct st_reprocess_request_deferred_t {
20
-    h2o_req_t *req;
21
+    struct st_deferred_request_action_t super;
22
     h2o_iovec_t method;
23
     const h2o_url_scheme_t *scheme;
24
     h2o_iovec_t authority;
25
     h2o_iovec_t path;
26
     h2o_req_overrides_t *overrides;
27
     int is_delegated;
28
-    h2o_timeout_entry_t _timeout;
29
 };
30
 
31
 struct st_send_error_deferred_t {
32
@@ -57,6 +60,21 @@ struct st_send_error_deferred_t {
33
     h2o_timeout_entry_t _timeout;
34
 };
35
 
36
+static void on_deferred_action_dispose(void *_action)
37
+{
38
+    struct st_deferred_request_action_t *action = _action;
39
+    if (h2o_timeout_is_linked(&action->timeout))
40
+        h2o_timeout_unlink(&action->timeout);
41
+}
42
+
43
+static struct st_deferred_request_action_t *create_deferred_action(h2o_req_t *req, size_t sz, h2o_timeout_cb cb)
44
+{
45
+    struct st_deferred_request_action_t *action = h2o_mem_alloc_shared(&req->pool, sz, on_deferred_action_dispose);
46
+    *action = (struct st_deferred_request_action_t){{0, cb}, req};
47
+    h2o_timeout_link(req->conn->ctx->loop, &req->conn->ctx->zero_timeout, &action->timeout);
48
+    return action;
49
+}
50
+
51
 static h2o_hostconf_t *find_hostconf(h2o_hostconf_t **hostconfs, h2o_iovec_t authority, uint16_t default_port)
52
 {
53
     h2o_iovec_t hostname;
54
@@ -205,6 +223,7 @@ void h2o_init_request(h2o_req_t *req, h2
55
     req->preferred_chunk_size = SIZE_MAX;
56
 
57
     if (src != NULL) {
58
+        size_t i;
59
 #define COPY(buf)                                                                                                                  \
60
     do {                                                                                                                           \
61
         req->buf.base = h2o_mem_alloc_pool(&req->pool, src->buf.len);                                                              \
62
@@ -216,9 +235,6 @@ void h2o_init_request(h2o_req_t *req, h2
63
         COPY(input.path);
64
         req->input.scheme = src->input.scheme;
65
         req->version = src->version;
66
-        h2o_vector_reserve(&req->pool, &req->headers, src->headers.size);
67
-        memcpy(req->headers.entries, src->headers.entries, sizeof(req->headers.entries[0]) * src->headers.size);
68
-        req->headers.size = src->headers.size;
69
         req->entity = src->entity;
70
         req->http1_is_persistent = src->http1_is_persistent;
71
         req->timestamps = src->timestamps;
72
@@ -229,8 +245,19 @@ void h2o_init_request(h2o_req_t *req, h2
73
             req->upgrade.len = 0;
74
         }
75
 #undef COPY
76
+        h2o_vector_reserve(&req->pool, &req->headers, src->headers.size);
77
+        req->headers.size = src->headers.size;
78
+        for (i = 0; i != src->headers.size; ++i) {
79
+            h2o_header_t *dst_header = req->headers.entries + i, *src_header = src->headers.entries + i;
80
+            if (h2o_iovec_is_token(src_header->name)) {
81
+                dst_header->name = src_header->name;
82
+            } else {
83
+                dst_header->name = h2o_mem_alloc_pool(&req->pool, sizeof(*dst_header->name));
84
+                *dst_header->name = h2o_strdup(&req->pool, src_header->name->base, src_header->name->len);
85
+            }
86
+            dst_header->value = h2o_strdup(&req->pool, src_header->value.base, src_header->value.len);
87
+        }
88
         if (src->env.size != 0) {
89
-            size_t i;
90
             h2o_vector_reserve(&req->pool, &req->env, src->env.size);
91
             req->env.size = src->env.size;
92
             for (i = 0; i != req->env.size; ++i)
93
@@ -276,16 +303,16 @@ void h2o_delegate_request(h2o_req_t *req
94
 
95
 static void on_delegate_request_cb(h2o_timeout_entry_t *entry)
96
 {
97
-    struct st_delegate_request_deferred_t *args = H2O_STRUCT_FROM_MEMBER(struct st_delegate_request_deferred_t, _timeout, entry);
98
-    h2o_delegate_request(args->req, args->current_handler);
99
+    struct st_delegate_request_deferred_t *args =
100
+        H2O_STRUCT_FROM_MEMBER(struct st_delegate_request_deferred_t, super.timeout, entry);
101
+    h2o_delegate_request(args->super.req, args->current_handler);
102
 }
103
 
104
 void h2o_delegate_request_deferred(h2o_req_t *req, h2o_handler_t *current_handler)
105
 {
106
-    struct st_delegate_request_deferred_t *args = h2o_mem_alloc_pool(&req->pool, sizeof(*args));
107
-    *args = (struct st_delegate_request_deferred_t){req, current_handler};
108
-    args->_timeout.cb = on_delegate_request_cb;
109
-    h2o_timeout_link(req->conn->ctx->loop, &req->conn->ctx->zero_timeout, &args->_timeout);
110
+    struct st_delegate_request_deferred_t *args =
111
+        (struct st_delegate_request_deferred_t *)create_deferred_action(req, sizeof(*args), on_delegate_request_cb);
112
+    args->current_handler = current_handler;
113
 }
114
 
115
 void h2o_reprocess_request(h2o_req_t *req, h2o_iovec_t method, const h2o_url_scheme_t *scheme, h2o_iovec_t authority,
116
@@ -335,17 +362,23 @@ void h2o_reprocess_request(h2o_req_t *re
117
 
118
 static void on_reprocess_request_cb(h2o_timeout_entry_t *entry)
119
 {
120
-    struct st_reprocess_request_deferred_t *args = H2O_STRUCT_FROM_MEMBER(struct st_reprocess_request_deferred_t, _timeout, entry);
121
-    h2o_reprocess_request(args->req, args->method, args->scheme, args->authority, args->path, args->overrides, args->is_delegated);
122
+    struct st_reprocess_request_deferred_t *args =
123
+        H2O_STRUCT_FROM_MEMBER(struct st_reprocess_request_deferred_t, super.timeout, entry);
124
+    h2o_reprocess_request(args->super.req, args->method, args->scheme, args->authority, args->path, args->overrides,
125
+                          args->is_delegated);
126
 }
127
 
128
 void h2o_reprocess_request_deferred(h2o_req_t *req, h2o_iovec_t method, const h2o_url_scheme_t *scheme, h2o_iovec_t authority,
129
                                     h2o_iovec_t path, h2o_req_overrides_t *overrides, int is_delegated)
130
 {
131
-    struct st_reprocess_request_deferred_t *args = h2o_mem_alloc_pool(&req->pool, sizeof(*args));
132
-    *args = (struct st_reprocess_request_deferred_t){req, method, scheme, authority, path, overrides, is_delegated};
133
-    args->_timeout.cb = on_reprocess_request_cb;
134
-    h2o_timeout_link(req->conn->ctx->loop, &req->conn->ctx->zero_timeout, &args->_timeout);
135
+    struct st_reprocess_request_deferred_t *args =
136
+        (struct st_reprocess_request_deferred_t *)create_deferred_action(req, sizeof(*args), on_reprocess_request_cb);
137
+    args->method = method;
138
+    args->scheme = scheme;
139
+    args->authority = authority;
140
+    args->path = path;
141
+    args->overrides = overrides;
142
+    args->is_delegated = is_delegated;
143
 }
144
 
145
 void h2o_start_response(h2o_req_t *req, h2o_generator_t *generator)
(-)www/h2o/files/patch-lib_http2_connection.c (-10 lines)
Lines 1-10 Link Here
1
--- lib/http2/connection.c.orig	2016-09-13 06:57:03 UTC
2
+++ lib/http2/connection.c
3
@@ -1329,6 +1329,7 @@ int h2o_http2_handle_upgrade(h2o_req_t *
4
 
5
     return 0;
6
 Error:
7
+    h2o_linklist_unlink(&http2conn->_conns);
8
     free(http2conn);
9
     return -1;
10
 }
(-)www/h2o/pkg-plist (+10 lines)
Lines 7-13 Link Here
7
%%DATADIR%%/fastcgi-cgi
7
%%DATADIR%%/fastcgi-cgi
8
%%DATADIR%%/setuidgid
8
%%DATADIR%%/setuidgid
9
%%DATADIR%%/status/index.html
9
%%DATADIR%%/status/index.html
10
%%MRUBY%%%%DATADIR%%/mruby/acl.rb
11
%%MRUBY%%%%DATADIR%%/mruby/bootstrap.rb
12
%%MRUBY%%%%DATADIR%%/mruby/dos_detector.rb
10
%%MRUBY%%%%DATADIR%%/mruby/htpasswd.rb
13
%%MRUBY%%%%DATADIR%%/mruby/htpasswd.rb
14
%%MRUBY%%%%DATADIR%%/mruby/lru_cache.rb
15
%%MRUBY%%%%DATADIR%%/mruby/preloads.rb
16
%%MRUBY%%%%DATADIR%%/mruby/trie_addr.rb
11
%%PORTDOCS%%%%DOCSDIR%%/assets/8mbps100msec-nginx195-h2o150.png
17
%%PORTDOCS%%%%DOCSDIR%%/assets/8mbps100msec-nginx195-h2o150.png
12
%%PORTDOCS%%%%DOCSDIR%%/assets/firstpaintbench.png
18
%%PORTDOCS%%%%DOCSDIR%%/assets/firstpaintbench.png
13
%%PORTDOCS%%%%DOCSDIR%%/assets/remotebench.png
19
%%PORTDOCS%%%%DOCSDIR%%/assets/remotebench.png
Lines 16-21 Link Here
16
%%PORTDOCS%%%%DOCSDIR%%/assets/style.css
22
%%PORTDOCS%%%%DOCSDIR%%/assets/style.css
17
%%PORTDOCS%%%%DOCSDIR%%/benchmarks.html
23
%%PORTDOCS%%%%DOCSDIR%%/benchmarks.html
18
%%PORTDOCS%%%%DOCSDIR%%/configure.html
24
%%PORTDOCS%%%%DOCSDIR%%/configure.html
25
%%PORTDOCS%%%%DOCSDIR%%/configure/access_control.html
19
%%PORTDOCS%%%%DOCSDIR%%/configure/access_log_directives.html
26
%%PORTDOCS%%%%DOCSDIR%%/configure/access_log_directives.html
20
%%PORTDOCS%%%%DOCSDIR%%/configure/base_directives.html
27
%%PORTDOCS%%%%DOCSDIR%%/configure/base_directives.html
21
%%PORTDOCS%%%%DOCSDIR%%/configure/basic_auth.html
28
%%PORTDOCS%%%%DOCSDIR%%/configure/basic_auth.html
Lines 22-27 Link Here
22
%%PORTDOCS%%%%DOCSDIR%%/configure/cgi.html
29
%%PORTDOCS%%%%DOCSDIR%%/configure/cgi.html
23
%%PORTDOCS%%%%DOCSDIR%%/configure/command_options.html
30
%%PORTDOCS%%%%DOCSDIR%%/configure/command_options.html
24
%%PORTDOCS%%%%DOCSDIR%%/configure/compress_directives.html
31
%%PORTDOCS%%%%DOCSDIR%%/configure/compress_directives.html
32
%%PORTDOCS%%%%DOCSDIR%%/configure/dos_detection.html
25
%%PORTDOCS%%%%DOCSDIR%%/configure/errordoc_directives.html
33
%%PORTDOCS%%%%DOCSDIR%%/configure/errordoc_directives.html
26
%%PORTDOCS%%%%DOCSDIR%%/configure/expires_directives.html
34
%%PORTDOCS%%%%DOCSDIR%%/configure/expires_directives.html
27
%%PORTDOCS%%%%DOCSDIR%%/configure/fastcgi_directives.html
35
%%PORTDOCS%%%%DOCSDIR%%/configure/fastcgi_directives.html
Lines 37-42 Link Here
37
%%PORTDOCS%%%%DOCSDIR%%/configure/reproxy_directives.html
45
%%PORTDOCS%%%%DOCSDIR%%/configure/reproxy_directives.html
38
%%PORTDOCS%%%%DOCSDIR%%/configure/status_directives.html
46
%%PORTDOCS%%%%DOCSDIR%%/configure/status_directives.html
39
%%PORTDOCS%%%%DOCSDIR%%/configure/syntax_and_structure.html
47
%%PORTDOCS%%%%DOCSDIR%%/configure/syntax_and_structure.html
48
%%PORTDOCS%%%%DOCSDIR%%/configure/throttle_response_directives.html
40
%%PORTDOCS%%%%DOCSDIR%%/examples/doc_root.alternate/index.txt
49
%%PORTDOCS%%%%DOCSDIR%%/examples/doc_root.alternate/index.txt
41
%%PORTDOCS%%%%DOCSDIR%%/examples/doc_root/index.html
50
%%PORTDOCS%%%%DOCSDIR%%/examples/doc_root/index.html
42
%%PORTDOCS%%%%DOCSDIR%%/examples/h2o/alternate.crt
51
%%PORTDOCS%%%%DOCSDIR%%/examples/h2o/alternate.crt
Lines 47-52 Link Here
47
%%PORTDOCS%%%%DOCSDIR%%/examples/h2o_mruby/h2o.conf
56
%%PORTDOCS%%%%DOCSDIR%%/examples/h2o_mruby/h2o.conf
48
%%PORTDOCS%%%%DOCSDIR%%/examples/h2o_mruby/hello.rb
57
%%PORTDOCS%%%%DOCSDIR%%/examples/h2o_mruby/hello.rb
49
%%PORTDOCS%%%%DOCSDIR%%/examples/libh2o/http1client.c
58
%%PORTDOCS%%%%DOCSDIR%%/examples/libh2o/http1client.c
59
%%PORTDOCS%%%%DOCSDIR%%/examples/libh2o/latency-optimization.c
50
%%PORTDOCS%%%%DOCSDIR%%/examples/libh2o/simple.c
60
%%PORTDOCS%%%%DOCSDIR%%/examples/libh2o/simple.c
51
%%PORTDOCS%%%%DOCSDIR%%/examples/libh2o/socket-client.c
61
%%PORTDOCS%%%%DOCSDIR%%/examples/libh2o/socket-client.c
52
%%PORTDOCS%%%%DOCSDIR%%/examples/libh2o/websocket.c
62
%%PORTDOCS%%%%DOCSDIR%%/examples/libh2o/websocket.c

Return to bug 217088