[Live-devel] sapWatch print entire SAP

jiri.pinkava at vscht.cz jiri.pinkava at vscht.cz
Wed Jun 21 13:24:18 PDT 2006


Hi all,
   there is a small problem with sapWatch, it does not show entire SAP packet if payload type present (It is separated by \0... see RFC2974).
It is not most important but I do patch to solve this (otherwise it is unusable).

Jiří Pinkava

--- sapWatch.cpp.orig	2006-05-18 00:06:50.000000000 +0200
+++ sapWatch.cpp	2006-06-21 22:18:55.000000000 +0200
@@ -59,6 +59,14 @@
       continue;
     }
 
+    // convert "application/sdp\0" -> "application/sdp\0x20"
+    // or all other nonprintable characters to blank, except new line
+    unsigned idx = 8;
+    while (idx < packetSize) {
+      if (packet[idx] < 0x20 && packet[idx] != '\n')
+        packet[idx] = 0x20;
+      idx++;
+    }
     packet[packetSize] = '\0'; // just in case
     printf((char*)(packet+8));
   }



More information about the live-devel mailing list