mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-24 06:27:07 -04:00
Changed the streaming headers.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@663 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
@@ -284,10 +284,18 @@ void Event::StreamEvent( const char *path, int event_id, int rate, int scale, FI
|
||||
|
||||
setbuf( fd, 0 );
|
||||
|
||||
time_t cache_now = time( 0 );
|
||||
char date_string[64];
|
||||
strftime( date_string, sizeof(date_string)-1, "%a, %d %b %Y %H:%M:%S GMT", gmtime( &cache_now ) );
|
||||
|
||||
fprintf( fd, "Server: ZoneMinder Stream Server\r\n" );
|
||||
fprintf( fd, "Pragma: no-cache\r\n" );
|
||||
fprintf( fd, "Cache-Control: no-cache\r\n" );
|
||||
fprintf( fd, "Expires: Thu, 01 Dec 1994 16:00:00 GMT\r\n" );
|
||||
|
||||
fprintf( fd, "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n" );
|
||||
fprintf( fd, "Last-Modified: %s\r\n", date_string );
|
||||
fprintf( fd, "Cache-Control: no-store, no-cache, must-revalidate\r\n" );
|
||||
fprintf( fd, "Cache-Control: post-check=0, pre-check=0\r\n" );
|
||||
fprintf( fd, "Pragma: no-cache\r\n");
|
||||
|
||||
fprintf( fd, "Content-Type: multipart/x-mixed-replace;boundary=ZoneMinderFrame\r\n\r\n" );
|
||||
fprintf( fd, "--ZoneMinderFrame\n" );
|
||||
|
||||
|
||||
@@ -1002,18 +1002,26 @@ void Monitor::StreamImages( unsigned long idle, unsigned long refresh, time_t tt
|
||||
setbuf( fd, 0 );
|
||||
|
||||
fprintf( fd, "Server: ZoneMinder Stream Server\r\n" );
|
||||
fprintf( fd, "Pragma: no-cache\r\n" );
|
||||
fprintf( fd, "Cache-Control: no-cache\r\n" );
|
||||
fprintf( fd, "Expires: Thu, 01 Dec 1994 16:00:00 GMT\r\n" );
|
||||
|
||||
time_t now = time( 0 );
|
||||
char date_string[64];
|
||||
strftime( date_string, sizeof(date_string)-1, "%a, %d %b %Y %H:%M:%S GMT", gmtime( &now ) );
|
||||
|
||||
fprintf( fd, "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n" );
|
||||
fprintf( fd, "Last-Modified: %s\r\n", date_string );
|
||||
fprintf( fd, "Cache-Control: no-store, no-cache, must-revalidate\r\n" );
|
||||
fprintf( fd, "Cache-Control: post-check=0, pre-check=0\r\n" );
|
||||
fprintf( fd, "Pragma: no-cache\r\n");
|
||||
|
||||
fprintf( fd, "Content-Type: multipart/x-mixed-replace;boundary=ZoneMinderFrame\r\n\r\n" );
|
||||
fprintf( fd, "--ZoneMinderFrame\n" );
|
||||
|
||||
int last_read_index = image_buffer_count;
|
||||
//JOCTET img_buffer[camera->ImageSize()];
|
||||
JOCTET img_buffer[ZM_MAX_IMAGE_SIZE];
|
||||
static JOCTET img_buffer[ZM_MAX_IMAGE_SIZE];
|
||||
int img_buffer_size = 0;
|
||||
int loop_count = (idle/refresh)-1;
|
||||
|
||||
time_t start_time, now;
|
||||
time_t start_time;
|
||||
time( &start_time );
|
||||
|
||||
while ( true )
|
||||
|
||||
Reference in New Issue
Block a user