session: switch ct to vc and track half-opens

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7f9c4b9b6e523ab549087ad21724f34f08fca793
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index e0c87b9..8a304f9 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -1345,9 +1345,9 @@
       a->sep_ext.original_tp = a->sep_ext.transport_proto;
       a->sep_ext.transport_proto = TRANSPORT_PROTO_NONE;
       rv = app_worker_connect_session (client_wrk, &a->sep_ext, &a->sh);
-      if (rv <= 0)
-	return rv;
       a->sep_ext.transport_proto = a->sep_ext.original_tp;
+      if (!rv || rv != SESSION_E_LOCAL_CONNECT)
+	return rv;
     }
   /*
    * Not connecting to a local server, propagate to transport