X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fhs_apps%2Fhttp_client_cli.c;h=f44d4e1bcd16bc68cef9525d8049287c9e8de2cd;hb=b1ea30e5639adb4290df2bfb493729cc0d5f3b70;hp=113bc2ef750f1cea87bfbaa25d9145363b033bd9;hpb=b7e66f4a30bbde62595615f72a386383d931eeae;p=vpp.git diff --git a/src/plugins/hs_apps/http_client_cli.c b/src/plugins/hs_apps/http_client_cli.c index 113bc2ef750..f44d4e1bcd1 100644 --- a/src/plugins/hs_apps/http_client_cli.c +++ b/src/plugins/hs_apps/http_client_cli.c @@ -19,6 +19,14 @@ #include #include +#define HCC_DEBUG 0 + +#if HCC_DEBUG +#define HCC_DBG(_fmt, _args...) clib_warning (_fmt, ##_args) +#else +#define HCC_DBG(_fmt, _args...) +#endif + typedef struct { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); @@ -122,6 +130,8 @@ hcc_ts_connected_callback (u32 app_index, u32 hc_index, session_t *as, http_msg_t msg; int rv; + HCC_DBG ("hc_index: %d", hc_index); + if (err) { clib_warning ("connected error: hc_index(%d): %U", hc_index, @@ -207,7 +217,7 @@ hcc_ts_rx_callback (session_t *ts) return 0; } - if (!hs->to_recv) + if (hs->to_recv == 0) { rv = svm_fifo_dequeue (ts->rx_fifo, sizeof (msg), (u8 *) &msg); ASSERT (rv == sizeof (msg)); @@ -229,7 +239,7 @@ hcc_ts_rx_callback (session_t *ts) rv = svm_fifo_dequeue (ts->rx_fifo, n_deq, hcm->http_response + curr); if (rv < 0) { - clib_warning ("app dequeue failed"); + clib_warning ("app dequeue(n=%d) failed; rv = %d", n_deq, rv); return -1; } @@ -239,6 +249,7 @@ hcc_ts_rx_callback (session_t *ts) vec_set_len (hcm->http_response, curr + n_deq); ASSERT (hs->to_recv >= rv); hs->to_recv -= rv; + HCC_DBG ("app rcvd %d, remains %d", rv, hs->to_recv); if (hs->to_recv == 0) {