[xiph-commits] r8386 - trunk/oggdsf/src/lib/core/directshow/dsfOggDemux

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Tue Dec 14 06:31:38 PST 2004


Author: illiminable
Date: 2004-12-14 06:31:38 -0800 (Tue, 14 Dec 2004)
New Revision: 8386

Modified:
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.h
Log:
* Handle the annoying boundary case where chunked encoding  and the block of recevied data breaks the chunk size hex data up between two adjacent buffers.

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp	2004-12-14 14:06:37 UTC (rev 8385)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp	2004-12-14 14:31:38 UTC (rev 8386)
@@ -92,6 +92,12 @@
 				locNumBytesLeft -= 2;
 			}
 
+			if (mLeftOver != "") {
+				debugLog<<"Sticking the leftovers back together..."<<endl;
+				locTemp = mLeftOver + locTemp;
+				mLeftOver = "";
+			}
+
 			size_t locChunkSizePos = locTemp.find("\r\n");
 			
 			if (locChunkSizePos != string::npos) {
@@ -109,6 +115,10 @@
 				unsigned long locGuffSize = (locChunkSizeStr.size() + 2);
 				locWorkingBuffPtr +=  locGuffSize;
 				locNumBytesLeft -= locGuffSize;
+			} else {
+				debugLog<<"Setting leftovers to "<<mLeftOver<<endl;
+				mLeftOver = locTemp;
+
 			}
 		}
 

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.h	2004-12-14 14:06:37 UTC (rev 8385)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.h	2004-12-14 14:31:38 UTC (rev 8386)
@@ -84,6 +84,8 @@
 	fstream fileDump;
 	fstream rawDump;
 
+	string mLeftOver;
 
+
 	CCritSec* mBufferLock;
 };



More information about the commits mailing list