From: michael Date: Sun, 2 Jul 2006 10:47:20 +0000 (+0000) Subject: use recvd instead of BUFFSIZE, so we only process really received X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/record-dvb/commitdiff_plain/647c7747f9b9c0776fd4e12ef55d11e24b3495cb?ds=sidebyside use recvd instead of BUFFSIZE, so we only process really received parts of the packet --- diff --git a/sap.c b/sap.c index bc51aa5..232c0c3 100644 --- a/sap.c +++ b/sap.c @@ -115,10 +115,9 @@ char *get_url_from_sap(char *service) */ pos = payload; - while(*pos != 0 && (pos-buffer) < BUFFSIZE) { - if (*pos == 0x0d) { + while(*pos != 0 && (pos-buffer) < recvd) { + if (*pos == 0x0d) *pos = 0; - } if (*pos == 0x0a) { *pos = 0; @@ -140,13 +139,11 @@ char *get_url_from_sap(char *service) poscnt++; /* c=
*/ - if (poscnt == 2) { + if (poscnt == 2) host = payload + 1; - } - if (poscnt > 2) { + if (poscnt > 2) break; - } } payload++; } @@ -160,17 +157,14 @@ char *get_url_from_sap(char *service) poscnt++; /* m= */ - if (poscnt == 1) { + if (poscnt == 1) port = payload + 1; - } - if (poscnt == 2) { + if (poscnt == 2) proto = payload + 1; - } - if (poscnt > 2) { + if (poscnt > 2) break; - } } payload++; }