Anyway, the ONLY thing that still holds me back from just installing zm from the repo - a missing patch fro edimax cameras. I found this patch years ago on some forum, but without this patch my IP cameras do not work. The reason is that cameras return content-boundary in double quotes inside http response. This is allowed by standard, but is an unusual behaviour. If there is any way to integrate this patch into main tree, life would be much easier. Thanks for all the work!
Code: Select all
--- zoneminder-1.29.0+dfsg.orig/src/zm_remote_camera_http.cpp
+++ zoneminder-1.29.0+dfsg/src/zm_remote_camera_http.cpp
@@ -343,7 +343,7 @@ int RemoteCameraHttp::GetResponse()
}
if ( !content_type_expr )
- content_type_expr = new RegExpr( "Content-type: ?(.+?)(?:; ?boundary=(.+?))?\r?\n", PCRE_CASELESS );
+ content_type_expr = new RegExpr( "Content-type: ?(.+?)(?:; ?boundary=\x22?(.+?)\x22?)?\r?\n", PCRE_CASELESS );
if ( content_type_expr->Match( header, header_len ) >= 2 )
{
content_type = content_type_expr->MatchString( 1 );
@@ -799,8 +799,10 @@ Debug(3, "Need more data buffer %d < con
if ( strncasecmp( start_ptr, boundary_match, boundary_match_len ) == 0 )
{
start_ptr += boundary_match_len;
- start_ptr += strspn( start_ptr, "-" );
+ start_ptr += strspn( start_ptr, "-\x22" ); // modified to allow facultative double quote in boundary="myboundary" like on IC-1500 cameras
content_boundary_len = sprintf( content_boundary, "--%s", start_ptr );
+ content_boundary_len = strcspn( content_boundary, "\x22" );
+ content_boundary[content_boundary_len]='\0';
Debug( 3, "Got content boundary '%s'", content_boundary );
}
else