From 91054ed9fe7f08cac9738a6a6af5a9ad476ba24b Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 19 May 2010 20:38:17 -0700 Subject: [PATCH] Return immediately when using d_residual. (Otherwise recv may overwrite valid data in d_temp_buff.) --- gnuradio-core/src/lib/io/gr_udp_source.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnuradio-core/src/lib/io/gr_udp_source.cc b/gnuradio-core/src/lib/io/gr_udp_source.cc index 1197a0c4..da5b8a19 100755 --- a/gnuradio-core/src/lib/io/gr_udp_source.cc +++ b/gnuradio-core/src/lib/io/gr_udp_source.cc @@ -243,7 +243,10 @@ gr_udp_source::work (int noutput_items, // Update indexing of amount of bytes left in the buffer d_residual -= nbytes; d_temp_offset += nbytes; - // FIXME? Returning here could simplify life... + + // Return now with what we've got. + assert(nbytes % d_itemsize == 0); + return nbytes/d_itemsize; } #if USE_SELECT -- 2.30.2