session: return connect session handle to app

App transports not supported for now. Will have to be updated
individually.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I75cb6c4e1c5af008af72858a9ee573016812abd4
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index 83106ef..e0c87b9 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -1331,6 +1331,8 @@
   session_endpoint_update_for_app (&a->sep_ext, client, 1 /* is_connect */ );
   client_wrk = application_get_worker (client, a->wrk_map_index);
 
+  a->sep_ext.opaque = a->api_context;
+
   /*
    * First check the local scope for locally attached destinations.
    * If we have local scope, we pass *all* connects through it since we may
@@ -1342,7 +1344,7 @@
 
       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, a->api_context);
+      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;
@@ -1350,7 +1352,7 @@
   /*
    * Not connecting to a local server, propagate to transport
    */
-  return app_worker_connect_session (client_wrk, &a->sep, a->api_context);
+  return app_worker_connect_session (client_wrk, &a->sep_ext, &a->sh);
 }
 
 int