The change to fix a bug2
[ric-plt/lib/rmr.git] / src / rmr / nng / src / mt_call_nng_static.c
index 325b313..71106f1 100644 (file)
 #include <semaphore.h>
 
 static inline void queue_normal( uta_ctx_t* ctx, rmr_mbuf_t* mbuf ) {
+       static  int warned = 0;
        chute_t*        chute;
-       int                     state;
 
        if( ! uta_ring_insert( ctx->mring, mbuf ) ) {
                rmr_free_msg( mbuf );                                                           // drop if ring is full
+               if( !warned ) {
+                       fprintf( stderr, "[WARN] rmr_mt_receive: application is not receiving fast enough; messages dropping\n" );
+                       warned++;
+               }
+
+               return;
        }
 
        chute = &ctx->chutes[0];
-       chute->mbuf = mbuf;
-       state = sem_post( &chute->barrier );                                                            // tickle the ring monitor
+       sem_post( &chute->barrier );                                                            // tickle the ring monitor
 }
 
 /*