Преглед на файлове

core/parser: Fix extract_sendrecv_mode to always return mode if valid

- All four sendrecv directions return 0
- is_on_hold flag set for inactive and sendonly

(cherry picked from commit 0a019df8f2922a940a41742ce0e4560bb6523d6c)
(cherry picked from commit 49c39a3b2409636d1360d943e6785a34002c9009)
(cherry picked from commit 18d1b4ce5328480e52f7f9d7b394dd00011c1f17)
Hugh Waite преди 11 години
родител
ревизия
20eeee825e
променени са 1 файла, в които са добавени 4 реда и са изтрити 5 реда
  1. 4 5
      parser/sdp/sdp_helpr_funcs.c

+ 4 - 5
parser/sdp/sdp_helpr_funcs.c

@@ -446,13 +446,12 @@ int extract_sendrecv_mode(str *body, str *sendrecv_mode, int *is_on_hold)
 	cp1 = body->s;
 	if ( !( (strncasecmp(cp1, "a=sendrecv", 10) == 0) ||
 		(strncasecmp(cp1, "a=recvonly", 10) == 0))) {
-		if ( !( (strncasecmp(cp1, "a=inactive", 10) == 0) ||
-			(strncasecmp(cp1, "a=sendonly", 10) == 0) )) {
-			return -1;
-		} else {
+		if ((strncasecmp(cp1, "a=inactive", 10) == 0) ||
+		    (strncasecmp(cp1, "a=sendonly", 10) == 0) ) {
 			*is_on_hold = 1;
+		} else {
+			return -1;
 		}
-		return -1;
 	}
 
 	sendrecv_mode->s = body->s + 2; /* skip `a=' */