farsonic / mnc

Automatically exported from code.google.com/p/mnc
Other
0 stars 0 forks source link

Listen mode doesn't flush stdout #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
In one console:
  $ mnc -l -p 6082 224.10.10.10
In another console:
  $ echo -n "test" | nc -q 0 -u 224.10.10.10 6082

What is the expected output? What do you see instead?
Expected to get "test" (with no newline).

Instead, you get nothing until another packet is sent that contains a newline.

What version of the product are you using? On what operating system?
r4 on Slackware Linux 11.0 with kernel 2.6.18.1

Please provide any additional information below.

The following patch flushes the output buffer after writing each received
packet:

Index: mnc_main.c
===================================================================
--- mnc_main.c  (revision 4)
+++ mnc_main.c  (working copy)
@@ -104,6 +104,7 @@
                                       0, NULL, NULL)) >= 0)
                {
                        fwrite(buffer, len, 1, stdout);
+                       fflush(stdout);
                }
        }
        else /* Assume MODE == SENDER */

Original issue reported on code.google.com by brian36000@gmail.com on 28 Nov 2006 at 10:15

GoogleCodeExporter commented 8 years ago
Thanks for reporting this issue! I've applied a fix in svn r6.

Original comment by colm.mac...@gmail.com on 24 Jan 2007 at 10:38