hsa: fix proxy ao connect 71/41571/1
authorMatus Fabian <[email protected]>
Fri, 13 Sep 2024 14:22:27 +0000 (16:22 +0200)
committerMatus Fabian <[email protected]>
Fri, 13 Sep 2024 14:22:27 +0000 (16:22 +0200)
Make sure that proxy server doesn't try to open connection to the
target multiple times. When client is uploading huge amount of data
it might happen that proxy_rx_callback is called again before
connection to the target is established.

Type: fix
Change-Id: I4d272d37bc545f6f8790a115c8d26bcf3ea84f22
Signed-off-by: Matus Fabian <[email protected]>
src/plugins/hs_apps/proxy.c

index 2011054..c7e7b2a 100644 (file)
@@ -368,6 +368,13 @@ proxy_rx_callback (session_t * s)
       u32 max_dequeue, ps_index;
       int actual_transfer __attribute__ ((unused));
 
+      /* maybe we were already here */
+      if (ps->active_open_establishing)
+       {
+         clib_spinlock_unlock_if_init (&pm->sessions_lock);
+         return 0;
+       }
+
       rx_fifo = s->rx_fifo;
       tx_fifo = s->tx_fifo;