[rtmpdump] r397 - in trunk: rtmpdump.c rtmpgw.c

hyc subversion at mplayerhq.hu
Thu Mar 25 04:06:13 CET 2010


Author: hyc
Date: Thu Mar 25 04:06:12 2010
New Revision: 397

Log:
Abort on unrecognized options

Modified:
   trunk/rtmpdump.c
   trunk/rtmpgw.c

Modified: trunk/rtmpdump.c
==============================================================================
--- trunk/rtmpdump.c	Wed Mar 24 19:43:30 2010	(r396)
+++ trunk/rtmpdump.c	Thu Mar 25 04:06:12 2010	(r397)
@@ -1122,6 +1122,7 @@ main(int argc, char **argv)
 	  break;
 	default:
 	  RTMP_LogPrintf("unknown option: %c\n", opt);
+	  return RD_FAILED;
 	  break;
 	}
     }

Modified: trunk/rtmpgw.c
==============================================================================
--- trunk/rtmpgw.c	Wed Mar 24 19:43:30 2010	(r396)
+++ trunk/rtmpgw.c	Thu Mar 25 04:06:12 2010	(r397)
@@ -446,7 +446,11 @@ void processTCPrequest(STREAMING_SERVER 
 		  ptr += nArgLen + 1;
 		  len -= nArgLen + 1;
 
-		  ParseOption(ich, arg, &req);
+		  if (!ParseOption(ich, arg, &req))
+		    {
+		      status = "400 unrecognized option";
+		      goto filenotfound;
+		    }
 		}
 	    }
 	}
@@ -953,7 +957,7 @@ ParseOption(char opt, char *arg, RTMP_RE
       break;
     default:
       RTMP_LogPrintf("unknown option: %c, arg: %s\n", opt, arg);
-      break;
+      return false;
     }
   return true;
 }
@@ -1142,7 +1146,8 @@ main(int argc, char **argv)
 	  }
 	default:
 	  //RTMP_LogPrintf("unknown option: %c\n", opt);
-	  ParseOption(opt, optarg, &defaultRTMPRequest);
+	  if (!ParseOption(opt, optarg, &defaultRTMPRequest))
+	    return RD_FAILED;
 	  break;
 	}
     }


More information about the rtmpdump mailing list