diff options
author | Craig Tiller <ctiller@google.com> | 2016-04-11 20:11:18 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-04-11 20:11:18 -0700 |
commit | 3ab2fe009495ce9b13b35e5cb35cf47991a85647 (patch) | |
tree | e051416beb3bdbf9d75328d901c350cdc9213758 /src/core | |
parent | d626acbb02c93fd15b12d8ef8833a65d0c3781e6 (diff) |
Rollup of changes from the latest import
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/lib/http/parser.c | 13 | ||||
-rw-r--r-- | src/core/lib/http/parser.h | 2 | ||||
-rw-r--r-- | src/core/lib/iomgr/udp_server.c | 3 | ||||
-rw-r--r-- | src/core/lib/surface/init.c | 2 |
4 files changed, 11 insertions, 9 deletions
diff --git a/src/core/lib/http/parser.c b/src/core/lib/http/parser.c index 01d17fb623..921c772453 100644 --- a/src/core/lib/http/parser.c +++ b/src/core/lib/http/parser.c @@ -39,7 +39,7 @@ #include <grpc/support/log.h> #include <grpc/support/useful.h> -extern int grpc_http_trace; +int grpc_http1_trace = 0; static char *buf2str(void *buffer, size_t length) { char *out = gpr_malloc(length + 1); @@ -74,7 +74,7 @@ static int handle_response_line(grpc_http_parser *parser) { return 1; error: - if (grpc_http_trace) gpr_log(GPR_ERROR, "Failed parsing response line"); + if (grpc_http1_trace) gpr_log(GPR_ERROR, "Failed parsing response line"); return 0; } @@ -127,7 +127,7 @@ static int handle_request_line(grpc_http_parser *parser) { return 1; error: - if (grpc_http_trace) gpr_log(GPR_ERROR, "Failed parsing request line"); + if (grpc_http1_trace) gpr_log(GPR_ERROR, "Failed parsing request line"); return 0; } @@ -152,7 +152,7 @@ static int add_header(grpc_http_parser *parser) { GPR_ASSERT(cur != end); if (*cur == ' ' || *cur == '\t') { - if (grpc_http_trace) + if (grpc_http1_trace) gpr_log(GPR_ERROR, "Continued header lines not supported yet"); goto error; } @@ -161,7 +161,8 @@ static int add_header(grpc_http_parser *parser) { cur++; } if (cur == end) { - if (grpc_http_trace) gpr_log(GPR_ERROR, "Didn't find ':' in header string"); + if (grpc_http1_trace) + gpr_log(GPR_ERROR, "Didn't find ':' in header string"); goto error; } GPR_ASSERT(cur >= beg); @@ -252,7 +253,7 @@ static int addbyte(grpc_http_parser *parser, uint8_t byte) { case GRPC_HTTP_FIRST_LINE: case GRPC_HTTP_HEADERS: if (parser->cur_line_length >= GRPC_HTTP_PARSER_MAX_HEADER_LENGTH) { - if (grpc_http_trace) + if (grpc_http1_trace) gpr_log(GPR_ERROR, "HTTP client max line length (%d) exceeded", GRPC_HTTP_PARSER_MAX_HEADER_LENGTH); return 0; diff --git a/src/core/lib/http/parser.h b/src/core/lib/http/parser.h index 8bd73f649a..42fa5181b8 100644 --- a/src/core/lib/http/parser.h +++ b/src/core/lib/http/parser.h @@ -113,4 +113,6 @@ void grpc_http_parser_destroy(grpc_http_parser *parser); int grpc_http_parser_parse(grpc_http_parser *parser, gpr_slice slice); int grpc_http_parser_eof(grpc_http_parser *parser); +extern int grpc_http1_trace; + #endif /* GRPC_CORE_LIB_HTTP_PARSER_H */ diff --git a/src/core/lib/iomgr/udp_server.c b/src/core/lib/iomgr/udp_server.c index a0b9709be5..93366eb269 100644 --- a/src/core/lib/iomgr/udp_server.c +++ b/src/core/lib/iomgr/udp_server.c @@ -166,7 +166,6 @@ static void deactivated_all_ports(grpc_exec_ctx *exec_ctx, grpc_udp_server *s) { if (s->nports) { for (i = 0; i < s->nports; i++) { server_port *sp = &s->ports[i]; - grpc_unlink_if_unix_domain_socket(&sp->addr.sockaddr); sp->destroyed_closure.cb = destroyed_port; sp->destroyed_closure.cb_arg = s; grpc_fd_orphan(exec_ctx, sp->emfd, &sp->destroyed_closure, NULL, @@ -317,8 +316,6 @@ int grpc_udp_server_add_port(grpc_udp_server *s, const void *addr, socklen_t sockname_len; int port; - grpc_unlink_if_unix_domain_socket((struct sockaddr *)addr); - /* Check if this is a wildcard port, and if so, try to keep the port the same as some previously created listener. */ if (grpc_sockaddr_get_port(addr) == 0) { diff --git a/src/core/lib/surface/init.c b/src/core/lib/surface/init.c index ec75af6e06..e48e6db69f 100644 --- a/src/core/lib/surface/init.c +++ b/src/core/lib/surface/init.c @@ -45,6 +45,7 @@ #include "src/core/lib/channel/http_client_filter.h" #include "src/core/lib/channel/http_server_filter.h" #include "src/core/lib/debug/trace.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/executor.h" #include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/profiling/timers.h" @@ -160,6 +161,7 @@ void grpc_init(void) { grpc_register_tracer("connectivity_state", &grpc_connectivity_state_trace); grpc_register_tracer("channel_stack_builder", &grpc_trace_channel_stack_builder); + grpc_register_tracer("http1", &grpc_http1_trace); grpc_security_pre_init(); grpc_iomgr_init(); grpc_executor_init(); |