session: add unix socket api for app attachment
[vpp.git] / src / vnet / session / session.c
index 0956b2f..d27d1bb 100644 (file)
@@ -812,8 +812,11 @@ session_stream_connect_notify (transport_connection_t * tc,
 
   if (app_worker_connect_notify (app_wrk, s, SESSION_E_NONE, opaque))
     {
+      session_lookup_del_connection (tc);
+      /* Avoid notifying app about rejected session cleanup */
       s = session_get (new_si, new_ti);
-      session_free_w_fifos (s);
+      segment_manager_dealloc_fifos (s->rx_fifo, s->tx_fifo);
+      session_free (s);
       return -1;
     }
 
@@ -1901,6 +1904,8 @@ session_config_fn (vlib_main_t * vm, unformat_input_t * input)
        ;
       else if (unformat (input, "enable"))
        smm->session_enable_asap = 1;
+      else if (unformat (input, "use-app-socket-api"))
+       appns_sapi_enable ();
       else
        return clib_error_return (0, "unknown input `%U'",
                                  format_unformat_error, input);