From 647c7747f9b9c0776fd4e12ef55d11e24b3495cb Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 2 Jul 2006 10:47:20 +0000 Subject: [PATCH] use recvd instead of BUFFSIZE, so we only process really received parts of the packet --- sap.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) 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++; } -- 2.39.5