[Red5commits] [1856] fixed decoding of multiple parameters through AMF3 connection - only the first o

jbauch luke at codegent.com
Wed Apr 11 16:40:07 EDT 2007


fixed decoding of multiple parameters through AMF3 connection - only the first one seems to be encoded using AMF3, all others use AMF0


Timestamp: 04/11/07 15:31:11 EST (less than one hour ago) 
Change: 1856 
Author: jbauch

Files (see diff or trac for details): 
java/server/trunk/src/org/red5/server/net/rtmp/codec/RTMPProtocolDecoder.java


Trac: http://mirror1.cvsdude.com/trac/osflash/red5/changeset/1856

Index: /java/server/trunk/src/org/red5/server/net/rtmp/codec/RTMPProtocolDecoder.java
===================================================================
--- /java/server/trunk/src/org/red5/server/net/rtmp/codec/RTMPProtocolDecoder.java (revision 1760)
+++ /java/server/trunk/src/org/red5/server/net/rtmp/codec/RTMPProtocolDecoder.java (revision 1856)
@@ -778,5 +778,5 @@
 
 		if (in.hasRemaining()) {
-			ArrayList paramList = new ArrayList();
+			ArrayList<Object> paramList = new ArrayList<Object>();
 
 			final Object obj = deserializer.deserialize(input);
@@ -785,15 +785,16 @@
 			}
 
-			if (in.hasRemaining()) {
+			while (in.hasRemaining()) {
 				// Check for AMF3 encoding of parameters
 				byte tmp = in.get();
 				in.position(in.position()-1);
 				if (tmp == AMF.TYPE_AMF3_OBJECT) {
-					// All further parameters are encoded using AMF3
+					// The next parameter is encoded using AMF3
 					input = new org.red5.io.amf3.Input(in);
-				}
-				while (in.hasRemaining()) {
-					paramList.add(deserializer.deserialize(input));
-				}
+				} else {
+					// The next parameter is encoded using AMF0
+					input = new org.red5.io.amf.Input(in);
+				}
+				paramList.add(deserializer.deserialize(input));
 			}
 			params = paramList.toArray();


Note:
Diffs are chopped if more than 25k.
This is to get past the limit on the mailing list.



More information about the Red5commits mailing list