Only send http Keep-alive header for http 1.0

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2992 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2009-11-24 11:40:04 +00:00
parent 30c3c88c55
commit e30ae4fa0e
1 changed files with 2 additions and 1 deletions

View File

@ -62,6 +62,7 @@ void RemoteCameraHttp::Initialise()
request = stringtf( "GET %s HTTP/%s\r\n", path.c_str(), config.http_version ); request = stringtf( "GET %s HTTP/%s\r\n", path.c_str(), config.http_version );
request += stringtf( "User-Agent: %s/%s\r\n", config.http_ua, ZM_VERSION ); request += stringtf( "User-Agent: %s/%s\r\n", config.http_ua, ZM_VERSION );
request += stringtf( "Host: %s\r\n", host .c_str()); request += stringtf( "Host: %s\r\n", host .c_str());
if ( strcmp( config.http_version, "1.0" ) == 0 )
request += stringtf( "Connection: Keep-Alive\r\n" ); request += stringtf( "Connection: Keep-Alive\r\n" );
if ( !auth.empty() ) if ( !auth.empty() )
request += stringtf( "Authorization: Basic %s\r\n", auth64.c_str() ); request += stringtf( "Authorization: Basic %s\r\n", auth64.c_str() );