diff options
author | Craig Tiller <ctiller@google.com> | 2017-03-14 07:59:19 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-03-14 07:59:19 -0700 |
commit | 82d72e79dfb1f1e59844c7b6d5826a726b84e631 (patch) | |
tree | 01eeeba16f88f7e875254add08ff45196f55460a /src/core/lib/iomgr/udp_server.c | |
parent | b18c8ba0b6bbc2317dd92353288f2b1c0ff353d5 (diff) | |
parent | 264a2108788fde232dfec976a511ed732864ddb0 (diff) |
Merge github.com:grpc/grpc into nolock
Diffstat (limited to 'src/core/lib/iomgr/udp_server.c')
-rw-r--r-- | src/core/lib/iomgr/udp_server.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/udp_server.c b/src/core/lib/iomgr/udp_server.c index 2a1c8d39fa..d1bcd89af1 100644 --- a/src/core/lib/iomgr/udp_server.c +++ b/src/core/lib/iomgr/udp_server.c @@ -485,7 +485,11 @@ void grpc_udp_server_start(grpc_exec_ctx *exec_ctx, grpc_udp_server *s, grpc_schedule_on_exec_ctx); grpc_fd_notify_on_write(exec_ctx, sp->emfd, &sp->write_closure); - s->active_ports++; + /* Registered for both read and write callbacks: increment active_ports + * twice to account for this, and delay free-ing of memory until both + * on_read and on_write have fired. */ + s->active_ports += 2; + sp = sp->next; } |