]> git.zerfleddert.de Git - record-dvb/commitdiff
use recvd instead of BUFFSIZE, so we only process really received
authormichael <michael>
Sun, 2 Jul 2006 10:47:20 +0000 (10:47 +0000)
committermichael <michael>
Sun, 2 Jul 2006 10:47:20 +0000 (10:47 +0000)
parts of the packet

sap.c

diff --git a/sap.c b/sap.c
index bc51aa5bea9d059640a1bbb28657fffa0f0160c1..232c0c3f80ea00a2d1ae239b4558c9776b2845f4 100644 (file)
--- a/sap.c
+++ b/sap.c
@@ -115,10 +115,9 @@ char *get_url_from_sap(char *service)
                 */
 
                pos = payload;
                 */
 
                pos = payload;
-               while(*pos != 0 && (pos-buffer) < BUFFSIZE) {
-                       if (*pos == 0x0d) {
+               while(*pos != 0 && (pos-buffer) < recvd) {
+                       if (*pos == 0x0d)
                                *pos = 0;
                                *pos = 0;
-                       }
 
                        if (*pos == 0x0a) {
                                *pos = 0;
 
                        if (*pos == 0x0a) {
                                *pos = 0;
@@ -140,13 +139,11 @@ char *get_url_from_sap(char *service)
                                                        poscnt++;
 
                                                        /* c=<network type> <address type> <connection address> */
                                                        poscnt++;
 
                                                        /* c=<network type> <address type> <connection address> */
-                                                       if (poscnt == 2) { 
+                                                       if (poscnt == 2)
                                                                host = payload + 1;
                                                                host = payload + 1;
-                                                       }
 
 
-                                                       if (poscnt > 2) {
+                                                       if (poscnt > 2)
                                                                break;
                                                                break;
-                                                       }
                                                }
                                                payload++;
                                        }
                                                }
                                                payload++;
                                        }
@@ -160,17 +157,14 @@ char *get_url_from_sap(char *service)
                                                        poscnt++;
 
                                                        /* m=<media> <port> <transport> <fmt list> */
                                                        poscnt++;
 
                                                        /* m=<media> <port> <transport> <fmt list> */
-                                                       if (poscnt == 1) { 
+                                                       if (poscnt == 1)
                                                                port = payload + 1;
                                                                port = payload + 1;
-                                                       }
 
 
-                                                       if (poscnt == 2) { 
+                                                       if (poscnt == 2)
                                                                proto = payload + 1;
                                                                proto = payload + 1;
-                                                       }
 
 
-                                                       if (poscnt > 2) {
+                                                       if (poscnt > 2)
                                                                break;
                                                                break;
-                                                       }
                                                }
                                                payload++;
                                        }
                                                }
                                                payload++;
                                        }
Impressum, Datenschutz