kernel: add "close" ctl message for tcp connection to gracefully hang up a connection without a tcp reset (used by go)

This commit is contained in:
cinap_lenrek 2017-01-12 20:04:41 +01:00
parent c67d0c699f
commit 4aeefba681

View file

@ -3282,6 +3282,8 @@ tcpporthogdefensectl(char *val)
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)