Browse Source

rtpproxy-ng: remove trailing double \r\n from multipart SDP

Richard Fuchs 11 years ago
parent
commit
0b85493f3c
1 changed files with 4 additions and 1 deletions
  1. 4 1
      modules/rtpproxy-ng/rtpproxy_funcs.c

+ 4 - 1
modules/rtpproxy-ng/rtpproxy_funcs.c

@@ -257,7 +257,10 @@ int extract_body(struct sip_msg *msg, str *body )
 		} /* end of while */
 		if(c==1)
 		{
-			while(rest && (*rest=='\r' || *rest=='\n')) rest++;
+			if (rest < p2 && *rest == '\r') rest++;
+			if (rest < p2 && *rest == '\n') rest++;
+			if (rest < p2 && p2[-1] == '\n') p2--;
+			if (rest < p2 && p2[-1] == '\r') p2--;
 			body->s = rest;
 			body->len = p2-rest;
 			goto done;