commit 94737a2a5f52d805cad9e36bf8bf5debbcaebb8b
parent c999bf5001f14c283e9077d1481648ab7d22ac98
Author: Joris Vink <joris@coders.se>
Date:   Sat, 13 Jul 2013 20:29:29 +0200
If the idletimer expires for SPDY sessions use spdy_session_teardown()
to remove it gently.
Diffstat:
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/connection.c b/src/connection.c
@@ -225,7 +225,10 @@ kore_connection_check_idletimer(u_int64_t now, struct connection *c)
 	d = now - c->idle_timer.start;
 	if (d >= c->idle_timer.length) {
 		kore_debug("%p idle for %d ms, expiring", c, d);
-		kore_connection_disconnect(c);
+		if (c->proto == CONN_PROTO_SPDY)
+			spdy_session_teardown(c, SPDY_SESSION_ERROR_OK);
+		else
+			kore_connection_disconnect(c);
 	}
 }
 
diff --git a/src/spdy.c b/src/spdy.c
@@ -341,8 +341,7 @@ spdy_session_teardown(struct connection *c, u_int8_t err)
 	c->flags &= ~CONN_READ_POSSIBLE;
 	c->flags |= CONN_READ_BLOCK;
 
-	c->idle_timer.length = 5000;
-	kore_connection_start_idletimer(c);
+	net_send_flush(c);
 }
 
 static int