Page 1 of 1

Trivial HTTP compliance fix

Posted: Sun May 13, 2007 5:52 pm
by haimg
Hello,
In zm_remote_camera.cpp (Version 1.22.3) ZoneMinder sends not 100% properly formatted HTTP requests (Line feed (\r) is missing), which is required, see http://www.faqs.org/rfcs/rfc1945.html section 6.1. This breaks at remote camera support here (server expects this LF). This trivial patch just adds the needed character:

Code: Select all

--- zm_remote_camera.cpp.orig   2007-05-13 10:46:52.000000000 -0700
+++ zm_remote_camera.cpp        2007-05-13 10:32:28.000000000 -0700
@@ -112,7 +112,7 @@
 
        if ( !request[0] )
        {
-               snprintf( request, sizeof(request), "GET %s HTTP/%s\n", path, config.http_version );
+               snprintf( request, sizeof(request), "GET %s HTTP/%s\r\n", path, config.http_version );
                snprintf( &(request[strlen(request)]), sizeof(request)-strlen(request), "User-Agent: %s/%s\r\n", config.http_ua, ZM_VERSION );
                snprintf( &(request[strlen(request)]), sizeof(request)-strlen(request), "Host: %s\r\n", host );
                snprintf( &(request[strlen(request)]), sizeof(request)-strlen(request), "Connection: Keep-Alive\r\n" );

Posted: Mon May 21, 2007 11:41 am
by zoneminder
Thanks for pointing that out. I have made the change in the source.