http: notify client on request error
[vpp.git] / src / plugins / http / http.c
index 37a6de7..737e7b0 100644 (file)
@@ -598,7 +598,6 @@ http_state_wait_server_reply (http_conn_t *hc, transport_send_params_t *sp)
     }
 
 error:
-
   http_send_error (hc, ec);
   session_transport_closing_notify (&hc->connection);
   http_disconnect_transport (hc);
@@ -838,7 +837,9 @@ http_state_wait_app_method (http_conn_t *hc, transport_send_params_t *sp)
   return HTTP_SM_STOP;
 
 error:
+  svm_fifo_dequeue_drop_all (as->tx_fifo);
   session_transport_closing_notify (&hc->connection);
+  session_transport_closed_notify (&hc->connection);
   http_disconnect_transport (hc);
   return HTTP_SM_ERROR;
 }
@@ -1248,7 +1249,11 @@ http_transport_close (u32 hc_index, u32 thread_index)
       http_disconnect_transport (hc);
       return;
     }
-
+  else if (hc->state == HTTP_CONN_STATE_CLOSED)
+    {
+      HTTP_DBG (1, "nothing to do, already closed");
+      return;
+    }
   as = session_get_from_handle (hc->h_pa_session_handle);
 
   /* Nothing more to send, confirm close */