git: 9front

Download patch

ref: 9ea7dd53088a6bc09a225616fbece2e429565aa8
parent: 409703b0780955b6e8b9a4f228a6bf4e53b62450
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)
--