Fixed memory leak for closed connections
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Tue, 12 Sep 2006 19:15:40 +0000 (19:15 +0000)
committerThadeu Lima de Souza Cascardo <cascardo@minaslivre.org>
Tue, 12 Sep 2006 19:15:40 +0000 (19:15 +0000)
Unrefs connections and close the other end when one end closes the
connection.

improxy.c

index b44e797..26c2534 100644 (file)
--- a/improxy.c
+++ b/improxy.c
@@ -25,6 +25,10 @@ void client_event (GConn* conn, GConnEvent* event, gpointer data)
       break;
     case GNET_CONN_WRITE:
       break;
+    case GNET_CONN_CLOSE:
+      gnet_conn_unref (server);
+      gnet_conn_unref (conn);
+      break;
     default:
       fprintf (stderr, "Received an unexpected client event.\n");
       break;