Palantir FIX remote camera capture for 1.22.0

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
sogood007
Posts: 25
Joined: Tue Oct 26, 2004 6:53 pm

Palantir FIX remote camera capture for 1.22.0

Post by sogood007 »

Hi,

I have some problem with remote camera capture using palantir. I debug it further and notice there is some potential issue with the zm_remote_capture.cpp. The code which send the HTTP request use \n only as the line break. However, HTTP spec require CRLF i.e. \r\n as the line break. I have changed all \n to \r\n in that section of code. Now it works ok with palantir.

Code: Select all

                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" );
                if ( auth )
                {
                        snprintf( &(request[strlen(request)]), sizeof(request)-strlen(request), "Authorization: Basic %s\r\n", auth64 );
                }
                snprintf( &(request[strlen(request)]), sizeof(request)-strlen(request), "\r\n" );
[/code]
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Thanks for posting this. I will look into why it only has the \n in there, probably because my original cameras barfed with \r\n
Phil
Post Reply