From 6c2f44af402466855aada096d29691b9620ef65e Mon Sep 17 00:00:00 2001 From: stan Date: Sat, 20 Mar 2004 12:53:27 +0000 Subject: [PATCH] Further changes for images without c-l headers or termination patterns. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@986 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zm_remote_camera.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/zm_remote_camera.cpp b/src/zm_remote_camera.cpp index 15eafdf1a..21fefc155 100644 --- a/src/zm_remote_camera.cpp +++ b/src/zm_remote_camera.cpp @@ -426,6 +426,7 @@ int RemoteCamera::GetResponse() return( -1 ); } } + Debug( 3, ( "Got end of image by length, content-length = %d", content_length )); } else { @@ -455,10 +456,18 @@ int RemoteCamera::GetResponse() content_expr = new RegExpr( content_pattern, PCRE_DOTALL ); } } - if ( content_expr->Match( buffer, buffer.Size() ) == 2 ) + if ( buffer_len ) { - content_length = content_expr->MatchLength( 1 ); - Debug( 3, ( "Got end of image, content-length = %d", content_length )); + if ( content_expr->Match( buffer, buffer.Size() ) == 2 ) + { + content_length = content_expr->MatchLength( 1 ); + Debug( 3, ( "Got end of image by pattern, content-length = %d", content_length )); + } + } + else + { + content_length = buffer.Size(); + Debug( 3, ( "Got end of image by closure, content-length = %d", content_length )); } } }