[SCM] calf/master: Consume all messages in osc_server::read_from_socket()

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:40:00 UTC 2013


The following commit has been merged in the master branch:
commit 8f87bf6de03cd788fcb1971c2328dea56191041d
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Sat Apr 3 23:39:34 2010 +0100

    Consume all messages in osc_server::read_from_socket()
    
    There is no reason to stop at the first message in that function. Especially
    when OSC communication is based on polling, like in case of external GUI.

diff --git a/src/osctlserv.cpp b/src/osctlserv.cpp
index 6a2def2..2c9e4b2 100644
--- a/src/osctlserv.cpp
+++ b/src/osctlserv.cpp
@@ -47,19 +47,23 @@ void osc_server::parse_message(const char *buffer, int len)
 
 void osc_server::read_from_socket()
 {
-    char buf[16384];
-    int len = recv(socket, buf, 16384, MSG_DONTWAIT);
-    if (len > 0)
-    {
-        if (buf[0] == '/')
-        {
-            parse_message(buf, len);
-        }
-        if (buf[0] == '#')
+    do {
+        char buf[16384];
+        int len = recv(socket, buf, 16384, MSG_DONTWAIT);
+        if (len > 0)
         {
-            // XXXKF bundles are not supported yet
+            if (buf[0] == '/')
+            {
+                parse_message(buf, len);
+            }
+            if (buf[0] == '#')
+            {
+                // XXXKF bundles are not supported yet
+            }
         }
-    }
+        else
+            break;
+    } while(1);
 }
 
 osc_server::~osc_server()

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list