-
Notifications
You must be signed in to change notification settings - Fork 213
/
Copy pathnet_http.patch
52 lines (47 loc) · 2.2 KB
/
net_http.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
diff --git a/tensorflow_serving/util/BUILD b/tensorflow_serving/util/BUILD
index 4802a79f..4f676b8b 100644
--- a/tensorflow_serving/util/BUILD
+++ b/tensorflow_serving/util/BUILD
@@ -4,7 +4,7 @@ load("//tensorflow_serving:serving.bzl", "serving_proto_library")
package(
default_visibility = [
- "//tensorflow_serving:internal",
+ "//visibility:public",
],
features = ["-layering_check"],
)
diff --git a/tensorflow_serving/util/net_http/server/internal/evhttp_server.cc b/tensorflow_serving/util/net_http/server/internal/evhttp_server.cc
index 36c925a8..78e0eb66 100644
--- a/tensorflow_serving/util/net_http/server/internal/evhttp_server.cc
+++ b/tensorflow_serving/util/net_http/server/internal/evhttp_server.cc
@@ -105,13 +105,18 @@ bool EvHTTPServer::Initialize() {
return false;
}
+ std::size_t maxBodySize = 1024 * 1024 * 1024;
+ evhttp_set_max_body_size(ev_http_, maxBodySize);
+ std::size_t maxHeadersSize = 8 * 1024;
+ evhttp_set_max_headers_size(ev_http_, maxHeadersSize);
+
// By default libevents only allow GET, POST, HEAD, PUT, DELETE request
// we have to manually turn OPTIONS and PATCH flag on documentation:
// (http://www.wangafu.net/~nickm/libevent-2.0/doxygen/html/http_8h.html)
evhttp_set_allowed_methods(
ev_http_, EVHTTP_REQ_GET | EVHTTP_REQ_POST | EVHTTP_REQ_HEAD |
EVHTTP_REQ_PUT | EVHTTP_REQ_DELETE | EVHTTP_REQ_OPTIONS |
- EVHTTP_REQ_PATCH);
+ EVHTTP_REQ_CONNECT | EVHTTP_REQ_TRACE | EVHTTP_REQ_PATCH);
evhttp_set_gencb(ev_http_, &DispatchEvRequestFn, this);
return true;
diff --git a/tensorflow_serving/util/net_http/server/public/BUILD b/tensorflow_serving/util/net_http/server/public/BUILD
index 1953a10d..f0f6efdc 100644
--- a/tensorflow_serving/util/net_http/server/public/BUILD
+++ b/tensorflow_serving/util/net_http/server/public/BUILD
@@ -1,9 +1,7 @@
# Description: a lightweight http server and related utils to support Web clients
package(default_visibility = [
- "//tensorflow_serving:internal",
- "//tensorflow_serving/util/net_http:__subpackages__",
- "//tensorflow_serving/util/net_http/public:http_server_clients",
+ "//visibility:public",
])
licenses(["notice"])