Commit 99a8910d authored by Sjoerd Simons's avatar Sjoerd Simons Committed by Tim-Philipp Müller
Browse files

gst/typefind/gsttypefindfunctions.c: Better detection for...

gst/typefind/gsttypefindfunctions.c: Better detection for multipart/x-mixed-replace: accept leading whitespaces befor...

Original commit message from CVS:
Patch by: Sjoerd Simons  <sjoerd at luon net>
* gst/typefind/gsttypefindfunctions.c: (multipart_type_find):
Better detection for multipart/x-mixed-replace: accept leading
whitespaces before the boundary marker as well (as our very own
multipartmux used to produce) (#349068).
parent 33e0a62c
2006-08-08 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Sjoerd Simons <sjoerd at luon net>
* gst/typefind/gsttypefindfunctions.c: (multipart_type_find):
Better detection for multipart/x-mixed-replace: accept leading
whitespaces before the boundary marker as well (as our very own
multipartmux used to produce) (#349068).
2006-08-07 Tim-Philipp Müller <tim at centricular dot net>
 
Patch by: Young-Ho Cha <ganadist at chollian net>
......
......@@ -934,7 +934,7 @@ GST_STATIC_CAPS ("multipart/x-mixed-replace");
#define MULTIPART_CAPS gst_static_caps_get(&multipart_caps)
/* multipart/x-mixed replace is:
* --<some ascii chars>[\r]\n
* <maybe some whitespace>--<some ascii chars>[\r]\n
* <more ascii chars>[\r]\nContent-type:<more ascii>[\r]\n */
static void
multipart_type_find (GstTypeFind * tf, gpointer unused)
......@@ -942,8 +942,15 @@ multipart_type_find (GstTypeFind * tf, gpointer unused)
guint8 *data;
guint8 *x;
data = gst_type_find_peek (tf, 0, 2);
if (!data || data[0] != '-' || data[1] != '-')
#define MULTIPART_MAX_BOUNDARY_OFFSET 16
data = gst_type_find_peek (tf, 0, MULTIPART_MAX_BOUNDARY_OFFSET);
if (!data)
return;
for (x = data;
x - data < MULTIPART_MAX_BOUNDARY_OFFSET - 2 && g_ascii_isspace (*x);
x++);
if (x[0] != '-' || x[1] != '-')
return;
/* Could be okay, peek what should be enough for a complete header */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment