ref: 4aeefba6811e57afe04a909fe147a29bb419d06b
parent: c67d0c699f7b52da534f75d3620776997b1e8d52
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Jan 12 15:04:41 EST 2017
kernel: add "close" ctl message for tcp connection to gracefully hang up a connection without a tcp reset (used by go)
--- a/sys/src/9/ip/tcp.c
+++ b/sys/src/9/ip/tcp.c
@@ -3282,6 +3282,8 @@
static char*
tcpctl(Conv* c, char** f, int n)
{
+ if(n == 1 && strcmp(f[0], "close") == 0)
+ return tcpclose(c), nil;
if(n == 1 && strcmp(f[0], "hangup") == 0)
return tcphangup(c);
if(n >= 1 && strcmp(f[0], "keepalive") == 0)