diff --git a/.travis.yml b/.travis.yml index 52ba2d486..531fed4da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,15 @@ addons: - curl - sshfs - sed + - binfmt-support + - qemu + - qemu-user-static +install: + - update-binfmts --enable qemu-arm + env: + global: + - SMPFLAGS=-j4 matrix: - OS=el DIST=6 - OS=el DIST=6 ARCH=i386 DOCKER_REPO=knnniggett/packpack @@ -34,6 +42,8 @@ env: - OS=ubuntu DIST=xenial - OS=ubuntu DIST=trusty ARCH=i386 - OS=ubuntu DIST=xenial ARCH=i386 + - OS=raspbian DIST=stretch ARCH=armhf DOCKER_REPO=knnniggett/packpack + compiler: - gcc services: diff --git a/CMakeLists.txt b/CMakeLists.txt index 31f680923..f94b8b05e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,8 @@ if(NOT HOST_OS) "ZoneMinder was unable to deterimine the host OS. Please report this. Value of CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}") endif(NOT HOST_OS) +set (CMAKE_CXX_STANDARD 11) +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") # Default CLFAGS and CXXFLAGS: set(CMAKE_C_FLAGS_RELEASE "-Wall -D__STDC_CONSTANT_MACROS -O2") set(CMAKE_CXX_FLAGS_RELEASE "-Wall -D__STDC_CONSTANT_MACROS -O2") @@ -484,24 +486,24 @@ if(MP4V2_LIBRARIES) if(MP4V2_INCLUDE_DIR) include_directories("${MP4V2_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${MP4V2_INCLUDE_DIR}") + check_include_file("mp4v2/mp4v2.h" HAVE_MP4V2_MP4V2_H) endif(MP4V2_INCLUDE_DIR) - check_include_file("mp4v2/mp4v2.h" HAVE_MP4V2_MP4V2_H) # mp4v2.h find_path(MP4V2_INCLUDE_DIR mp4v2.h) if(MP4V2_INCLUDE_DIR) include_directories("${MP4V2_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${MP4V2_INCLUDE_DIR}") + check_include_file("mp4v2.h" HAVE_MP4V2_H) endif(MP4V2_INCLUDE_DIR) - check_include_file("mp4v2.h" HAVE_MP4V2_H) # mp4.h find_path(MP4V2_INCLUDE_DIR mp4.h) if(MP4V2_INCLUDE_DIR) include_directories("${MP4V2_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${MP4V2_INCLUDE_DIR}") + check_include_file("mp4.h" HAVE_MP4_H) endif(MP4V2_INCLUDE_DIR) - check_include_file("mp4.h" HAVE_MP4_H) mark_as_advanced(FORCE MP4V2_LIBRARIES MP4V2_INCLUDE_DIR) set(optlibsfound "${optlibsfound} mp4v2") diff --git a/db/CMakeLists.txt b/db/CMakeLists.txt index e1b551b1c..c68285e5b 100644 --- a/db/CMakeLists.txt +++ b/db/CMakeLists.txt @@ -11,3 +11,6 @@ install(FILES ${dbfileslist} DESTINATION "${CMAKE_INSTALL_DATADIR}/zoneminder/db # install zm_create.sql install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zm_create.sql" DESTINATION "${CMAKE_INSTALL_DATADIR}/zoneminder/db") + +# install triggers.sql +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/triggers.sql" DESTINATION "${CMAKE_INSTALL_DATADIR}/zoneminder/db") diff --git a/db/triggers.sql b/db/triggers.sql index c98586640..719e09379 100644 --- a/db/triggers.sql +++ b/db/triggers.sql @@ -30,17 +30,6 @@ FOR EACH ROW // DELIMITER ; -DROP TABLE IF EXISTS `Events_Day`; -CREATE TABLE `Events_Day` ( - `EventId` int(10) unsigned NOT NULL, - `MonitorId` int(10) unsigned NOT NULL, - `StartTime` datetime default NULL, - `DiskSpace` bigint unsigned default NULL, - PRIMARY KEY (`EventId`), - KEY `Events_Day_MonitorId_idx` (`MonitorId`), - KEY `Events_Day_StartTime_idx` (`StartTime`) -) ENGINE=@ZM_MYSQL_ENGINE@; - delimiter // DROP TRIGGER IF EXISTS Events_Day_delete_trigger// CREATE TRIGGER Events_Day_delete_trigger BEFORE DELETE ON Events_Day @@ -71,18 +60,6 @@ FOR EACH ROW // -DELIMITER ; -DROP TABLE IF EXISTS `Events_Week`; -CREATE TABLE `Events_Week` ( - `EventId` int(10) unsigned NOT NULL, - `MonitorId` int(10) unsigned NOT NULL, - `StartTime` datetime default NULL, - `DiskSpace` bigint unsigned default NULL, - PRIMARY KEY (`EventId`), - KEY `Events_Week_MonitorId_idx` (`MonitorId`), - KEY `Events_Week_StartTime_idx` (`StartTime`) -) ENGINE=@ZM_MYSQL_ENGINE@; - delimiter // DROP TRIGGER IF EXISTS Events_Week_delete_trigger// CREATE TRIGGER Events_Week_delete_trigger BEFORE DELETE ON Events_Week @@ -112,20 +89,6 @@ FOR EACH ROW END; // -DELIMITER ; - -DROP TABLE IF EXISTS `Events_Month`; -CREATE TABLE `Events_Month` ( - `EventId` int(10) unsigned NOT NULL, - `MonitorId` int(10) unsigned NOT NULL, - `StartTime` datetime default NULL, - `DiskSpace` bigint unsigned default NULL, - PRIMARY KEY (`EventId`), - KEY `Events_Month_MonitorId_idx` (`MonitorId`), - KEY `Events_Month_StartTime_idx` (`StartTime`) -) ENGINE=@ZM_MYSQL_ENGINE@; - -delimiter // DROP TRIGGER IF EXISTS Events_Month_delete_trigger// CREATE TRIGGER Events_Month_delete_trigger BEFORE DELETE ON Events_Month FOR EACH ROW BEGIN @@ -136,7 +99,6 @@ FOR EACH ROW BEGIN END; // - DROP TRIGGER IF EXISTS Events_Month_update_trigger; CREATE TRIGGER Events_Month_update_trigger AFTER UPDATE ON Events_Month FOR EACH ROW @@ -155,55 +117,26 @@ FOR EACH ROW END; // - -DELIMITER ; - -DROP TABLE IF EXISTS `Events_Archived`; -CREATE TABLE `Events_Archived` ( - `EventId` int(10) unsigned NOT NULL, - `MonitorId` int(10) unsigned NOT NULL, - `DiskSpace` bigint unsigned default NULL, - PRIMARY KEY (`EventId`), - KEY `Events_Archived_MonitorId_idx` (`MonitorId`) -) ENGINE=@ZM_MYSQL_ENGINE@; - - -drop procedure if exists update_storage_stats; - -delimiter // - -create procedure update_storage_stats(IN StorageId smallint(5), IN space BIGINT) - -sql security invoker - -deterministic - -begin - - update Storage set DiskSpace = COALESCE(DiskSpace,0) + COALESCE(space,0) where Id = StorageId; - -end; - -// +drop procedure if exists update_storage_stats// drop trigger if exists event_update_trigger// CREATE TRIGGER event_update_trigger AFTER UPDATE ON Events FOR EACH ROW BEGIN - declare diff BIGINT default 0; + declare diff BIGINT default 0; - set diff = COALESCE(NEW.DiskSpace,0) - COALESCE(OLD.DiskSpace,0); + set diff = COALESCE(NEW.DiskSpace,0) - COALESCE(OLD.DiskSpace,0); IF ( NEW.StorageId = OLD.StorageID ) THEN IF ( diff ) THEN - call update_storage_stats(OLD.StorageId, diff); + UPDATE Storage SET DiskSpace = COALESCE(DiskSpace,0) + diff WHERE Id = OLD.StorageId; END IF; ELSE IF ( NEW.DiskSpace ) THEN - call update_storage_stats(NEW.StorageId, NEW.DiskSpace); + UPDATE Storage SET DiskSpace = COALESCE(DiskSpace,0) + NEW.DiskSpace WHERE Id = NEW.StorageId; END IF; IF ( OLD.DiskSpace ) THEN - call update_storage_stats(OLD.StorageId, -OLD.DiskSpace); + UPDATE Storage SET DiskSpace = COALESCE(DiskSpace,0) - OLD.DiskSpace WHERE Id = OLD.StorageId; END IF; END IF; @@ -227,7 +160,7 @@ BEGIN WHERE Id=OLD.MonitorId; END IF; END IF; - ELSE IF ( NEW.Archived AND diff ) THEN + ELSEIF ( NEW.Archived AND diff ) THEN UPDATE Events_Archived SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; END IF; @@ -256,10 +189,10 @@ FOR EACH ROW INSERT INTO Events_Week (EventId,MonitorId,StartTime,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.StartTime,0); INSERT INTO Events_Month (EventId,MonitorId,StartTime,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.StartTime,0); UPDATE Monitors SET - HourEvents = COALESCE(DayEvents,0)+1, + HourEvents = COALESCE(HourEvents,0)+1, DayEvents = COALESCE(DayEvents,0)+1, - WeekEvents = COALESCE(DayEvents,0)+1, - MonthEvents = COALESCE(DayEvents,0)+1, + WeekEvents = COALESCE(WeekEvents,0)+1, + MonthEvents = COALESCE(MonthEvents,0)+1, TotalEvents = COALESCE(TotalEvents,0)+1 WHERE Id=NEW.MonitorId; END; @@ -271,7 +204,7 @@ CREATE TRIGGER event_delete_trigger BEFORE DELETE ON Events FOR EACH ROW BEGIN IF ( OLD.DiskSpace ) THEN - call update_storage_stats(OLD.StorageId, -OLD.DiskSpace); + UPDATE Storage SET DiskSpace = COALESCE(DiskSpace,0) - OLD.DiskSpace WHERE Id = OLD.StorageId; END IF; DELETE FROM Events_Hour WHERE EventId=OLD.Id; DELETE FROM Events_Day WHERE EventId=OLD.Id; diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index c5ae118c8..745420107 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -182,7 +182,7 @@ CREATE TABLE `Devices` ( DROP TABLE IF EXISTS `Events`; CREATE TABLE `Events` ( - `Id` int(10) unsigned NOT NULL auto_increment, + `Id` bigint unsigned NOT NULL auto_increment, `MonitorId` int(10) unsigned NOT NULL default '0', `StorageId` smallint(5) unsigned default 0, `Name` varchar(64) NOT NULL default '', @@ -210,6 +210,7 @@ CREATE TABLE `Events` ( `Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0', `DiskSpace` bigint unsigned default NULL, `Scheme` enum('Deep','Medium','Shallow') NOT NULL default 'Medium', + `Locked` BOOLEAN NOT NULL DEFAULT False, PRIMARY KEY (`Id`), KEY `Events_MonitorId_idx` (`MonitorId`), KEY `Events_StorageId_idx` (`StorageId`), @@ -219,7 +220,7 @@ CREATE TABLE `Events` ( DROP TABLE IF EXISTS `Events_Hour`; CREATE TABLE `Events_Hour` ( - `EventId` int(10) unsigned NOT NULL, + `EventId` BIGINT unsigned NOT NULL, `MonitorId` int(10) unsigned NOT NULL, `StartTime` datetime default NULL, `DiskSpace` bigint unsigned default NULL, @@ -228,40 +229,9 @@ CREATE TABLE `Events_Hour` ( KEY `Events_Hour_StartTime_idx` (`StartTime`) ) ENGINE=@ZM_MYSQL_ENGINE@; -delimiter // -DROP TRIGGER IF EXISTS Events_Hour_delete_trigger// -CREATE TRIGGER Events_Hour_delete_trigger BEFORE DELETE ON Events_Hour -FOR EACH ROW BEGIN - UPDATE Monitors SET - HourEvents = COALESCE(HourEvents,1)-1, - HourEventDiskSpace=COALESCE(HourEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) - WHERE Id=OLD.MonitorId; -END; -// - -DROP TRIGGER IF EXISTS Events_Hour_update_trigger// - -CREATE TRIGGER Events_Hour_update_trigger AFTER UPDATE ON Events_Hour -FOR EACH ROW - BEGIN - declare diff BIGINT default 0; - - set diff = COALESCE(NEW.DiskSpace,0) - COALESCE(OLD.DiskSpace,0); - IF ( diff ) THEN - IF ( NEW.MonitorID != OLD.MonitorID ) THEN - UPDATE Monitors SET HourEventDiskSpace=COALESCE(HourEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) WHERE Monitors.Id=OLD.MonitorId; - UPDATE Monitors SET HourEventDiskSpace=COALESCE(HourEventDiskSpace,0)-COALESCE(NEW.DiskSpace,0) WHERE Monitors.Id=NEW.MonitorId; - ELSE - UPDATE Monitors SET HourEventDiskSpace=COALESCE(HourEventDiskSpace,0)+diff WHERE Monitors.Id=NEW.MonitorId; - END IF; - END IF; - END; -// -DELIMITER ; - DROP TABLE IF EXISTS `Events_Day`; CREATE TABLE `Events_Day` ( - `EventId` int(10) unsigned NOT NULL, + `EventId` BIGINT unsigned NOT NULL, `MonitorId` int(10) unsigned NOT NULL, `StartTime` datetime default NULL, `DiskSpace` bigint unsigned default NULL, @@ -270,40 +240,9 @@ CREATE TABLE `Events_Day` ( KEY `Events_Day_StartTime_idx` (`StartTime`) ) ENGINE=@ZM_MYSQL_ENGINE@; -delimiter // -DROP TRIGGER IF EXISTS Events_Day_delete_trigger// -CREATE TRIGGER Events_Day_delete_trigger BEFORE DELETE ON Events_Day -FOR EACH ROW BEGIN - UPDATE Monitors SET - DayEvents = COALESCE(DayEvents,1)-1, - DayEventDiskSpace=COALESCE(DayEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) - WHERE Id=OLD.MonitorId; -END; -// - -DROP TRIGGER IF EXISTS Events_Day_update_trigger; -CREATE TRIGGER Events_Day_update_trigger AFTER UPDATE ON Events_Day -FOR EACH ROW - BEGIN - declare diff BIGINT default 0; - - set diff = COALESCE(NEW.DiskSpace,0) - COALESCE(OLD.DiskSpace,0); - IF ( diff ) THEN - IF ( NEW.MonitorID != OLD.MonitorID ) THEN - UPDATE Monitors SET DayEventDiskSpace=COALESCE(DayEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) WHERE Monitors.Id=OLD.MonitorId; - UPDATE Monitors SET DayEventDiskSpace=COALESCE(DayEventDiskSpace,0)+COALESCE(NEW.DiskSpace,0) WHERE Monitors.Id=NEW.MonitorId; - ELSE - UPDATE Monitors SET DayEventDiskSpace=COALESCE(DayEventDiskSpace,0)+diff WHERE Monitors.Id=NEW.MonitorId; - END IF; - END IF; - END; - // - - -DELIMITER ; DROP TABLE IF EXISTS `Events_Week`; CREATE TABLE `Events_Week` ( - `EventId` int(10) unsigned NOT NULL, + `EventId` BIGINT unsigned NOT NULL, `MonitorId` int(10) unsigned NOT NULL, `StartTime` datetime default NULL, `DiskSpace` bigint unsigned default NULL, @@ -312,40 +251,9 @@ CREATE TABLE `Events_Week` ( KEY `Events_Week_StartTime_idx` (`StartTime`) ) ENGINE=@ZM_MYSQL_ENGINE@; -delimiter // -DROP TRIGGER IF EXISTS Events_Week_delete_trigger// -CREATE TRIGGER Events_Week_delete_trigger BEFORE DELETE ON Events_Week -FOR EACH ROW BEGIN - UPDATE Monitors SET - WeekEvents = COALESCE(WeekEvents,1)-1, - WeekEventDiskSpace=COALESCE(WeekEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) - WHERE Id=OLD.MonitorId; -END; -// - -DROP TRIGGER IF EXISTS Events_Week_update_trigger; -CREATE TRIGGER Events_Week_update_trigger AFTER UPDATE ON Events_Week -FOR EACH ROW - BEGIN - declare diff BIGINT default 0; - - set diff = COALESCE(NEW.DiskSpace,0) - COALESCE(OLD.DiskSpace,0); - IF ( diff ) THEN - IF ( NEW.MonitorID != OLD.MonitorID ) THEN - UPDATE Monitors SET WeekEventDiskSpace=COALESCE(WeekEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) WHERE Monitors.Id=OLD.MonitorId; - UPDATE Monitors SET WeekEventDiskSpace=COALESCE(WeekEventDiskSpace,0)+COALESCE(NEW.DiskSpace,0) WHERE Monitors.Id=NEW.MonitorId; - ELSE - UPDATE Monitors SET WeekEventDiskSpace=COALESCE(WeekEventDiskSpace,0)+diff WHERE Monitors.Id=NEW.MonitorId; - END IF; - END IF; - END; - // - -DELIMITER ; - DROP TABLE IF EXISTS `Events_Month`; CREATE TABLE `Events_Month` ( - `EventId` int(10) unsigned NOT NULL, + `EventId` BIGINT unsigned NOT NULL, `MonitorId` int(10) unsigned NOT NULL, `StartTime` datetime default NULL, `DiskSpace` bigint unsigned default NULL, @@ -354,177 +262,16 @@ CREATE TABLE `Events_Month` ( KEY `Events_Month_StartTime_idx` (`StartTime`) ) ENGINE=@ZM_MYSQL_ENGINE@; -delimiter // -DROP TRIGGER IF EXISTS Events_Month_delete_trigger// -CREATE TRIGGER Events_Month_delete_trigger BEFORE DELETE ON Events_Month -FOR EACH ROW BEGIN - UPDATE Monitors SET - MonthEvents = COALESCE(MonthEvents,1)-1, - MonthEventDiskSpace=COALESCE(MonthEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) - WHERE Id=OLD.MonitorId; -END; -// - - -DROP TRIGGER IF EXISTS Events_Month_update_trigger; -CREATE TRIGGER Events_Month_update_trigger AFTER UPDATE ON Events_Month -FOR EACH ROW - BEGIN - declare diff BIGINT default 0; - - set diff = COALESCE(NEW.DiskSpace,0) - COALESCE(OLD.DiskSpace,0); - IF ( diff ) THEN - IF ( NEW.MonitorID != OLD.MonitorID ) THEN - UPDATE Monitors SET MonthEventDiskSpace=COALESCE(MonthEventDiskSpace,0)-COALESCE(OLD.DiskSpace) WHERE Monitors.Id=OLD.MonitorId; - UPDATE Monitors SET MonthEventDiskSpace=COALESCE(MonthEventDiskSpace,0)+COALESCE(NEW.DiskSpace) WHERE Monitors.Id=NEW.MonitorId; - ELSE - UPDATE Monitors SET MonthEventDiskSpace=COALESCE(MonthEventDiskSpace,0)+diff WHERE Monitors.Id=NEW.MonitorId; - END IF; - END IF; - END; - // - - -DELIMITER ; DROP TABLE IF EXISTS `Events_Archived`; CREATE TABLE `Events_Archived` ( - `EventId` int(10) unsigned NOT NULL, + `EventId` BIGINT unsigned NOT NULL, `MonitorId` int(10) unsigned NOT NULL, `DiskSpace` bigint unsigned default NULL, PRIMARY KEY (`EventId`), KEY `Events_Archived_MonitorId_idx` (`MonitorId`) ) ENGINE=@ZM_MYSQL_ENGINE@; - -drop procedure if exists update_storage_stats; - -delimiter // - -create procedure update_storage_stats(IN StorageId smallint(5), IN space BIGINT) - -sql security invoker - -deterministic - -begin - - update Storage set DiskSpace = COALESCE(DiskSpace,0) + COALESCE(space,0) where Id = StorageId; - -end; - -// - -drop trigger if exists event_update_trigger// - -CREATE TRIGGER event_update_trigger AFTER UPDATE ON Events -FOR EACH ROW -BEGIN - declare diff BIGINT default 0; - - set diff = COALESCE(NEW.DiskSpace,0) - COALESCE(OLD.DiskSpace,0); - IF ( NEW.StorageId = OLD.StorageID ) THEN - IF ( diff ) THEN - call update_storage_stats(OLD.StorageId, diff); - END IF; - ELSE - IF ( NEW.DiskSpace ) THEN - call update_storage_stats(NEW.StorageId, NEW.DiskSpace); - END IF; - IF ( OLD.DiskSpace ) THEN - call update_storage_stats(OLD.StorageId, -OLD.DiskSpace); - END IF; - END IF; - - UPDATE Events_Hour SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; - UPDATE Events_Day SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; - UPDATE Events_Week SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; - UPDATE Events_Month SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; - - IF ( NEW.Archived != OLD.Archived ) THEN - IF ( NEW.Archived ) THEN - INSERT INTO Events_Archived (EventId,MonitorId,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.DiskSpace); - UPDATE Monitors SET ArchivedEvents = COALESCE(ArchivedEvents,0)+1, ArchivedEventDiskSpace = COALESCE(ArchivedEventDiskSpace,0) + COALESCE(NEW.DiskSpace,0) WHERE Id=NEW.MonitorId; - ELSEIF ( OLD.Archived ) THEN - DELETE FROM Events_Archived WHERE EventId=OLD.Id; - UPDATE Monitors SET ArchivedEvents = COALESCE(ArchivedEvents,0)-1, ArchivedEventDiskSpace = COALESCE(ArchivedEventDiskSpace,0) - COALESCE(OLD.DiskSpace,0) WHERE Id=OLD.MonitorId; - ELSE - IF ( OLD.DiskSpace != NEW.DiskSpace ) THEN - UPDATE Events_Archived SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; - UPDATE Monitors SET - ArchivedEventDiskSpace = COALESCE(ArchivedEventDiskSpace,0) - COALESCE(OLD.DiskSpace,0) + COALESCE(NEW.DiskSpace,0) - WHERE Id=OLD.MonitorId; - END IF; - END IF; - ELSE IF ( NEW.Archived AND diff ) THEN - UPDATE Events_Archived SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; - END IF; - - IF ( diff ) THEN - UPDATE Monitors SET TotalEventDiskSpace = COALESCE(TotalEventDiskSpace,0) - COALESCE(OLD.DiskSpace,0) + COALESCE(NEW.DiskSpace,0) WHERE Id=OLD.MonitorId; - END IF; - -END; - -// - -delimiter ; - -DROP TRIGGER IF EXISTS event_insert_trigger; - -delimiter // -/* The assumption is that when an Event is inserted, it has no size yet, so don't bother updating the DiskSpace, just the count. - * The DiskSpace will get update in the Event Update Trigger - */ -CREATE TRIGGER event_insert_trigger AFTER INSERT ON Events -FOR EACH ROW - BEGIN - - INSERT INTO Events_Hour (EventId,MonitorId,StartTime,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.StartTime,0); - INSERT INTO Events_Day (EventId,MonitorId,StartTime,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.StartTime,0); - INSERT INTO Events_Week (EventId,MonitorId,StartTime,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.StartTime,0); - INSERT INTO Events_Month (EventId,MonitorId,StartTime,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.StartTime,0); - UPDATE Monitors SET - HourEvents = COALESCE(DayEvents,0)+1, - DayEvents = COALESCE(DayEvents,0)+1, - WeekEvents = COALESCE(DayEvents,0)+1, - MonthEvents = COALESCE(DayEvents,0)+1, - TotalEvents = COALESCE(TotalEvents,0)+1 - WHERE Id=NEW.MonitorId; -END; -// - -DROP TRIGGER IF EXISTS event_delete_trigger// - -CREATE TRIGGER event_delete_trigger BEFORE DELETE ON Events -FOR EACH ROW -BEGIN - IF ( OLD.DiskSpace ) THEN - call update_storage_stats(OLD.StorageId, -OLD.DiskSpace); - END IF; - DELETE FROM Events_Hour WHERE EventId=OLD.Id; - DELETE FROM Events_Day WHERE EventId=OLD.Id; - DELETE FROM Events_Week WHERE EventId=OLD.Id; - DELETE FROM Events_Month WHERE EventId=OLD.Id; - IF ( OLD.Archived ) THEN - DELETE FROM Events_Archived WHERE EventId=OLD.Id; - UPDATE Monitors SET - ArchivedEvents = COALESCE(ArchivedEvents,1) - 1, - ArchivedEventDiskSpace = COALESCE(ArchivedEventDiskSpace,0) - COALESCE(OLD.DiskSpace,0), - TotalEvents = COALESCE(TotalEvents,1) - 1, - TotalEventDiskSpace = COALESCE(TotalEventDiskSpace,0) - COALESCE(OLD.DiskSpace,0) - WHERE Id=OLD.MonitorId; - ELSE - UPDATE Monitors SET - TotalEvents = COALESCE(TotalEvents,1)-1, - TotalEventDiskSpace=COALESCE(TotalEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) - WHERE Id=OLD.MonitorId; - END IF; -END; - -// - -delimiter ; -- -- Table structure for table `Filters` -- @@ -557,8 +304,8 @@ CREATE TABLE `Filters` ( DROP TABLE IF EXISTS `Frames`; CREATE TABLE `Frames` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `EventId` int(10) unsigned NOT NULL default '0', + `Id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + `EventId` BIGINT UNSIGNED NOT NULL default '0', `FrameId` int(10) unsigned NOT NULL default '0', `Type` enum('Normal','Bulk','Alarm') NOT NULL default 'Normal', `TimeStamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, @@ -756,18 +503,18 @@ CREATE TABLE `Monitors` ( `WebColour` varchar(32) NOT NULL default 'red', `Exif` tinyint(1) unsigned NOT NULL default '0', `Sequence` smallint(5) unsigned default NULL, - `TotalEvents` int(10) unsigned, - `TotalEventDiskSpace` bigint unsigned, - `HourEvents` int(10) unsigned, - `HourEventDiskSpace` bigint unsigned, - `DayEvents` int(10) unsigned, - `DayEventDiskSpace` bigint unsigned, - `WeekEvents` int(10) unsigned, - `WeekEventDiskSpace` bigint unsigned, - `MonthEvents` int(10) unsigned, - `MonthEventDiskSpace` bigint unsigned, - `ArchivedEvents` int(10) unsigned, - `ArchivedEventDiskSpace` bigint unsigned, + `TotalEvents` int(10) default NULL, + `TotalEventDiskSpace` bigint default NULL, + `HourEvents` int(10) default NULL, + `HourEventDiskSpace` bigint default NULL, + `DayEvents` int(10) default NULL, + `DayEventDiskSpace` bigint default NULL, + `WeekEvents` int(10) default NULL, + `WeekEventDiskSpace` bigint default NULL, + `MonthEvents` int(10) default NULL, + `MonthEventDiskSpace` bigint default NULL, + `ArchivedEvents` int(10) default NULL, + `ArchivedEventDiskSpace` bigint default NULL, `ZoneCount` TINYINT NOT NULL DEFAULT 0, PRIMARY KEY (`Id`) ) ENGINE=@ZM_MYSQL_ENGINE@; @@ -949,33 +696,17 @@ CREATE TABLE `Zones` ( KEY `MonitorId` (`MonitorId`) ) ENGINE=@ZM_MYSQL_ENGINE@; -DELIMITER // -DROP TRIGGER IF EXISTS Zone_Insert_Trigger// -CREATE TRIGGER Zone_Insert_Trigger AFTER INSERT ON Zones -FOR EACH ROW - BEGIN - UPDATE Monitors SET ZoneCount=(SELECT COUNT(*) FROM Zones WHERE MonitorId=NEW.MonitorId) WHERE Id=NEW.MonitorID; - END -// -DROP TRIGGER IF EXISTS Zone_Delete_Trigger// -CREATE TRIGGER Zone_Delete_Trigger AFTER DELETE ON Zones -FOR EACH ROW - BEGIN - UPDATE Monitors SET ZoneCount=(SELECT COUNT(*) FROM Zones WHERE MonitorId=OLD.MonitorId) WHERE Id=OLD.MonitorID; - END -// - -DELIMITER ; - DROP TABLE IF EXISTS `Storage`; CREATE TABLE `Storage` ( `Id` smallint(5) unsigned NOT NULL auto_increment, `Path` varchar(64) NOT NULL default '', `Name` varchar(64) NOT NULL default '', `Type` enum('local','s3fs') NOT NULL default 'local', + `Url` varchar(255) default NULL, `DiskSpace` bigint default NULL, `Scheme` enum('Deep','Medium','Shallow') NOT NULL default 'Medium', `ServerId` int(10) unsigned, + `DoDelete` BOOLEAN NOT NULL DEFAULT true, PRIMARY KEY (`Id`) ) ENGINE=@ZM_MYSQL_ENGINE@; @@ -1040,6 +771,10 @@ INSERT INTO `Controls` VALUES (NULL,'Keekoon','Remote','Keekoon', 0, 0, 0, 0, 0, INSERT INTO `Controls` VALUES (NULL,'HikVision','Local','',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,100,0,0,1,0,0,0,0,1,1,100,1,0,0,0); INSERT INTO `Controls` VALUES (NULL,'Maginon Supra IPC','cURL','MaginonIPC',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,0,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); INSERT INTO `Controls` VALUES (NULL,'Floureon 1080P','Ffmpeg','Floureon',0,0,0,1,0,0,0,1,1,18,1,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,0,1,1,1,0,0,0,1,1,0,0,0,0,1,1,8,0,0,1,0,0,0,0,1,1,8,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Reolink RLC-423','Ffmpeg','Reolink',0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,64,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Reolink RLC-411','Ffmpeg','Reolink',0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Reolink RLC-420','Ffmpeg','Reolink',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'D-LINK DCS-3415','Remote','DCS3415',0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); -- -- Add some monitor preset values @@ -1138,7 +873,7 @@ CREATE TABLE Maps ( PRIMARY KEY (`Id`) ); -DROP TABLE IF EXISTS MontageLayout; +DROP TABLE IF EXISTS MontageLayouts; CREATE TABLE MontageLayouts ( `Id` int(10) unsigned NOT NULL auto_increment, @@ -1155,7 +890,7 @@ INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('4 Wide', '{ "default":{ INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('5 Wide', '{ "default":{"float":"left", "width":"19%","left":"0px","right":"0px","top":"0px","bottom":"0px"} }' ); -- We generally don't alter triggers, we drop and re-create them, so let's keep them in a separate file that we can just source in update scripts. -source triggers.sql +source @ZM_PATH_DATA@/db/triggers.sql -- -- Apply the initial configuration -- diff --git a/db/zm_update-1.31.36.sql b/db/zm_update-1.31.36.sql index a22507f81..ececa7e95 100644 --- a/db/zm_update-1.31.36.sql +++ b/db/zm_update-1.31.36.sql @@ -145,4 +145,4 @@ WeekEventDiskSpace=(SELECT SUM(DiskSpace) FROM Events WHERE MonitorId=Monitors.I MonthEvents=(SELECT COUNT(Id) FROM Events WHERE MonitorId=Monitors.Id AND StartTime > DATE_SUB( NOW(), INTERVAL 1 month)), MonthEventDiskSpace=(SELECT SUM(DiskSpace) FROM Events WHERE MonitorId=Monitors.Id AND StartTime > DATE_SUB(NOW(), INTERVAL 1 month) AND DiskSpace IS NOT NULL), ArchivedEvents=(SELECT COUNT(Id) FROM Events WHERE MonitorId=Monitors.Id AND Archived=1), -ArchivedEventDiskSpace=(SELECT SUM(DiskSpace) FROM Events WHERE MonitorId=Monitors.Id AND Archived=1 AND DiskSpace IS NOT NULL) +ArchivedEventDiskSpace=(SELECT SUM(DiskSpace) FROM Events WHERE MonitorId=Monitors.Id AND Archived=1 AND DiskSpace IS NOT NULL); diff --git a/db/zm_update-1.31.38.sql b/db/zm_update-1.31.38.sql index be3f4fcee..0ca0be6ea 100644 --- a/db/zm_update-1.31.38.sql +++ b/db/zm_update-1.31.38.sql @@ -176,7 +176,7 @@ BEGIN WHERE Id=OLD.MonitorId; END IF; END IF; - ELSE IF ( NEW.Archived AND diff ) THEN + ELSEIF ( NEW.Archived AND diff ) THEN UPDATE Events_Archived SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; END IF; @@ -205,10 +205,10 @@ FOR EACH ROW INSERT INTO Events_Week (EventId,MonitorId,StartTime,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.StartTime,0); INSERT INTO Events_Month (EventId,MonitorId,StartTime,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.StartTime,0); UPDATE Monitors SET - HourEvents = COALESCE(DayEvents,0)+1, + HourEvents = COALESCE(HourEvents,0)+1, DayEvents = COALESCE(DayEvents,0)+1, - WeekEvents = COALESCE(DayEvents,0)+1, - MonthEvents = COALESCE(DayEvents,0)+1, + WeekEvents = COALESCE(WeekEvents,0)+1, + MonthEvents = COALESCE(MonthEvents,0)+1, TotalEvents = COALESCE(TotalEvents,0)+1 WHERE Id=NEW.MonitorId; END; @@ -260,3 +260,17 @@ FOR EACH ROW // DELIMITER ; + +UPDATE Monitors SET +TotalEvents=(SELECT COUNT(*) FROM Events WHERE MonitorId=Monitors.Id), +TotalEventDiskSpace=(SELECT SUM(DiskSpace) FROM Events WHERE MonitorId=Monitors.Id AND DiskSpace IS NOT NULL), +HourEvents=(SELECT COUNT(*) FROM Events_Hour WHERE MonitorId=Monitors.Id), +HourEventDiskSpace=(SELECT SUM(DiskSpace) FROM Events_Hour WHERE MonitorId=Monitors.Id AND DiskSpace IS NOT NULL), +DayEvents=(SELECT COUNT(*) FROM Events_Day WHERE MonitorId=Monitors.Id), +DayEventDiskSpace=(SELECT SUM(DiskSpace) FROM Events_Day WHERE MonitorId=Monitors.Id AND DiskSpace IS NOT NULL), +WeekEvents=(SELECT COUNT(Id) FROM Events_Week WHERE MonitorId=Monitors.Id), +WeekEventDiskSpace=(SELECT SUM(DiskSpace) FROM Events_Week WHERE MonitorId=Monitors.Id AND DiskSpace IS NOT NULL), +MonthEvents=(SELECT COUNT(Id) FROM Events_Month WHERE MonitorId=Monitors.Id), +MonthEventDiskSpace=(SELECT SUM(DiskSpace) FROM Events_Month WHERE MonitorId=Monitors.Id AND DiskSpace IS NOT NULL), +ArchivedEvents=(SELECT COUNT(Id) FROM Events_Archived WHERE MonitorId=Monitors.Id), +ArchivedEventDiskSpace=(SELECT SUM(DiskSpace) FROM Events_Archived WHERE MonitorId=Monitors.Id AND DiskSpace IS NOT NULL); diff --git a/db/zm_update-1.31.39.sql b/db/zm_update-1.31.39.sql new file mode 100644 index 000000000..d40e3a779 --- /dev/null +++ b/db/zm_update-1.31.39.sql @@ -0,0 +1,275 @@ + +ALTER TABLE `Monitors` MODIFY `HourEvents` INT(10) DEFAULT NULL; +ALTER TABLE `Monitors` MODIFY `HourEventDiskSpace` BIGINT DEFAULT NULL; +ALTER TABLE `Monitors` MODIFY `DayEvents` INT(10) DEFAULT NULL; +ALTER TABLE `Monitors` MODIFY `DayEventDiskSpace` BIGINT DEFAULT NULL; +ALTER TABLE `Monitors` MODIFY `WeekEvents` INT(10) DEFAULT NULL; +ALTER TABLE `Monitors` MODIFY `WeekEventDiskSpace` BIGINT DEFAULT NULL; +ALTER TABLE `Monitors` MODIFY `MonthEvents` INT(10) DEFAULT NULL; +ALTER TABLE `Monitors` MODIFY `MonthEventDiskSpace` BIGINT DEFAULT NULL; +ALTER TABLE `Monitors` MODIFY `ArchivedEvents` INT(10) DEFAULT NULL; +ALTER TABLE `Monitors` MODIFY `ArchivedEventDiskSpace` BIGINT DEFAULT NULL; +ALTER TABLE `Monitors` MODIFY `TotalEvents` INT(10) DEFAULT NULL; +ALTER TABLE `Monitors` MODIFY `TotalEventDiskSpace` BIGINT DEFAULT NULL; + +delimiter // +DROP TRIGGER IF EXISTS Events_Hour_delete_trigger// +CREATE TRIGGER Events_Hour_delete_trigger BEFORE DELETE ON Events_Hour +FOR EACH ROW BEGIN + UPDATE Monitors SET + HourEvents = COALESCE(HourEvents,1)-1, + HourEventDiskSpace=COALESCE(HourEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) + WHERE Id=OLD.MonitorId; +END; +// + +DROP TRIGGER IF EXISTS Events_Hour_update_trigger// + +CREATE TRIGGER Events_Hour_update_trigger AFTER UPDATE ON Events_Hour +FOR EACH ROW + BEGIN + declare diff BIGINT default 0; + + set diff = COALESCE(NEW.DiskSpace,0) - COALESCE(OLD.DiskSpace,0); + IF ( diff ) THEN + IF ( NEW.MonitorID != OLD.MonitorID ) THEN + UPDATE Monitors SET HourEventDiskSpace=COALESCE(HourEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) WHERE Monitors.Id=OLD.MonitorId; + UPDATE Monitors SET HourEventDiskSpace=COALESCE(HourEventDiskSpace,0)-COALESCE(NEW.DiskSpace,0) WHERE Monitors.Id=NEW.MonitorId; + ELSE + UPDATE Monitors SET HourEventDiskSpace=COALESCE(HourEventDiskSpace,0)+diff WHERE Monitors.Id=NEW.MonitorId; + END IF; + END IF; + END; +// +DELIMITER ; + +delimiter // +DROP TRIGGER IF EXISTS Events_Day_delete_trigger// +CREATE TRIGGER Events_Day_delete_trigger BEFORE DELETE ON Events_Day +FOR EACH ROW BEGIN + UPDATE Monitors SET + DayEvents = COALESCE(DayEvents,1)-1, + DayEventDiskSpace=COALESCE(DayEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) + WHERE Id=OLD.MonitorId; +END; +// + +DROP TRIGGER IF EXISTS Events_Day_update_trigger; +CREATE TRIGGER Events_Day_update_trigger AFTER UPDATE ON Events_Day +FOR EACH ROW + BEGIN + declare diff BIGINT default 0; + + set diff = COALESCE(NEW.DiskSpace,0) - COALESCE(OLD.DiskSpace,0); + IF ( diff ) THEN + IF ( NEW.MonitorID != OLD.MonitorID ) THEN + UPDATE Monitors SET DayEventDiskSpace=COALESCE(DayEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) WHERE Monitors.Id=OLD.MonitorId; + UPDATE Monitors SET DayEventDiskSpace=COALESCE(DayEventDiskSpace,0)+COALESCE(NEW.DiskSpace,0) WHERE Monitors.Id=NEW.MonitorId; + ELSE + UPDATE Monitors SET DayEventDiskSpace=COALESCE(DayEventDiskSpace,0)+diff WHERE Monitors.Id=NEW.MonitorId; + END IF; + END IF; + END; + // + + +delimiter // +DROP TRIGGER IF EXISTS Events_Week_delete_trigger// +CREATE TRIGGER Events_Week_delete_trigger BEFORE DELETE ON Events_Week +FOR EACH ROW BEGIN + UPDATE Monitors SET + WeekEvents = COALESCE(WeekEvents,1)-1, + WeekEventDiskSpace=COALESCE(WeekEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) + WHERE Id=OLD.MonitorId; +END; +// + +DROP TRIGGER IF EXISTS Events_Week_update_trigger; +CREATE TRIGGER Events_Week_update_trigger AFTER UPDATE ON Events_Week +FOR EACH ROW + BEGIN + declare diff BIGINT default 0; + + set diff = COALESCE(NEW.DiskSpace,0) - COALESCE(OLD.DiskSpace,0); + IF ( diff ) THEN + IF ( NEW.MonitorID != OLD.MonitorID ) THEN + UPDATE Monitors SET WeekEventDiskSpace=COALESCE(WeekEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) WHERE Monitors.Id=OLD.MonitorId; + UPDATE Monitors SET WeekEventDiskSpace=COALESCE(WeekEventDiskSpace,0)+COALESCE(NEW.DiskSpace,0) WHERE Monitors.Id=NEW.MonitorId; + ELSE + UPDATE Monitors SET WeekEventDiskSpace=COALESCE(WeekEventDiskSpace,0)+diff WHERE Monitors.Id=NEW.MonitorId; + END IF; + END IF; + END; + // + +DELIMITER ; + +delimiter // +DROP TRIGGER IF EXISTS Events_Month_delete_trigger// +CREATE TRIGGER Events_Month_delete_trigger BEFORE DELETE ON Events_Month +FOR EACH ROW BEGIN + UPDATE Monitors SET + MonthEvents = COALESCE(MonthEvents,1)-1, + MonthEventDiskSpace=COALESCE(MonthEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) + WHERE Id=OLD.MonitorId; +END; +// + +DROP TRIGGER IF EXISTS Events_Month_update_trigger; +CREATE TRIGGER Events_Month_update_trigger AFTER UPDATE ON Events_Month +FOR EACH ROW + BEGIN + declare diff BIGINT default 0; + + set diff = COALESCE(NEW.DiskSpace,0) - COALESCE(OLD.DiskSpace,0); + IF ( diff ) THEN + IF ( NEW.MonitorID != OLD.MonitorID ) THEN + UPDATE Monitors SET MonthEventDiskSpace=COALESCE(MonthEventDiskSpace,0)-COALESCE(OLD.DiskSpace) WHERE Monitors.Id=OLD.MonitorId; + UPDATE Monitors SET MonthEventDiskSpace=COALESCE(MonthEventDiskSpace,0)+COALESCE(NEW.DiskSpace) WHERE Monitors.Id=NEW.MonitorId; + ELSE + UPDATE Monitors SET MonthEventDiskSpace=COALESCE(MonthEventDiskSpace,0)+diff WHERE Monitors.Id=NEW.MonitorId; + END IF; + END IF; + END; + // + +drop procedure if exists update_storage_stats; +create procedure update_storage_stats(IN StorageId smallint(5), IN space BIGINT) + +sql security invoker + +deterministic + +begin + + update Storage set DiskSpace = COALESCE(DiskSpace,0) + COALESCE(space,0) where Id = StorageId; + +end; + +// + +drop trigger if exists event_update_trigger// + +CREATE TRIGGER event_update_trigger AFTER UPDATE ON Events +FOR EACH ROW +BEGIN + declare diff BIGINT default 0; + + set diff = COALESCE(NEW.DiskSpace,0) - COALESCE(OLD.DiskSpace,0); + IF ( NEW.StorageId = OLD.StorageID ) THEN + IF ( diff ) THEN + call update_storage_stats(OLD.StorageId, diff); + END IF; + ELSE + IF ( NEW.DiskSpace ) THEN + call update_storage_stats(NEW.StorageId, NEW.DiskSpace); + END IF; + IF ( OLD.DiskSpace ) THEN + call update_storage_stats(OLD.StorageId, -OLD.DiskSpace); + END IF; + END IF; + + UPDATE Events_Hour SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; + UPDATE Events_Day SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; + UPDATE Events_Week SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; + UPDATE Events_Month SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; + + IF ( NEW.Archived != OLD.Archived ) THEN + IF ( NEW.Archived ) THEN + INSERT INTO Events_Archived (EventId,MonitorId,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.DiskSpace); + UPDATE Monitors SET ArchivedEvents = COALESCE(ArchivedEvents,0)+1, ArchivedEventDiskSpace = COALESCE(ArchivedEventDiskSpace,0) + COALESCE(NEW.DiskSpace,0) WHERE Id=NEW.MonitorId; + ELSEIF ( OLD.Archived ) THEN + DELETE FROM Events_Archived WHERE EventId=OLD.Id; + UPDATE Monitors SET ArchivedEvents = COALESCE(ArchivedEvents,0)-1, ArchivedEventDiskSpace = COALESCE(ArchivedEventDiskSpace,0) - COALESCE(OLD.DiskSpace,0) WHERE Id=OLD.MonitorId; + ELSE + IF ( OLD.DiskSpace != NEW.DiskSpace ) THEN + UPDATE Events_Archived SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; + UPDATE Monitors SET + ArchivedEventDiskSpace = COALESCE(ArchivedEventDiskSpace,0) - COALESCE(OLD.DiskSpace,0) + COALESCE(NEW.DiskSpace,0) + WHERE Id=OLD.MonitorId; + END IF; + END IF; + ELSEIF ( NEW.Archived AND diff ) THEN + UPDATE Events_Archived SET DiskSpace=NEW.DiskSpace WHERE EventId=NEW.Id; + END IF; + + IF ( diff ) THEN + UPDATE Monitors SET TotalEventDiskSpace = COALESCE(TotalEventDiskSpace,0) - COALESCE(OLD.DiskSpace,0) + COALESCE(NEW.DiskSpace,0) WHERE Id=OLD.MonitorId; + END IF; + +END; + +// + +delimiter ; + +DROP TRIGGER IF EXISTS event_insert_trigger; + +delimiter // +/* The assumption is that when an Event is inserted, it has no size yet, so don't bother updating the DiskSpace, just the count. + * The DiskSpace will get update in the Event Update Trigger + */ +CREATE TRIGGER event_insert_trigger AFTER INSERT ON Events +FOR EACH ROW + BEGIN + + INSERT INTO Events_Hour (EventId,MonitorId,StartTime,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.StartTime,0); + INSERT INTO Events_Day (EventId,MonitorId,StartTime,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.StartTime,0); + INSERT INTO Events_Week (EventId,MonitorId,StartTime,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.StartTime,0); + INSERT INTO Events_Month (EventId,MonitorId,StartTime,DiskSpace) VALUES (NEW.Id,NEW.MonitorId,NEW.StartTime,0); + UPDATE Monitors SET + HourEvents = COALESCE(HourEvents,0)+1, + DayEvents = COALESCE(DayEvents,0)+1, + WeekEvents = COALESCE(WeekEvents,0)+1, + MonthEvents = COALESCE(MonthEvents,0)+1, + TotalEvents = COALESCE(TotalEvents,0)+1 + WHERE Id=NEW.MonitorId; +END; +// + +DROP TRIGGER IF EXISTS event_delete_trigger// + +CREATE TRIGGER event_delete_trigger BEFORE DELETE ON Events +FOR EACH ROW +BEGIN + IF ( OLD.DiskSpace ) THEN + call update_storage_stats(OLD.StorageId, -OLD.DiskSpace); + END IF; + DELETE FROM Events_Hour WHERE EventId=OLD.Id; + DELETE FROM Events_Day WHERE EventId=OLD.Id; + DELETE FROM Events_Week WHERE EventId=OLD.Id; + DELETE FROM Events_Month WHERE EventId=OLD.Id; + IF ( OLD.Archived ) THEN + DELETE FROM Events_Archived WHERE EventId=OLD.Id; + UPDATE Monitors SET + ArchivedEvents = COALESCE(ArchivedEvents,1) - 1, + ArchivedEventDiskSpace = COALESCE(ArchivedEventDiskSpace,0) - COALESCE(OLD.DiskSpace,0), + TotalEvents = COALESCE(TotalEvents,1) - 1, + TotalEventDiskSpace = COALESCE(TotalEventDiskSpace,0) - COALESCE(OLD.DiskSpace,0) + WHERE Id=OLD.MonitorId; + ELSE + UPDATE Monitors SET + TotalEvents = COALESCE(TotalEvents,1)-1, + TotalEventDiskSpace=COALESCE(TotalEventDiskSpace,0)-COALESCE(OLD.DiskSpace,0) + WHERE Id=OLD.MonitorId; + END IF; +END; + +// + +DROP TRIGGER IF EXISTS Zone_Insert_Trigger// +CREATE TRIGGER Zone_Insert_Trigger AFTER INSERT ON Zones +FOR EACH ROW + BEGIN + UPDATE Monitors SET ZoneCount=(SELECT COUNT(*) FROM Zones WHERE MonitorId=NEW.MonitorId) WHERE Id=NEW.MonitorID; + END +// +DROP TRIGGER IF EXISTS Zone_Delete_Trigger// +CREATE TRIGGER Zone_Delete_Trigger AFTER DELETE ON Zones +FOR EACH ROW + BEGIN + UPDATE Monitors SET ZoneCount=(SELECT COUNT(*) FROM Zones WHERE MonitorId=OLD.MonitorId) WHERE Id=OLD.MonitorID; + END +// + +DELIMITER ; diff --git a/db/zm_update-1.31.40.sql b/db/zm_update-1.31.40.sql new file mode 100644 index 000000000..79fc3836c --- /dev/null +++ b/db/zm_update-1.31.40.sql @@ -0,0 +1,12 @@ + +SET @s = (SELECT IF( + (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE() + AND table_name = 'Storage' + AND column_name = 'Url' + ) > 0, +"SELECT 'Column Url already exists in Storage'", +"ALTER TABLE `Storage` ADD `Url` VARCHAR(255) default NULL AFTER `Type`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; diff --git a/db/zm_update-1.31.41.sql b/db/zm_update-1.31.41.sql new file mode 100644 index 000000000..e2b45df5b --- /dev/null +++ b/db/zm_update-1.31.41.sql @@ -0,0 +1,25 @@ + +SET @s = (SELECT IF( + (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE() + AND table_name = 'Storage' + AND column_name = 'DoDelete' + ) > 0, +"SELECT 'Column DoDelete already exists in Storage'", +"ALTER TABLE `Storage` ADD `DoDelete` BOOLEAN NOT NULL default true AFTER `ServerId`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; + +SET @s = (SELECT IF( + (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE() + AND table_name = 'Events' + AND column_name = 'Locked' + ) > 0, +"SELECT 'Column Locked already exists in Events'", +"ALTER TABLE `Events` ADD `Locked` BOOLEAN NOT NULL default false AFTER `Scheme`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; + diff --git a/db/zm_update-1.31.42.sql b/db/zm_update-1.31.42.sql new file mode 100644 index 000000000..d3be126ff --- /dev/null +++ b/db/zm_update-1.31.42.sql @@ -0,0 +1,32 @@ + +ALTER TABLE `Frames` MODIFY `Id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT; +ALTER TABLE `Events` MODIFY `Id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT; +ALTER TABLE `Frames` MODIFY `EventId` BIGINT UNSIGNED NOT NULL; +ALTER TABLE `Stats` MODIFY `EventId` BIGINT UNSIGNED NOT NULL; + +ALTER TABLE `Events_Hour` MODIFY `EventId` BIGINT UNSIGNED NOT NULL; +SET @s = (SELECT IF( + (SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_TYPE='FOREIGN KEY' + AND table_name = 'Events' + AND column_name = 'Locked' + ) > 0, +"SELECT 'Column Locked already exists in Events'", +"ALTER TABLE `Events` ADD `Locked` BOOLEAN NOT NULL default false AFTER `Scheme`" +)); +ALTER TABLE `Events_Hour` ADD CONSTRAINT Events_Hour_EventId_fk FOREIGN KEY (`EventId`) REFERENCES `Events`(`Id`) ON DELETE CASCADE; +ALTER TABLE `Events_Day` MODIFY `EventId` BIGINT UNSIGNED NOT NULL; +ALTER TABLE `Events_Day` ADD CONSTRAINT Events_Day_EventId_fk FOREIGN KEY (`EventId`) REFERENCES `Events`(`Id`) ON DELETE CASCADE; +ALTER TABLE `Events_Week` MODIFY `EventId` BIGINT UNSIGNED NOT NULL; +ALTER TABLE `Events_Week` ADD CONSTRAINT Events_Week_EventId_fk FOREIGN KEY (`EventId`) REFERENCES `Events`(`Id`) ON DELETE CASCADE; +ALTER TABLE `Events_Month` MODIFY `EventId` BIGINT UNSIGNED NOT NULL; +ALTER TABLE `Events_Month` ADD CONSTRAINT Events_Month_EventId_fk FOREIGN KEY (`EventId`) REFERENCES `Events`(`Id`) ON DELETE CASCADE; +ALTER TABLE `Events_Archived` MODIFY `EventId` BIGINT UNSIGNED NOT NULL; +ALTER TABLE `Events_Archived` ADD CONSTRAINT Events_Archived_EventId_fk FOREIGN KEY (`EventId`) REFERENCES `Events`(`Id`) ON DELETE CASCADE; + +ALTER TABLE `Stats` ADD CONSTRAINT Stats_MonitorId_fk FOREIGN KEY (`MonitorId`) REFERENCES `Monitors`(`Id`) ON DELETE CASCADE; +ALTER TABLE `Stats` ADD CONSTRAINT Stats_EventId_fk FOREIGN KEY (`EventId`) REFERENCES `Events`(`Id`) ON DELETE CASCADE; +ALTER TABLE `Stats` ADD CONSTRAINT Stats_ZoneId_fk FOREIGN KEY (`ZoneId`) REFERENCES `Zones`(`Id`) ON DELETE CASCADE; + +ALTER TABLE `Frames` ADD CONSTRAINT Frames_EventId_fk FOREIGN KEY (`EventId`) REFERENCES `Events`(`Id`) ON DELETE CASCADE; +ALTER TABLE `Frames` DROP INDEX `Type`; + diff --git a/distros/debian/postinst b/distros/debian/postinst index 20f715793..3cd3fd277 100644 --- a/distros/debian/postinst +++ b/distros/debian/postinst @@ -5,6 +5,9 @@ set -e if [ "$1" = "configure" ]; then . /etc/zm/zm.conf + for i in /etc/zm/conf.d/*.conf; do + . $i + done; # The logs can contain passwords, etc... so by setting group root, only www-data can read them, not people in the www-data group. chown www-data:root /var/log/zm diff --git a/distros/redhat/zoneminder.spec b/distros/redhat/zoneminder.spec index 10ce1ff0a..0226d777f 100644 --- a/distros/redhat/zoneminder.spec +++ b/distros/redhat/zoneminder.spec @@ -83,6 +83,10 @@ BuildRequires: libcurl-devel BuildRequires: libv4l-devel BuildRequires: ffmpeg-devel +# Required for mp4 container support +BuildRequires: libmp4v2-devel +BuildRequires: x264-devel + %{?with_nginx:Requires: nginx} %{?with_nginx:Requires: fcgiwrap} %{?with_nginx:Requires: php-fpm} diff --git a/distros/ubuntu1204/control b/distros/ubuntu1204/control index ad751ef71..8c9bf2e61 100644 --- a/distros/ubuntu1204/control +++ b/distros/ubuntu1204/control @@ -54,6 +54,8 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} ,liburi-encode-perl ,libwww-perl ,libdata-uuid-perl + ,libnumber-bytes-human + ,libfile-slurp-perl ,mysql-client | virtual-mysql-client ,perl-modules ,php5-mysql, php5-gd, php5-apcu, php-apc diff --git a/distros/ubuntu1204/zoneminder.postinst b/distros/ubuntu1204/zoneminder.postinst index 06b976037..ef715375b 100644 --- a/distros/ubuntu1204/zoneminder.postinst +++ b/distros/ubuntu1204/zoneminder.postinst @@ -5,6 +5,10 @@ set -e if [ "$1" = "configure" ]; then . /etc/zm/zm.conf + for i in /etc/zm/conf.d/*.conf; do + . $i + done; + # The logs can contain passwords, etc... so by setting group root, only www-data can read them, not people in the www-data group chown www-data:root /var/log/zm diff --git a/distros/ubuntu1604/README.Debian b/distros/ubuntu1604/README.Debian index 8182e0678..4fe3464d2 100644 --- a/distros/ubuntu1604/README.Debian +++ b/distros/ubuntu1604/README.Debian @@ -23,8 +23,7 @@ configuration file: Upgrading database ------------------ -Prior to 1.28.1 database upgrade was performed automatically. -"zoneminder" service will refuse to start with outdated database. +The database is updated automatically on installation. You should not need to take this step. Assuming that database is on "localhost" then the following command can be used to upgrade "zm" database: @@ -45,17 +44,11 @@ The following command prints the current version of zoneminder database: Enabling service ---------------- -By default Zoneminder service is not starting automatically and need to be -manually activated once database is configured: - -On systemd: +By default Zoneminder service is not automatically started and needs to be +manually enabled once database is configured: sudo systemctl enable zoneminder.service -On SysV: - - sudo update-rc.d zoneminder enable - Web server set-up ----------------- @@ -82,10 +75,10 @@ Common configuration steps for Apache2: ## nginx / fcgiwrap -Nginx needs "php5-fpm" package to support PHP and "fcgiwrap" package +Nginx needs "php-fpm" package to support PHP and "fcgiwrap" package for binary "cgi-bin" applications: - sudo apt-get install php5-fpm fcgiwrap + sudo apt-get install php-fpm fcgiwrap To enable a URL alias that makes Zoneminder available from @@ -119,32 +112,9 @@ site configuration. Changing the location for images and events ------------------------------------------- -Zoneminder, in its upstream form, stores data in /usr/share/zoneminder/. This -package modifies that by changing /usr/share/zoneminder/images and -/usr/share/zoneminder/events to symlinks to directories under -/var/cache/zoneminder. - -There are numerous places these could be put and ways to do it. But, at the -moment, if you change this, an upgrade will fail with a warning about these -locations having changed (the reason for this was that previously, an upgrade -would silently revert the changes and cause event loss - refer -bug #608793). - -If you do want to change the location, here are a couple of suggestions. -(thanks to vagrant@freegeek.org): - -These lines in fstab could allow you to bind-mount an alternate location - - /dev/sdX1 /otherdrive ext3 defaults 0 2 - /otherdrive/zoneminder/images /var/cache/zoneminder/images bind defaults 0 2 - /otherdrive/zoneminder/events /var/cache/zoneminder/events bind defaults 0 2 - - or if you have a separate partition for each: - - /dev/sdX1 /var/cache/zoneminder/images ext3 defaults 0 2 - /dev/sdX2 /var/cache/zoneminder/events ext3 defaults 0 2 - - -- Peter Howard , Sun, 16 Jan 2010 01:35:51 +1100 +ZoneMinder is now able to be configured to use an alternative location for storing +events and images at compile time. This package makes use of that, so symlinks in +/usr/share/zoneminder/www are no longer necessary. Access to /dev/video* --------------------- diff --git a/distros/ubuntu1604/changelog b/distros/ubuntu1604/changelog index 3ea02e3ea..616f75178 100644 --- a/distros/ubuntu1604/changelog +++ b/distros/ubuntu1604/changelog @@ -1,7 +1,3 @@ -zoneminder (1.31.4-vivid1) vivid; urgency=medium - - * Release 1.31.4 - - -- Isaac Connor Thu, 21 Sep 2017 09:55:31 -0700 - - +zoneminder (1.31.39~20180223.27-stretch-1) unstable; urgency=low + * + -- Isaac Connor Fri, 23 Feb 2018 14:15:59 -0500 diff --git a/distros/ubuntu1604/control b/distros/ubuntu1604/control index 347d494b4..2c7549b16 100644 --- a/distros/ubuntu1604/control +++ b/distros/ubuntu1604/control @@ -16,7 +16,7 @@ Build-Depends: debhelper (>= 9), dh-systemd, python-sphinx | python3-sphinx, apa ,libcurl4-gnutls-dev ,libgnutls-openssl-dev ,libjpeg8-dev | libjpeg9-dev | libjpeg62-turbo-dev - ,libmysqlclient-dev | libmariadbclient-dev + ,default-libmysqlclient-dev | libmysqlclient-dev | libmariadbclient-dev-compat ,libpcre3-dev ,libpolkit-gobject-1-dev ,libv4l-dev (>= 0.8.3) [!hurd-any] @@ -39,7 +39,7 @@ Package: zoneminder Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} ,javascript-common - ,libmp4v2-2, libx264-142|libx264-148, libswscale-ffmpeg3|libswscale4|libswscale3 + ,libmp4v2-2, libx264-142|libx264-148|libx264-152, libswscale-ffmpeg3|libswscale4|libswscale3 ,ffmpeg | libav-tools ,libdate-manip-perl, libmime-lite-perl, libmime-tools-perl ,libdbd-mysql-perl @@ -61,7 +61,9 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} ,libdigest-sha-perl ,libsys-cpu-perl, libsys-cpuload-perl, libsys-meminfo-perl ,libdata-uuid-perl - ,mysql-client | virtual-mysql-client + ,libnumber-bytes-human-perl + ,libfile-slurp-perl + ,mysql-client | mariadb-client | virtual-mysql-client ,perl-modules ,php5-mysql | php-mysql, php5-gd | php-gd , php5-apcu | php-apcu , php-apc | php-apcu-bc ,policykit-1 @@ -70,7 +72,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} ,libpcre3 Recommends: ${misc:Recommends} ,libapache2-mod-php5 | libapache2-mod-php | php5-fpm | php-fpm - ,mysql-server | virtual-mysql-server + ,mysql-server | mariadb-server | virtual-mysql-server ,zoneminder-doc (>= ${source:Version}) ,ffmpeg Suggests: fcgiwrap, logrotate diff --git a/distros/ubuntu1604/rules b/distros/ubuntu1604/rules index 53a9a237a..97c084e42 100755 --- a/distros/ubuntu1604/rules +++ b/distros/ubuntu1604/rules @@ -66,9 +66,6 @@ override_dh_fixperms: chown root:www-data $(CURDIR)/debian/zoneminder/etc/zm/zm.conf chmod 640 $(CURDIR)/debian/zoneminder/etc/zm/zm.conf -override_dh_installinit: - dh_installinit --no-start - override_dh_systemd_start: dh_systemd_start --no-start diff --git a/distros/ubuntu1604/zoneminder.init b/distros/ubuntu1604/zoneminder.init deleted file mode 100644 index 5cdf62165..000000000 --- a/distros/ubuntu1604/zoneminder.init +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: zoneminder -# Required-Start: $network $remote_fs $syslog -# Required-Stop: $network $remote_fs $syslog -# Should-Start: mysql -# Should-Stop: mysql -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Control ZoneMinder as a Service -# Description: ZoneMinder CCTV recording and surveillance system -### END INIT INFO -# chkconfig: 2345 20 20 - -# Source function library. -. /lib/lsb/init-functions - -prog=ZoneMinder -ZM_PATH_BIN="/usr/bin" -RUNDIR="/var/run/zm" -TMPDIR="/tmp/zm" -command="$ZM_PATH_BIN/zmpkg.pl" - -start() { - echo -n "Starting $prog: " - export TZ=:/etc/localtime - mkdir -p "$RUNDIR" && chown www-data:www-data "$RUNDIR" - mkdir -p "$TMPDIR" && chown www-data:www-data "$TMPDIR" - $command start - RETVAL=$? - [ $RETVAL = 0 ] && echo success - [ $RETVAL != 0 ] && echo failure - echo - [ $RETVAL = 0 ] && touch /var/lock/zm - return $RETVAL -} -stop() { - echo -n "Stopping $prog: " - # - # Why is this status check being done? - # as $command stop returns 1 if zoneminder - # is stopped, which will result in - # this returning 1, which will stuff - # dpkg when it tries to stop zoneminder before - # uninstalling . . . - # - result=`$command status` - if [ ! "$result" = "running" ]; then - echo "Zoneminder already stopped" - echo - RETVAL=0 - else - $command stop - RETVAL=$? - [ $RETVAL = 0 ] && echo success - [ $RETVAL != 0 ] && echo failure - echo - [ $RETVAL = 0 ] && rm -f /var/lock/zm - fi -} -status() { - result=`$command status` - if [ "$result" = "running" ]; then - echo "ZoneMinder is running" - RETVAL=0 - else - echo "ZoneMinder is stopped" - RETVAL=1 - fi -} - -case "$1" in -'start') - start - ;; -'stop') - stop - ;; -'restart' | 'force-reload') - stop - start - ;; -'status') - status - ;; -*) - echo "Usage: $0 { start | stop | restart | status }" - RETVAL=1 - ;; -esac -exit $RETVAL diff --git a/distros/ubuntu1604/zoneminder.postinst b/distros/ubuntu1604/zoneminder.postinst index 66d696208..a41367add 100644 --- a/distros/ubuntu1604/zoneminder.postinst +++ b/distros/ubuntu1604/zoneminder.postinst @@ -1,33 +1,55 @@ #! /bin/sh -set -e +set +e if [ "$1" = "configure" ]; then - + . /etc/zm/zm.conf - + for CONFFILE in /etc/zm/conf.d/*.conf; do + . "$CONFFILE" + done + # The logs can contain passwords, etc... so by setting group root, only www-data can read them, not people in the www-data group chown www-data:root /var/log/zm chown www-data:www-data /var/lib/zm if [ -z "$2" ]; then - chown www-data:www-data /var/cache/zoneminder /var/cache/zoneminder/* /usr/share/zoneminder/www/cache + chown www-data:www-data /var/cache/zoneminder /var/cache/zoneminder/* /usr/share/zoneminder/www/cache fi - if [ ! -e "/etc/apache2/mods-enabled/cgi.load" ]; then + if [ ! -e "/etc/apache2/mods-enabled/cgi.load" ] && [ "$(command -v a2enmod)" != "" ]; then echo "The cgi module is not enabled in apache2. I am enabling it using a2enmod cgi." a2enmod cgi fi if [ "$ZM_DB_HOST" = "localhost" ]; then - if [ -e "/etc/init.d/mysql" ]; then - # Do this every time the package is installed or upgraded + if [ -e "/lib/systemd/system/mysql.service" ] || [ -e "/lib/systemd/system/mariadb.service" ]; then # Ensure zoneminder is stopped deb-systemd-invoke stop zoneminder.service || exit $? - + # - # Get mysql started if it isn't + # Get mysql started if it isn't running # - if $(/etc/init.d/mysql status >/dev/null 2>&1); then + + if [ -e "/lib/systemd/system/mariadb.service" ]; then + DBSERVICE="mariadb.service" + else + DBSERVICE="mysql.service" + fi + if systemctl is-failed --quiet $DBSERVICE; then + echo "$DBSERVICE is in a failed state; it will not be started." + echo "If you have already resolved the problem preventing $DBSERVICE from running," + echo "run sudo systemctl restart $DBSERVICE then run sudo dpkg-reconfigure zoneminder." + exit 1 + fi + + if ! systemctl is-active --quiet mysql.service mariadb.service; then + # Due to /etc/init.d service autogeneration, mysql.service always returns the status of mariadb.service + # However, mariadb.service will not return the status of mysql.service. + deb-systemd-invoke start $DBSERVICE + fi + + # Make sure systemctl status exit code is 0; i.e. the DB is running + if systemctl is-active --quiet "$DBSERVICE"; then mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload # test if database if already present... if ! $(echo quit | mysql --defaults-file=/etc/mysql/debian.cnf zm > /dev/null 2> /dev/null) ; then @@ -37,26 +59,21 @@ if [ "$1" = "configure" ]; then else echo "grant lock tables,alter,drop,select,insert,update,delete,create,index,alter routine,create routine, trigger,execute on ${ZM_DB_NAME}.* to '${ZM_DB_USER}'@localhost;" | mysql --defaults-file=/etc/mysql/debian.cnf mysql fi - - zmupdate.pl --nointeractive - zmupdate.pl --nointeractive -f - - # Add any new PTZ control configurations to the database (will not overwrite) - zmcamtool.pl --import >/dev/null 2>&1 - + else - echo 'NOTE: mysql not running, please start mysql and run dpkg-reconfigure zoneminder when it is running.' + echo 'NOTE: MySQL/MariaDB not running; please start mysql and run dpkg-reconfigure zoneminder when it is running.' fi else - echo 'mysql not found, assuming remote server.' + echo 'MySQL/MariaDB not found; assuming remote server.' fi else - echo "Not doing database upgrade due to remote db server ($ZM_DB_HOST)" + echo "Not doing database upgrade due to remote db server ($ZM_DB_HOST)." fi - echo "Done Updating, starting ZoneMinder" - deb-systemd-invoke restart zoneminder.service || exit $? + echo "Done Updating; starting ZoneMinder." + deb-systemd-invoke restart zoneminder.service + fi #DEBHELPER# diff --git a/docs/api.rst b/docs/api.rst index 36467525a..706748880 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -98,15 +98,15 @@ This command will add a new http monitor. :: - curl -XPOST http://server/zm/api/monitors.json -d "Monitor[Name]=Cliff-Burton \ - &Monitor[Function]=Modect \ - &Monitor[Protocol]=http \ - &Monitor[Method]=simple \ - &Monitor[Host]=usr:pass@192.168.11.20 \ - &Monitor[Port]=80 \ - &Monitor[Path]=/mjpg/video.mjpg \ - &Monitor[Width]=704 \ - &Monitor[Height]=480 \ + curl -XPOST http://server/zm/api/monitors.json -d "Monitor[Name]=Cliff-Burton\ + &Monitor[Function]=Modect\ + &Monitor[Protocol]=http\ + &Monitor[Method]=simple\ + &Monitor[Host]=usr:pass@192.168.11.20\ + &Monitor[Port]=80\ + &Monitor[Path]=/mjpg/video.mjpg\ + &Monitor[Width]=704\ + &Monitor[Height]=480\ &Monitor[Colours]=4" Edit monitor 1 @@ -304,26 +304,26 @@ Create a Zone :: - curl -XPOST http://server/zm/api/zones.json -d "Zone[Name]=Jason-Newsted \ - &Zone[MonitorId]=3 \ - &Zone[Type]=Active \ - &Zone[Units]=Percent \ - &Zone[NumCoords]=4 \ - &Zone[Coords]=0,0 639,0 639,479 0,479 \ - &Zone[AlarmRGB]=16711680 \ - &Zone[CheckMethod]=Blobs \ - &Zone[MinPixelThreshold]=25 \ - &Zone[MaxPixelThreshold]= \ - &Zone[MinAlarmPixels]=9216 \ - &Zone[MaxAlarmPixels]= \ - &Zone[FilterX]=3 \ - &Zone[FilterY]=3 \ - &Zone[MinFilterPixels]=9216 \ - &Zone[MaxFilterPixels]=230400 \ - &Zone[MinBlobPixels]=6144 \ - &Zone[MaxBlobPixels]= \ - &Zone[MinBlobs]=1 \ - &Zone[MaxBlobs]= \ + curl -XPOST http://server/zm/api/zones.json -d "Zone[Name]=Jason-Newsted\ + &Zone[MonitorId]=3\ + &Zone[Type]=Active\ + &Zone[Units]=Percent\ + &Zone[NumCoords]=4\ + &Zone[Coords]=0,0 639,0 639,479 0,479\ + &Zone[AlarmRGB]=16711680\ + &Zone[CheckMethod]=Blobs\ + &Zone[MinPixelThreshold]=25\ + &Zone[MaxPixelThreshold]=\ + &Zone[MinAlarmPixels]=9216\ + &Zone[MaxAlarmPixels]=\ + &Zone[FilterX]=3\ + &Zone[FilterY]=3\ + &Zone[MinFilterPixels]=9216\ + &Zone[MaxFilterPixels]=230400\ + &Zone[MinBlobPixels]=6144\ + &Zone[MaxBlobPixels]=\ + &Zone[MinBlobs]=1\ + &Zone[MaxBlobs]=\ &Zone[OverloadFrames]=0" PTZ Control APIs diff --git a/docs/faq.rst b/docs/faq.rst index 87421ddb9..d6694b153 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -71,22 +71,22 @@ The 1.2 at the start is basically adding 20% on top of the calculation to accoun The math breakdown for 4 cameras running at 1280x960 capture, 50 frame buffer, 24 bit color space: :: - 1280*960 = 1,228,800 (bits) - 1,228,800 * 24 = 2,359,296,000 (bits) - 2,359,296,000 * 50 = 5,898,240,000 (bits) - 5,898,240,000 * 4 = 7,077,888,000 (bits) - 7,077,888,000 / 8 = 884,736,000 (bytes) - 884,736,000 / 1000 = 884,736 (Kilobytes) - 884,736 / 1000 = 864 (Megabytes) - 864 / 1000 = 0.9 (Gigabyte) + 1280*960 = 1,228,800 (bytes) + 1,228,800 * (3 bytes for 24 bit) = 3,686,400 (bytes) + 3,686,400 * 50 = 184,320,000 (bytes) + 184,320,000 * 4 = 737,280,000 (bytes) + 737,280,000 / 1024 = 720,000 (Kilobytes) + 720,000 / 1024 = 703.125 (Megabytes) + 703.125 / 1024 = 0.686 (Gigabytes) -Around 900MB of memory. +Around 700MB of memory. So if you have 2GB of memory, you should be all set. Right? **Not, really**: * This is just the base memory required to capture the streams. Remember ZM is always capturing streams irrespective of whether you are actually recording or not - to make sure its image ring buffer is there with pre images when an alarm kicks in. * You also need to account for other processes not related to ZM running in your box * You also need to account for other ZM processes - for example, I noticed the audit daemon takes up a good amount of memory when it runs, DB updates also take up memory + * If you are using H264 encoding, that buffers a lot of frames in memory as well. So a good rule of thumb is to make sure you have twice the memory as the calculation above (and if you are using the ZM server for other purposes, please factor in those memory requirements as well) @@ -128,15 +128,14 @@ So, for example: :: 384x288 capture resolution, that makes: 110 592 pixels - in 24 bit color that's x24 = 2 654 208 bits per frame - by 80 frames ring buffer x80 = 212 336 640 bits per camera - by 4 cameras x4 = 849 346 560 bits. - Plus 10% overhead = 934 281 216 bits - That's 116 785 152 bytes, and - = 114 048 kB, respectively 111.38 MB. - If my shared memory is set to 134 217 728, which is exactly 128MB, + in 24 bit color that's x 3 = 331,776 bytes per frame + by 80 frames ring buffer x80 = 26,542,080 bytes per camera + by 4 cameras x4 = 106,168,320 bytes. + Plus 10% overhead = 116,785,152 bytes + Thats 114,048 kB, respectively 111.38 MB. + If my shared memory is set to 134,217,728, which is exactly 128MB, that means I shouldn't have any problem. - (Note that 1 byte = 8 bits and 1kbyte = 1024bytes, 1MB = 1024 kB) + (Note that 1kbyte = 1024bytes, 1MB = 1024 kB) If for instance you were using 24bit 640x480 then this would come to about 92Mb if you are using the default buffer size of 100. If this is too large then you can either reduce the image or buffer sizes or increase the maximum amount of shared memory available. If you are using RedHat then you can get details on how to change these settings `here `__ diff --git a/docs/installationguide/dedicateddrive.rst b/docs/installationguide/dedicateddrive.rst new file mode 100644 index 000000000..40db1ee93 --- /dev/null +++ b/docs/installationguide/dedicateddrive.rst @@ -0,0 +1,39 @@ +Dedicated Drive, Partition, or Network Share +============================================ + +One of the first steps the end user must perform after installing ZoneMinder is to dedicate an entire partition, drive, or network share for ZoneMinder's event storage. +The reason being, ZoneMinder will, by design, fill up your hard disk, and you don't want to do that to your root volume! + +The following steps apply to ZoneMinder 1.31 or newer, running on a typical Linux system, which uses systemd. +If you are using an older version of ZoneMinder, please follow the legacy steps in the `ZoneMinder Wiki `_. + +**Step 1:** Stop ZoneMinder +:: + + sudo systemctl stop zoneminder + +**Step 2:** Mount your dedicated drive, partition, or network share to the local filesystem in any folder of your choosing. +We recommend you use systemd to manage the mount points. +Instructions on how to accomplish this can be found `here `_ and `here `_. +Note that bind mounting ZoneMinder's images folder is optional. Newer version of ZoneMinder write very little, if anything, to the images folder. +Verify the dedicated drive, partition, or network share is successfully mounted before proceeding to the next step. + +**Step 3:** Set the owner and group to that of the web server user account. Debian based distros typically use "www-data" as the web server user account while many rpm based distros use "apache". +:: + + sudo chown -R apache:apache /path/to/your/zoneminder/events/folder + sudo chown -R apache:apache /path/to/your/zoneminder/images/folder + +Recall from the previous step, the images folder is optional. + +**Step 4:** Create a config file under /etc/zm/conf.d using your favorite text editor. Name the file anything you want just as long as it ends in ".conf". +Add the following content to the file and save your changes: +:: + + ZM_DIR_EVENTS=/full/path/to/the/events/folder + ZM_DIR_IMAGES=/full/path/to/the/images/folder + +**Step 5:** Start ZoneMinder and inspect the ZoneMinder log files for errors. +:: + + sudo systemctl start zoneminder diff --git a/docs/installationguide/index.rst b/docs/installationguide/index.rst index 8b8a7c376..4e2288de6 100644 --- a/docs/installationguide/index.rst +++ b/docs/installationguide/index.rst @@ -11,3 +11,4 @@ Contents: debian redhat multiserver + dedicateddrive diff --git a/docs/installationguide/packpack.rst b/docs/installationguide/packpack.rst index 6b558d11c..dd54ef4b2 100644 --- a/docs/installationguide/packpack.rst +++ b/docs/installationguide/packpack.rst @@ -1,4 +1,4 @@ -All Distros - A Simpler Way to Build ZoneMinder +All Distros - A Docker Way to Build ZoneMinder =============================================== .. contents:: @@ -27,6 +27,8 @@ Procedure - If the desired distro does not appear in either list, then unfortuantely you cannot use the procedure described here. +- If the desired distro architecture is arm, refer to `Appendix A - Enable Qemu On the Host`_ to enable qemu emulation on your amd64 host machine. + **Step 2:** Install Docker. You need to have a working installation of Docker so head over to the `Docker site `_ and get it working. Before continuing to the next step, verify you can run the Docker "Hello World" container as a normal user. To run a Docker container as a normal user, issue the following: @@ -44,7 +46,7 @@ Clone the ZoneMinder project if you have not done so already. :: - git clone https://ZoneMinder/ZoneMinder + git clone https://github.com/ZoneMinder/ZoneMinder cd ZoneMinder Alternatively, if you have already cloned the repo and wish to update it, do the following. @@ -99,7 +101,27 @@ For advanced users who really want to go out into uncharted waters, it is theore Building arm packages in this manner has not been tested by us, however. +Appendix A - Enable Qemu On the Host +------------------------------------ +If you intend to build ZoneMinder packages for arm on an amd64 host, then Debian users can following these steps to enable transparent Qemu emulation: +:: + sudo apt-get install binfmt-support qemu qemu-user-static +Verify arm emulation is enabled by issuing: + +:: + + sudo update-binfmts --enable qemu-arm + +You may get a message stating emulation for this processor is already enabled. + +More testing needs to be done for Redhat distros but it appears Fedora users can just run: + +:: + + sudo systemctl start systemd-binfmt + +TO-DO: Verify the details behind enabling qemu emulation on redhat distros. Pull requests are welcome. diff --git a/misc/zoneminder.monit.conf b/misc/zoneminder.monit.conf new file mode 100644 index 000000000..b9ae2f56d --- /dev/null +++ b/misc/zoneminder.monit.conf @@ -0,0 +1,6 @@ +check process zmdc.pl with pidfile /run/zm/zm.pid + if failed unixsocket /run/zm/zmdc2.sock then restart + group zm + start program = "/bin/systemctl start zoneminder" + stop program = "/bin/systemctl stop zoneminder" + #if 4 restarts within 20 cycles then timeout diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in index 00015ae24..acd2464bf 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in @@ -400,7 +400,22 @@ our @options = ( type => $types{boolean}, category => 'system', }, -# PP - Google reCaptcha settings + { + name => 'ZM_OPT_USE_EVENTNOTIFICATION', + default => 'no', + description => 'Enable 3rd party Event Notification Server', + help => q` + zmeventnotification is a 3rd party event notification server + that is used to get notifications for alarms detected by ZoneMinder + in real time. zmNinja requires this server for push notifications to + mobile phones. This option only enables the server if its already installed. + Please visit https://github.com/pliablepixels/zmeventserver for installation + instructions. + `, + type => $types{boolean}, + category => 'system', + }, + # Google reCaptcha settings { name => 'ZM_OPT_USE_GOOG_RECAPTCHA', default => 'no', @@ -424,7 +439,6 @@ our @options = ( }, { name => 'ZM_OPT_GOOG_RECAPTCHA_SITEKEY', - default => '...Insert your recaptcha site-key here...', description => 'Your recaptcha site-key', help => q`You need to generate your keys from the Google reCaptcha website. diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control.pm index 4603645fa..a76ebe861 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control.pm @@ -47,7 +47,7 @@ sub new { my $class = shift; my $id = shift; my $self = {}; - $self->{name} = "PelcoD"; + $self->{name} = $class; if ( !defined($id) ) { Fatal( "No monitor defined when invoking protocol ".$self->{name} ); } @@ -83,7 +83,7 @@ sub open { sub close { my $self = shift; - Fatal( "No close method defined for protocol ".$self->{name} ); + Error( "No close method defined for protocol ".$self->{name} ); } sub loadMonitor { diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/3S.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/3S.pm index 2ccd275ce..e33e51d13 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/3S.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/3S.pm @@ -50,31 +50,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/AxisV2.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/AxisV2.pm index daa39ed72..4afcecc58 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/AxisV2.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/AxisV2.pm @@ -44,31 +44,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/DCS3415.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/DCS3415.pm new file mode 100644 index 000000000..2db704320 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/DCS3415.pm @@ -0,0 +1,195 @@ +# ========================================================================== +# +# ZoneMinder D-Link DCS-3415 IP Control Protocol Module, 2018-03-04, 0.1 +# Copyright (C) 2015-2018 Habib Kamei +# +# Modified for use with D-Link DCS-3415 IP Camera by Habib Kamei +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# ========================================================================== +# +# This module contains the implementation of the D-Link DCS-3415 device control protocol +# +#=========================================================================== + +package ZoneMinder::Control::DCS3415; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +# ========================================================================== +# +# D-Link DCS-3415 Control Protocol +# +# On ControlAddress use the format : +# USERNAME:PASSWORD@ADDRESS:PORT +# eg : admin:@10.1.2.1:80 +# zoneuser:zonepass@192.168.0.20:40000 +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Time::HiRes qw( usleep ); + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref( ) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use LWP::UserAgent; + $self->{ua} = LWP::UserAgent->new; + $self->{ua}->agent( "ZoneMinder Control Agent/".ZoneMinder::Base::ZM_VERSION ); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; +} + +sub printMsg +{ + my $self = shift; + my $msg = shift; + my $msg_len = length($msg); + + Debug( $msg."[".$msg_len."]" ); +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + my $result = undef; + printMsg( $cmd, "Tx" ); + + my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/cgi-bin/viewer/$cmd" ); + my $res = $self->{ua}->request($req); + + + if ( $res->is_success ) + { + $result = !undef; + } + else + { + Error( "Error check failed:'".$res->status_line()."'" ); + } + + return( $result ); +} + +#Zoom In +sub Tele +{ + my $self = shift; + Debug( "Zoom Tele" ); + my $cmd = "camctrl.cgi?channel=0&camid=1&zoom=tele"; + $self->sendCmd( $cmd ); +} + +#Zoom Out +sub Wide +{ + my $self = shift; + Debug( "Zoom Wide" ); + my $cmd = "camctrl.cgi?channel=0&camid=1&zoom=wide"; + $self->sendCmd( $cmd ); +} + +#Focus Near +sub Near +{ + my $self = shift; + Debug( "Focus Near" ); + my $cmd = "camctrl.cgi?channel=0&camid=1&focus=near"; + $self->sendCmd( $cmd ); +} + +#Focus Far +sub Far +{ + my $self = shift; + Debug( "Focus Far" ); + my $cmd = "camctrl.cgi?channel=0&camid=1&focus=far"; + $self->sendCmd( $cmd ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! +=head1 NAME +ZoneMinder::Database - Perl extension for blah blah blah +=head1 SYNOPSIS + use ZoneMinder::Database; + blah blah blah +=head1 DESCRIPTION +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +Blah blah blah. +=head2 EXPORT +None by default. +=head1 SEE ALSO +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. +If you have a mailing list set up for your module, mention it here. +If you have a web site set up for your module, mention it here. +=head1 AUTHOR +Philip Coombes, Ephilip.coombes@zoneminder.comE +=head1 COPYRIGHT AND LICENSE +Copyright (C) 2001-2008 Philip Coombes +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/FI8608W_Y2k.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/FI8608W_Y2k.pm index c8a77aa2c..aad4e7246 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/FI8608W_Y2k.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/FI8608W_Y2k.pm @@ -79,31 +79,6 @@ use Time::HiRes qw( usleep ); # this script is reload at every command ,if i want the button on/off (Focus MAN) for OSD works... my $osd = "on"; -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/FI8620_Y2k.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/FI8620_Y2k.pm index 5eb06219d..c3cfd8456 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/FI8620_Y2k.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/FI8620_Y2k.pm @@ -85,31 +85,6 @@ use Time::HiRes qw( usleep ); # this script is reload at every command ,if i want the button on/off (Focus MAN) for OSD works... my $osd = "on"; -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/FI8918W.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/FI8918W.pm index 9d023320a..0159364c9 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/FI8918W.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/FI8918W.pm @@ -63,33 +63,8 @@ our $VERSION = $ZoneMinder::Base::VERSION; use ZoneMinder::Logger qw(:all); use ZoneMinder::Config qw(:all); - use Time::HiRes qw( usleep ); +use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - my $logindetails = ""; - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} our $stop_command; sub open diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Floureon.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Floureon.pm index bb3504067..27a18d065 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/Floureon.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Floureon.pm @@ -55,31 +55,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - my $logindetails = ""; - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} our $stop_command; sub open diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/HikVision.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/HikVision.pm index f9cabd5fa..8fabcdf2f 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/HikVision.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/HikVision.pm @@ -54,28 +54,6 @@ my $ChannelID = 1; # Usually... my $DefaultFocusSpeed = 50; # Should be between 1 and 100 my $DefaultIrisSpeed = 50; # Should be between 1 and 100 -sub new { - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD { - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} sub open { my $self = shift; $self->loadMonitor(); diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/IPCC7210W.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/IPCC7210W.pm index f3ac081a5..c18b37485 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/IPCC7210W.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/IPCC7210W.pm @@ -44,31 +44,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Keekoon.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Keekoon.pm index 0fc14135d..0cd7d2e73 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/Keekoon.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Keekoon.pm @@ -82,33 +82,6 @@ use ZoneMinder::Logger qw(:all); use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - my $logindetails = ""; - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref( ) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/LoftekSentinel.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/LoftekSentinel.pm index a5500e2b0..3b8454b62 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/LoftekSentinel.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/LoftekSentinel.pm @@ -54,33 +54,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - my $logindetails = ""; - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref( ) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); - } - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm index bacfc77aa..cac9e62eb 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm @@ -50,29 +50,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); use URI::Encode qw(); -sub new { - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD { - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/MaginonIPC.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/MaginonIPC.pm index 38ae81aa3..5bb7704a1 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/MaginonIPC.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/MaginonIPC.pm @@ -44,31 +44,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Ncs370.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Ncs370.pm index 32ac9a50c..556cb7810 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/Ncs370.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Ncs370.pm @@ -44,31 +44,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Netcat.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Netcat.pm index 6aefbb6c3..4c23d80e1 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/Netcat.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Netcat.pm @@ -74,33 +74,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - my $logindetails = ""; - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref( ) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); - } - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/PanasonicIP.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/PanasonicIP.pm index 070f5fb18..d36594e2d 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/PanasonicIP.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/PanasonicIP.pm @@ -44,31 +44,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoD.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoD.pm index 68547da6f..0502c4a20 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoD.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoD.pm @@ -46,31 +46,6 @@ use Time::HiRes qw( usleep ); use constant SYNC => 0xff; use constant COMMAND_GAP => 100000; # In ms -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoP.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoP.pm index 9c411c0cd..8cbb505ca 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoP.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoP.pm @@ -47,31 +47,6 @@ use constant STX => 0xa0; use constant ETX => 0xaf; use constant COMMAND_GAP => 100000; # In ms -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Reolink.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Reolink.pm new file mode 100644 index 000000000..ba0b291f4 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Reolink.pm @@ -0,0 +1,603 @@ +# ========================================================================== +# +# ZoneMinder Reolink IP Control Protocol Module, Date: 2016-01-19 +# Converted for use with Reolink IP Camera by Chris Swertfeger +# Copyright (C) 2016 Chris Swertfeger +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# ========================================================================== +# +# This module contains the first implementation of the Reolink IP camera control +# protocol +# +package ZoneMinder::Control::Reolink; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our %CamParams = (); + +# ========================================================================== +# +# Reolink IP Control Protocol +# This script sends ONVIF compliant commands and may work with other cameras +# that require authentication +# +# The script was developed against a RLC-423 and RLC-420. +# +# Basic preset functions are supported, but more advanced features, which make +# use of abnormally high preset numbers (ir lamp control, tours, pan speed, etc) +# may or may not work. +# +# +# On ControlAddress use the format : +# USERNAME:PASSWORD@ADDRESS:PORT +# eg : admin:pass@10.1.2.1:8899 +# admin:password@10.0.100.1:8899 +# +# Use port 8000 by default for Reolink cameras +# +# Make sure and place a value in the Auto Stop Timeout field. +# Recommend starting with a value of 1 second, and adjust accordingly. +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Time::HiRes qw( usleep ); + +use MIME::Base64; +use Digest::SHA; +use DateTime; + +my ($username,$password,$host,$port); + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + # + # Extract the username/password host/port from ControlAddress + # + if( $self->{Monitor}{ControlAddress} =~ /^([^:]+):([^@]+)@(.+)/ ) + { # user:pass@host... + $username = $1; + $password = $2; + $host = $3; + } + elsif( $self->{Monitor}{ControlAddress} =~ /^([^@]+)@(.+)/ ) + { # user@host... + $username = $1; + $host = $2; + } + else { # Just a host + $host = $self->{Monitor}{ControlAddress}; + } + # Check if it is a host and port or just a host + if( $host =~ /([^:]+):(.+)/ ) + { + $host = $1; + $port = $2; + } + else + { + $port = 80; + } + + use LWP::UserAgent; + $self->{ua} = LWP::UserAgent->new; + $self->{ua}->agent( "ZoneMinder Control Agent/".ZoneMinder::Base::ZM_VERSION ); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; +} + +sub printMsg +{ + my $self = shift; + my $msg = shift; + my $msg_len = length($msg); + + Debug( $msg."[".$msg_len."]" ); +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + my $msg = shift; + my $content_type = shift; + my $result = undef; + + printMsg( $cmd, "Tx" ); + + my $server_endpoint = "http://".$host.":".$port."/$cmd"; + my $req = HTTP::Request->new( POST => $server_endpoint ); + $req->header('content-type' => $content_type); + $req->header('Host' => $host.":".$port); + $req->header('content-length' => length($msg)); + $req->header('accept-encoding' => 'gzip, deflate'); + $req->header('connection' => 'close'); + $req->content($msg); + + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) { + $result = !undef; + } else { + Error( "After sending PTZ command, camera returned the following error:'".$res->status_line()."'" ); + } + return( $result ); +} + +sub getCamParams +{ + my $self = shift; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg = ''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'; + my $server_endpoint = "http://".$self->{Monitor}->{ControlAddress}."/onvif/imaging"; + my $req = HTTP::Request->new( POST => $server_endpoint ); + $req->header('content-type' => 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/imaging/wsdl/GetImagingSettings"'); + $req->header('Host' => $host.":".$port); + $req->header('content-length' => length($msg)); + $req->header('accept-encoding' => 'gzip, deflate'); + $req->header('connection' => 'Close'); + $req->content($msg); + + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) { + # We should really use an xml or soap library to parse the xml tags + my $content = $res->decoded_content; + + if ($content =~ /.*(.+)<\/tt:Brightness>.*/) { + $CamParams{$1} = $2; + } + if ($content =~ /.*(.+)<\/tt:Contrast>.*/) { + $CamParams{$1} = $2; + } + } + else + { + Error( "Unable to retrieve camera image settings:'".$res->status_line()."'" ); + } +} + +#autoStop +#This makes use of the ZoneMinder Auto Stop Timeout on the Control Tab +sub autoStop +{ + my $self = shift; + my $autostop = shift; + + if( $autostop ) { + Debug( "Auto Stop" ); + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg = ''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000truefalse'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/ContinuousMove"'; + usleep( $autostop ); + $self->sendCmd( $cmd, $msg, $content_type ); + } +} + +# Reset the Camera +sub reset +{ + Debug( "Camera Reset" ); + my $self = shift; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $cmd = ""; + my $msg = ''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.''; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver10/device/wsdl/SystemReboot"'; + $self->sendCmd( $cmd, $msg, $content_type ); +} + +#Up Arrow +sub moveConUp +{ + Debug( "Move Up" ); + my $self = shift; + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/ContinuousMove"'; + $self->sendCmd( $cmd, $msg, $content_type ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Down Arrow +sub moveConDown +{ + Debug( "Move Down" ); + my $self = shift; + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/ContinuousMove"'; + $self->sendCmd( $cmd, $msg, $content_type ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Left Arrow +sub moveConLeft +{ + Debug( "Move Left" ); + my $self = shift; + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/ContinuousMove"'; + $self->sendCmd( $cmd, $msg, $content_type ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Right Arrow +sub moveConRight +{ + Debug( "Move Right" ); + my $self = shift; + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/ContinuousMove"'; + $self->sendCmd( $cmd, $msg, $content_type ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Zoom In +sub zoomConTele +{ + Debug( "Zoom Tele" ); + my $self = shift; + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/ContinuousMove"'; + $self->sendCmd( $cmd, $msg, $content_type ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Zoom Out +sub zoomConWide +{ + Debug( "Zoom Wide" ); + my $self = shift; + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/ContinuousMove"'; + $self->sendCmd( $cmd, $msg, $content_type ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Diagonally Up Right Arrow +#This camera does not have builtin diagonal commands so we emulate them +sub moveConUpRight +{ + Debug( "Move Diagonally Up Right" ); + my $self = shift; + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/ContinuousMove"'; + $self->sendCmd( $cmd, $msg, $content_type ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Diagonally Down Right Arrow +#This camera does not have builtin diagonal commands so we emulate them +sub moveConDownRight +{ + Debug( "Move Diagonally Down Right" ); + my $self = shift; + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/ContinuousMove"'; + $self->sendCmd( $cmd, $msg, $content_type ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Diagonally Up Left Arrow +#This camera does not have builtin diagonal commands so we emulate them +sub moveConUpLeft +{ + Debug( "Move Diagonally Up Left" ); + my $self = shift; + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/ContinuousMove"'; + $self->sendCmd( $cmd, $msg, $content_type ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Diagonally Down Left Arrow +#This camera does not have builtin diagonal commands so we emulate them +sub moveConDownLeft +{ + Debug( "Move Diagonally Down Left" ); + my $self = shift; + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/ContinuousMove"'; + $self->sendCmd( $cmd, $msg, $content_type ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Stop +sub moveStop +{ + Debug( "Move Stop" ); + my $self = shift; + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000truefalse'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/ContinuousMove"'; + $self->sendCmd( $cmd, $msg, $content_type ); +} + +#Set Camera Preset +sub presetSet +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Set Preset $preset" ); + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'.$preset.''; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/SetPreset"'; + $self->sendCmd( $cmd, $msg, $content_type ); +} + +#Recall Camera Preset +sub presetGoto +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + my $num = sprintf("%03d", $preset); + $num=~ tr/ /0/; + Debug( "Goto Preset $preset" ); + my $cmd = 'onvif/PTZ'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'.$num.''; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/GotoPreset"'; + $self->sendCmd( $cmd, $msg, $content_type ); +} + +#Horizontal Patrol +#To be determined if this camera supports this feature +sub horizontalPatrol +{ + Debug( "Horizontal Patrol" ); + my $self = shift; + my $cmd = ''; + my $msg =''; + my $content_type = ''; +# $self->sendCmd( $cmd, $msg, $content_type ); + Error( "PTZ Command not implemented in control script." ); +} + +#Horizontal Patrol Stop +#To be determined if this camera supports this feature +sub horizontalPatrolStop +{ + Debug( "Horizontal Patrol Stop" ); + my $self = shift; + my $cmd = ''; + my $msg =''; + my $content_type = ''; +# $self->sendCmd( $cmd, $msg, $content_type ); + Error( "PTZ Command not implemented in control script." ); +} + +# Increase Brightness +sub irisAbsOpen +{ + Debug( "Iris $CamParams{'Brightness'}" ); + my $self = shift; + my $params = shift; + $self->getCamParams() unless($CamParams{'Brightness'}); + my $step = $self->getParam( $params, 'step' ); + my $max = 100; + + $CamParams{'Brightness'} += $step; + $CamParams{'Brightness'} = $max if ($CamParams{'Brightness'} > $max); + + my $cmd = 'onvif/imaging'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'.$CamParams{'Brightness'}.'true'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/imaging/wsdl/SetImagingSettings"'; + $self->sendCmd( $cmd, $msg, $content_type ); +} + +# Decrease Brightness +sub irisAbsClose +{ + Debug( "Iris $CamParams{'Brightness'}" ); + my $self = shift; + my $params = shift; + $self->getCamParams() unless($CamParams{'brightness'}); + my $step = $self->getParam( $params, 'step' ); + my $min = 0; + + $CamParams{'Brightness'} -= $step; + $CamParams{'Brightness'} = $min if ($CamParams{'Brightness'} < $min); + + my $cmd = 'onvif/imaging'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'.$CamParams{'Brightness'}.'true'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/imaging/wsdl/SetImagingSettings"'; + $self->sendCmd( $cmd, $msg, $content_type ); +} + +# Increase Contrast +sub whiteAbsIn +{ + Debug( "Iris $CamParams{'Contrast'}" ); + my $self = shift; + my $params = shift; + $self->getCamParams() unless($CamParams{'Contrast'}); + my $step = $self->getParam( $params, 'step' ); + my $max = 100; + + $CamParams{'Contrast'} += $step; + $CamParams{'Contrast'} = $max if ($CamParams{'Contrast'} > $max); + + my $cmd = 'onvif/imaging'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'.$CamParams{'Contrast'}.'true'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/imaging/wsdl/SetImagingSettings"'; +} + +# Decrease Contrast +sub whiteAbsOut +{ + Debug( "Iris $CamParams{'Contrast'}" ); + my $self = shift; + my $params = shift; + $self->getCamParams() unless($CamParams{'Contrast'}); + my $step = $self->getParam( $params, 'step' ); + my $min = 0; + + $CamParams{'Contrast'} -= $step; + $CamParams{'Contrast'} = $min if ($CamParams{'Contrast'} < $min); + + my $cmd = 'onvif/imaging'; + my $nonce; + for (0..20){$nonce .= chr(int(rand(254)));} + my $mydate = DateTime->now()->iso8601().'Z'; + my $sha = Digest::SHA->new(1); + $sha->add($nonce.$mydate.$password); + my $digest = encode_base64($sha->digest,""); + my $msg =''.$username.''.$digest.''.encode_base64($nonce,"").''.$mydate.'000'.$CamParams{'Contrast'}.'true'; + my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/imaging/wsdl/SetImagingSettings"'; +} + +1; + diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/SPP1802SWPTZ.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/SPP1802SWPTZ.pm index 38838237b..45f622265 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/SPP1802SWPTZ.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/SPP1802SWPTZ.pm @@ -60,33 +60,8 @@ our $VERSION = $ZoneMinder::Base::VERSION; use ZoneMinder::Logger qw(:all); use ZoneMinder::Config qw(:all); - use Time::HiRes qw( usleep ); +use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - my $logindetails = ""; - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} our $stop_command; sub open diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/SkyIPCam7xx.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/SkyIPCam7xx.pm index b3f9418ce..486e0390a 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/SkyIPCam7xx.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/SkyIPCam7xx.pm @@ -45,28 +45,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new { - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD { - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/TVIP862.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/TVIP862.pm index eb083eb60..4d794e554 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/TVIP862.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/TVIP862.pm @@ -81,31 +81,6 @@ our $ADDRESS = ''; use ZoneMinder::Logger qw(:all); use ZoneMinder::Config qw(:all); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Toshiba_IK_WB11A.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Toshiba_IK_WB11A.pm index 562365e95..5c6c4aef1 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/Toshiba_IK_WB11A.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Toshiba_IK_WB11A.pm @@ -45,31 +45,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Visca.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Visca.pm index e356c77f0..a7c406ec2 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/Visca.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Visca.pm @@ -46,31 +46,6 @@ use Time::HiRes qw( usleep ); use constant SYNC => 0xff; use constant COMMAND_GAP => 100000; # In ms -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Vivotek_ePTZ.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Vivotek_ePTZ.pm index 7ddf2dc6d..58ebe4c63 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/Vivotek_ePTZ.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Vivotek_ePTZ.pm @@ -44,33 +44,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - Debug( "Camera New" ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - Debug( "Camera AUTOLOAD" ); - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Wanscam.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Wanscam.pm index 894fe970d..b78557b00 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/Wanscam.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Wanscam.pm @@ -70,32 +70,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - my $logindetails = ""; - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/WanscamHW0025.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/WanscamHW0025.pm index 3459c097f..8ed5a47e3 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/WanscamHW0025.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/WanscamHW0025.pm @@ -52,31 +52,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/mjpgStreamer.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/mjpgStreamer.pm index 7ac00c995..59b6cc1a6 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/mjpgStreamer.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/mjpgStreamer.pm @@ -44,33 +44,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - Debug( "Camera New" ); - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref($self) || croak( "$self not object" ); - my $name = $AUTOLOAD; - Debug( "Camera AUTOLOAD" ); - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/onvif.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/onvif.pm index 8214b9f5d..2e6910889 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/onvif.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/onvif.pm @@ -49,33 +49,6 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -sub new -{ - - my $class = shift; - my $id = shift; - my $self = ZoneMinder::Control->new( $id ); - my $logindetails = ""; - bless( $self, $class ); - srand( time() ); - return $self; -} - -our $AUTOLOAD; - -sub AUTOLOAD -{ - my $self = shift; - my $class = ref( ) || croak( "$self not object" ); - my $name = $AUTOLOAD; - $name =~ s/.*://; - if ( exists($self->{$name}) ) - { - return( $self->{$name} ); - } - Fatal( "Can't access $name member of object of class $class" ); -} - sub open { my $self = shift; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Event.pm b/scripts/ZoneMinder/lib/ZoneMinder/Event.pm index 56ecfa249..b401054a3 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Event.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Event.pm @@ -35,6 +35,9 @@ require Date::Manip; require File::Find; require File::Path; require File::Copy; +require File::Slurp; +require File::Basename; +require Number::Bytes::Human; #our @ISA = qw(ZoneMinder::Object); use parent qw(ZoneMinder::Object); @@ -300,8 +303,8 @@ sub GenerateVideo { $frame_rate = $fps; } - my $width = $self->{MonitorWidth}; - my $height = $self->{MonitorHeight}; + my $width = $self->{Width}; + my $height = $self->{Height}; my $video_size = " ${width}x${height}"; if ( $scale ) { @@ -347,13 +350,17 @@ sub delete { Warning( "Can't Delete event $event->{Id} from Monitor $event->{MonitorId} StartTime:$event->{StartTime} from $caller:$line\n" ); return; } + if ( ! -e $event->Storage()->Path() ) { + Warning("Not deleting event because storage path doesn't exist"); + return; + } Info( "Deleting event $event->{Id} from Monitor $event->{MonitorId} StartTime:$event->{StartTime}\n" ); $ZoneMinder::Database::dbh->ping(); $ZoneMinder::Database::dbh->begin_work(); - $event->lock_and_load(); + #$event->lock_and_load(); - if ( ! $Config{ZM_OPT_FAST_DELETE} ) { + { my $sql = 'DELETE FROM Frames WHERE EventId=?'; my $sth = $ZoneMinder::Database::dbh->prepare_cached( $sql ) or Error( "Can't prepare '$sql': ".$ZoneMinder::Database::dbh->errstr() ); @@ -375,19 +382,23 @@ sub delete { $ZoneMinder::Database::dbh->commit(); return; } + } +# Do it individually to avoid locking up the table for new events + { + my $sql = 'DELETE FROM Events WHERE Id=?'; + my $sth = $ZoneMinder::Database::dbh->prepare_cached( $sql ) + or Error( "Can't prepare '$sql': ".$ZoneMinder::Database::dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) + or Error( "Can't execute '$sql': ".$sth->errstr() ); + $sth->finish(); + } + $ZoneMinder::Database::dbh->commit(); + if ( (! $Config{ZM_OPT_FAST_DELETE}) and $event->Storage()->DoDelete() ) { $event->delete_files( ); } else { Debug('Not deleting frames, stats and files for speed.'); } -# Do it individually to avoid locking up the table for new events - my $sql = 'DELETE FROM Events WHERE Id=?'; - my $sth = $ZoneMinder::Database::dbh->prepare_cached( $sql ) - or Error( "Can't prepare '$sql': ".$ZoneMinder::Database::dbh->errstr() ); - my $res = $sth->execute( $event->{Id} ) - or Error( "Can't execute '$sql': ".$sth->errstr() ); - $sth->finish(); - $ZoneMinder::Database::dbh->commit(); } # end sub delete sub delete_files { @@ -410,8 +421,34 @@ sub delete_files { if ( $event_path ) { ( $storage_path ) = ( $storage_path =~ /^(.*)$/ ); # De-taint ( $event_path ) = ( $event_path =~ /^(.*)$/ ); # De-taint + + my $deleted = 0; + if ( $$Storage{Type} eq 's3fs' ) { + my ( $aws_id, $aws_secret, $aws_host, $aws_bucket ) = ( $$Storage{Url} =~ /^\s*([^:]+):([^@]+)@([^\/]*)\/(.+)\s*$/ ); + eval { + require Net::Amazon::S3; + my $s3 = Net::Amazon::S3->new( { + aws_access_key_id => $aws_id, + aws_secret_access_key => $aws_secret, + ( $aws_host ? ( host => $aws_host ) : () ), + }); + my $bucket = $s3->bucket($aws_bucket); + if ( ! $bucket ) { + Error("S3 bucket $bucket not found."); + die; + } + if ( $bucket->delete_key( $event_path ) ) { + $deleted = 1; + } else { + Error("Failed to delete from S3:".$s3->err . ": " . $s3->errstr); + } + }; + Error($@) if $@; + } + if ( ! $deleted ) { my $command = "/bin/rm -rf $storage_path/$event_path"; - ZoneMinder::General::executeShellCommand( $command ); + ZoneMinder::General::executeShellCommand( $command ); + } } if ( $event->Scheme() eq 'Deep' ) { @@ -425,6 +462,9 @@ sub delete_files { } # end sub delete_files sub Storage { + if ( @_ > 1 ) { + $_[0]{Storage} = $_[1]; + } if ( ! $_[0]{Storage} ) { $_[0]{Storage} = new ZoneMinder::Storage( $_[0]{StorageId} ); } @@ -486,8 +526,7 @@ sub MoveTo { $ZoneMinder::Database::dbh->commit(); return "Event has already been moved by someone else."; } - - my $OldStorage = $self->Storage(); + my $OldStorage = $self->Storage(undef); my ( $OldPath ) = ( $self->Path() =~ /^(.*)$/ ); # De-taint $$self{Storage} = $NewStorage; @@ -513,33 +552,93 @@ sub MoveTo { } Debug("Moving event $$self{Id} from $OldPath to $NewPath"); + my $moved = 0; + + if ( $$NewStorage{Type} eq 's3fs' ) { + my ( $aws_id, $aws_secret, $aws_host, $aws_bucket ) = ( $$NewStorage{Url} =~ /^\s*([^:]+):([^@]+)@([^\/]*)\/(.+)\s*$/ ); + eval { + require Net::Amazon::S3; + my $s3 = Net::Amazon::S3->new( { + aws_access_key_id => $aws_id, + aws_secret_access_key => $aws_secret, + ( $aws_host ? ( host => $aws_host ) : () ), + }); + my $bucket = $s3->bucket($aws_bucket); + if ( ! $bucket ) { + Error("S3 bucket $bucket not found."); + die; + } + + my $event_path = 'events/'.$self->RelativePath(); +Info("Making dir ectory $event_path/"); + if ( ! $bucket->add_key( $event_path.'/','' ) ) { + die "Unable to add key for $event_path/"; + } + + my @files = glob("$OldPath/*"); +Debug("Files to move @files"); + for my $file (@files) { + next if $file =~ /^\./; + ( $file ) = ( $file =~ /^(.*)$/ ); # De-taint + my $starttime = time; + Debug("Moving file $file to $NewPath"); + my $size = -s $file; + if ( ! $size ) { + Info("Not moving file with 0 size"); + } + my $file_contents = File::Slurp::read_file($file); + if ( ! $file_contents ) { + die "Loaded empty file, but it had a size. Giving up"; + } + + my $filename = $event_path.'/'.File::Basename::basename($file); + if ( ! $bucket->add_key( $filename, $file_contents ) ) { + die "Unable to add key for $filename"; + } + my $duration = time - $starttime; + Debug("PUT to S3 " . Number::Bytes::Human::format_bytes($size) . " in $duration seconds = " . Number::Bytes::Human::format_bytes($size/$duration) . "/sec"); + } # end foreach file. + + $moved = 1; + }; + Error($@) if $@; + die $@ if $@; + } # end if s3 + my $error = ''; - File::Path::make_path( $NewPath, {error => \my $err} ); - if ( @$err ) { - for my $diag (@$err) { - my ($file, $message) = %$diag; - next if $message eq 'File exists'; - if ($file eq '') { - $error .= "general error: $message\n"; - } else { - $error .= "problem making $file: $message\n"; + if ( ! $moved ) { + File::Path::make_path( $NewPath, {error => \my $err} ); + if ( @$err ) { + for my $diag (@$err) { + my ($file, $message) = %$diag; + next if $message eq 'File exists'; + if ($file eq '') { + $error .= "general error: $message\n"; + } else { + $error .= "problem making $file: $message\n"; + } } } - } - if ( $error ) { - $ZoneMinder::Database::dbh->commit(); - return $error; - } - my @files = glob("$OldPath/*"); - - for my $file (@files) { - next if $file =~ /^\./; - ( $file ) = ( $file =~ /^(.*)$/ ); # De-taint - if ( ! File::Copy::copy( $file, $NewPath ) ) { - $error .= "Copy failed: for $file to $NewPath: $!"; - last; + if ( $error ) { + $ZoneMinder::Database::dbh->commit(); + return $error; } - } # end foreach file. + my @files = glob("$OldPath/*"); + + for my $file (@files) { + next if $file =~ /^\./; + ( $file ) = ( $file =~ /^(.*)$/ ); # De-taint + my $starttime = time; + Debug("Moving file $file to $NewPath"); + my $size = -s $file; + if ( ! File::Copy::copy( $file, $NewPath ) ) { + $error .= "Copy failed: for $file to $NewPath: $!"; + last; + } + my $duration = time - $starttime; + Debug("Copied " . Number::Bytes::Human::format_bytes($size) . " in $duration seconds = " . ($duration?Number::Bytes::Human::format_bytes($size/$duration):'inf') . "/sec"); + } # end foreach file. + } # end if ! moved if ( $error ) { $ZoneMinder::Database::dbh->commit(); @@ -554,8 +653,8 @@ sub MoveTo { $ZoneMinder::Database::dbh->commit(); return $error; } - $self->delete_files( $OldStorage ); $ZoneMinder::Database::dbh->commit(); + $self->delete_files( $OldStorage ); return $error; } # end sub MoveTo diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm b/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm index cd8b76a62..88437b3ec 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm @@ -205,7 +205,7 @@ sub Sql { ( my $stripped_value = $value ) =~ s/^["\']+?(.+)["\']+?$/$1/; foreach my $temp_value ( split( /["'\s]*?,["'\s]*?/, $stripped_value ) ) { - if ( $term->{attr} =~ /^Monitor/ ) { + if ( $term->{attr} =~ /^MonitorName/ ) { $value = "'$temp_value'"; } elsif ( $term->{attr} eq 'ServerId' ) { Debug("ServerId, temp_value is ($temp_value) ($ZoneMinder::Config::Config{ZM_SERVER_ID})"); @@ -276,7 +276,13 @@ sub Sql { } elsif ( $term->{op} eq '!~' ) { $self->{Sql} .= " not regexp $value"; } elsif ( $term->{op} eq 'IS' ) { - $self->{Sql} .= " IS $value"; + if ( $value eq 'Odd' ) { + $self->{Sql} .= ' % 2 = 1'; + } elsif ( $value eq 'Even' ) { + $self->{Sql} .= ' % 2 = 0'; + } else { + $self->{Sql} .= " IS $value"; + } } elsif ( $term->{op} eq 'IS NOT' ) { $self->{Sql} .= " IS NOT $value"; } elsif ( $term->{op} eq '=[]' ) { diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm index 38c56c40c..443cc4c2a 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm @@ -1,4 +1,4 @@ -# ========================================================================== +############################################################################ # # ZoneMinder Logger Module, $Date$, $Revision$ # Copyright (C) 2001-2008 Philip Coombes @@ -17,7 +17,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# ========================================================================== +############################################################################ # # This module contains the debug definitions and functions used by the rest # of the ZoneMinder scripts @@ -75,17 +75,17 @@ our %EXPORT_TAGS = ( push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; -our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); +our @EXPORT_OK = ( @{ $EXPORT_TAGS{all} } ); our @EXPORT = qw(); our $VERSION = $ZoneMinder::Base::VERSION; -# ========================================================================== +############################################################################ # # Logger Facilities # -# ========================================================================== +############################################################################ use ZoneMinder::Config qw(:all); @@ -135,18 +135,19 @@ sub new { $this->{initialised} = undef; -#$this->{id} = 'zmundef'; ( $this->{id} ) = $0 =~ m|^(?:.*/)?([^/]+?)(?:\.[^/.]+)?$|; $this->{idRoot} = $this->{id}; $this->{idArgs} = ''; $this->{level} = INFO; + + # Detect if we are running in a terminal session, if so, default log level to INFO $this->{hasTerm} = -t STDERR; -if ( $this->{hasTerm} ) { - $this->{termLevel} = INFO; -} else { - $this->{termLevel} = NOLOG; -} + if ( $this->{hasTerm} ) { + $this->{termLevel} = INFO; + } else { + $this->{termLevel} = NOLOG; + } $this->{databaseLevel} = NOLOG; $this->{fileLevel} = NOLOG; $this->{syslogLevel} = NOLOG; @@ -156,7 +157,7 @@ if ( $this->{hasTerm} ) { ( $this->{fileName} = $0 ) =~ s|^.*/||; $this->{logPath} = $Config{ZM_PATH_LOGS}; - $this->{logFile} = $this->{logPath}.'/'.$this->{id}.".log"; + $this->{logFile} = $this->{logPath}.'/'.$this->{id}.'.log'; $this->{trace} = 0; @@ -175,9 +176,9 @@ sub BEGIN { ZM_LOG_LEVEL_FILE => 0, ZM_LOG_LEVEL_SYSLOG => 0, ZM_LOG_DEBUG => 0, - ZM_LOG_DEBUG_TARGET => "", + ZM_LOG_DEBUG_TARGET => '', ZM_LOG_DEBUG_LEVEL => 1, - ZM_LOG_DEBUG_FILE => "" + ZM_LOG_DEBUG_FILE => '' ); while ( my ( $name, $value ) = each( %dbgConfig ) ) { *{$name} = sub { $value }; @@ -196,13 +197,13 @@ sub initialise( @ ) { my $this = shift; my %options = @_; - $this->{id} = $options{id} if ( defined($options{id}) ); + $this->{id} = $options{id} if defined($options{id}); - $this->{logPath} = $options{logPath} if ( defined($options{logPath}) ); + $this->{logPath} = $options{logPath} if defined($options{logPath}); my $tempLogFile; - $tempLogFile = $this->{logPath}.'/'.$this->{id}.".log"; - $tempLogFile = $options{logFile} if ( defined($options{logFile}) ); + $tempLogFile = $this->{logPath}.'/'.$this->{id}.'.log'; + $tempLogFile = $options{logFile} if defined($options{logFile}); if ( my $logFile = $this->getTargettedEnv('LOG_FILE') ) { $tempLogFile = $logFile; } @@ -213,7 +214,7 @@ sub initialise( @ ) { my $tempFileLevel = $this->{fileLevel}; my $tempSyslogLevel = $this->{syslogLevel}; - $tempTermLevel = $options{termLevel} if ( defined($options{termLevel}) ); + $tempTermLevel = $options{termLevel} if defined($options{termLevel}); if ( defined($options{databaseLevel}) ) { $tempDatabaseLevel = $options{databaseLevel}; } else { @@ -230,16 +231,16 @@ sub initialise( @ ) { $tempSyslogLevel = $Config{ZM_LOG_LEVEL_SYSLOG}; } - if ( defined($ENV{'LOG_PRINT'}) ) { - $tempTermLevel = $ENV{'LOG_PRINT'}? DEBUG : NOLOG; + if ( defined($ENV{LOG_PRINT}) ) { + $tempTermLevel = $ENV{LOG_PRINT}? DEBUG : NOLOG; } my $level; - $tempLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL')) ); - $tempTermLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_TERM')) ); - $tempDatabaseLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_DATABASE')) ); - $tempFileLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_FILE')) ); - $tempSyslogLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_SYSLOG')) ); + $tempLevel = $level if defined($level = $this->getTargettedEnv('LOG_LEVEL')); + $tempTermLevel = $level if defined($level = $this->getTargettedEnv('LOG_LEVEL_TERM')); + $tempDatabaseLevel = $level if defined($level = $this->getTargettedEnv('LOG_LEVEL_DATABASE')); + $tempFileLevel = $level if defined($level = $this->getTargettedEnv('LOG_LEVEL_FILE')); + $tempSyslogLevel = $level if defined($level = $this->getTargettedEnv('LOG_LEVEL_SYSLOG')); if ( $Config{ZM_LOG_DEBUG} ) { foreach my $target ( split( /\|/, $Config{ZM_LOG_DEBUG_TARGET} ) ) { @@ -247,11 +248,11 @@ sub initialise( @ ) { || $target eq '_'.$this->{id} || $target eq $this->{idRoot} || $target eq '_'.$this->{idRoot} - || $target eq "" + || $target eq '' ) { if ( $Config{ZM_LOG_DEBUG_LEVEL} > NOLOG ) { $tempLevel = $this->limit( $Config{ZM_LOG_DEBUG_LEVEL} ); - if ( $Config{ZM_LOG_DEBUG_FILE} ne "" ) { + if ( $Config{ZM_LOG_DEBUG_FILE} ne '' ) { $tempLogFile = $Config{ZM_LOG_DEBUG_FILE}; $tempFileLevel = $tempLevel; } @@ -269,9 +270,9 @@ sub initialise( @ ) { $this->level( $tempLevel ); - $this->{trace} = $options{trace} if ( defined($options{trace}) ); + $this->{trace} = $options{trace} if defined($options{trace}); - $this->{autoFlush} = $ENV{'LOG_FLUSH'}?1:0 if ( defined($ENV{'LOG_FLUSH'}) ); + $this->{autoFlush} = $ENV{LOG_FLUSH}?1:0 if defined($ENV{LOG_FLUSH}); $this->{initialised} = !undef; @@ -303,28 +304,28 @@ sub reinitialise { # Bit of a nasty hack to reopen connections to log files and the DB my $syslogLevel = $this->syslogLevel(); $this->syslogLevel( NOLOG ); - $this->syslogLevel( $syslogLevel ) if ( $syslogLevel > NOLOG ); + $this->syslogLevel($syslogLevel) if $syslogLevel > NOLOG; my $logfileLevel = $this->fileLevel(); - $this->fileLevel( NOLOG ); - $this->fileLevel( $logfileLevel ) if ( $logfileLevel > NOLOG ); + $this->fileLevel(NOLOG); + $this->fileLevel($logfileLevel) if $logfileLevel > NOLOG; my $databaseLevel = $this->databaseLevel(); - $this->databaseLevel( NOLOG ); - $this->databaseLevel( $databaseLevel ) if ( $databaseLevel > NOLOG ); + $this->databaseLevel(NOLOG); + $this->databaseLevel($databaseLevel) if $databaseLevel > NOLOG; my $screenLevel = $this->termLevel(); - $this->termLevel( NOLOG ); - $this->termLevel( $screenLevel ) if ( $screenLevel > NOLOG ); + $this->termLevel(NOLOG); + $this->termLevel($screenLevel) if $screenLevel > NOLOG; } # Prevents undefined logging levels sub limit { my $this = shift; my $level = shift; - return( DEBUG ) if ( $level > DEBUG ); - return( NOLOG ) if ( $level < NOLOG ); - return( $level ); + return(DEBUG) if $level > DEBUG; + return(NOLOG) if $level < NOLOG; + return($level); } sub getTargettedEnv { @@ -332,32 +333,32 @@ sub getTargettedEnv { my $name = shift; my $envName = $name.'_'.$this->{id}; my $value; - $value = $ENV{$envName} if ( defined($ENV{$envName}) ); - if ( !defined($value) && $this->{id} ne $this->{idRoot} ) { + $value = $ENV{$envName} if defined($ENV{$envName}); + if ( !defined($value) and ($this->{id} ne $this->{idRoot}) ) { $envName = $name.'_'.$this->{idRoot}; - $value = $ENV{$envName} if ( defined($ENV{$envName}) ); + $value = $ENV{$envName} if defined($ENV{$envName}); } if ( !defined($value) ) { - $value = $ENV{$name} if ( defined($ENV{$name}) ); + $value = $ENV{$name} if defined($ENV{$name}); } if ( defined($value) ) { ( $value ) = $value =~ m/(.*)/; } - return( $value ); + return $value; } sub fetch { if ( !$logger ) { $logger = ZoneMinder::Logger->new(); - $logger->initialise( 'syslogLevel'=>INFO, 'databaseLevel'=>INFO ); + $logger->initialise( syslogLevel=>INFO, databaseLevel=>INFO ); } - return( $logger ); + return $logger; } sub id { my $this = shift; my $id = shift; - if ( defined($id) && $this->{id} ne $id ) { + if ( defined($id) and ($this->{id} ne $id) ) { # Remove whitespace $id =~ s/\S//g; # Replace non-alphanum with underscore @@ -371,37 +372,37 @@ sub id { } } } - return( $this->{id} ); + return $this->{id}; } sub level { my $this = shift; my $level = shift; if ( defined($level) ) { - $this->{level} = $this->limit( $level ); + $this->{level} = $this->limit($level); # effectiveLevel is the highest logging level used by any of the outputs. $this->{effectiveLevel} = NOLOG; - $this->{effectiveLevel} = $this->{termLevel} if ( $this->{termLevel} > $this->{effectiveLevel} ); - $this->{effectiveLevel} = $this->{databaseLevel} if ( $this->{databaseLevel} > $this->{effectiveLevel} ); - $this->{effectiveLevel} = $this->{fileLevel} if ( $this->{fileLevel} > $this->{effectiveLevel} ); - $this->{effectiveLevel} = $this->{syslogLevel} if ( $this->{syslogLevel} > $this->{effectiveLevel} ); + $this->{effectiveLevel} = $this->{termLevel} if $this->{termLevel} > $this->{effectiveLevel}; + $this->{effectiveLevel} = $this->{databaseLevel} if $this->{databaseLevel} > $this->{effectiveLevel}; + $this->{effectiveLevel} = $this->{fileLevel} if $this->{fileLevel} > $this->{effectiveLevel}; + $this->{effectiveLevel} = $this->{syslogLevel} if $this->{syslogLevel} > $this->{effectiveLevel}; # ICON: I am remarking this out because I don't see the point of having an effective level, if we are just going to set it to level. #$this->{effectiveLevel} = $this->{level} if ( $this->{level} > $this->{effectiveLevel} ); } - return( $this->{level} ); + return $this->{level}; } sub debugOn { my $this = shift; - return( $this->{effectiveLevel} >= DEBUG ); + return $this->{effectiveLevel} >= DEBUG; } sub trace { my $this = shift; - $this->{trace} = $_[0] if ( @_ ); - return( $this->{trace} ); + $this->{trace} = $_[0] if @_; + return $this->{trace}; } sub termLevel { @@ -409,63 +410,62 @@ sub termLevel { my $termLevel = shift; if ( defined($termLevel) ) { # What is the point of this next lint if we are just going to overwrite it with the next line? I propose we move it down one line or remove it altogether - $termLevel = NOLOG if ( !$this->{hasTerm} ); - $termLevel = $this->limit( $termLevel ); + $termLevel = NOLOG if !$this->{hasTerm}; + $termLevel = $this->limit($termLevel); if ( $this->{termLevel} != $termLevel ) { $this->{termLevel} = $termLevel; } } - return( $this->{termLevel} ); + return $this->{termLevel}; } sub databaseLevel { my $this = shift; my $databaseLevel = shift; if ( defined($databaseLevel) ) { - $databaseLevel = $this->limit( $databaseLevel ); + $databaseLevel = $this->limit($databaseLevel); if ( $this->{databaseLevel} != $databaseLevel ) { - if ( $databaseLevel > NOLOG && $this->{databaseLevel} <= NOLOG ) { + if ( $databaseLevel > NOLOG and $this->{databaseLevel} <= NOLOG ) { if ( !$this->{dbh} ) { my $socket; my ( $host, $portOrSocket ) = ( $Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ ); if ( defined($portOrSocket) ) { if ( $portOrSocket =~ /^\// ) { - $socket = ";mysql_socket=".$portOrSocket; + $socket = ';mysql_socket='.$portOrSocket; } else { - $socket = ";host=".$host.";port=".$portOrSocket; + $socket = ';host='.$host.';port='.$portOrSocket; } } else { - $socket = ";host=".$Config{ZM_DB_HOST}; + $socket = ';host='.$Config{ZM_DB_HOST}; } - my $sslOptions = ""; + my $sslOptions = ''; if ( $Config{ZM_DB_SSL_CA_CERT} ) { - $sslOptions = ';'.join(';', - "mysql_ssl=1", - "mysql_ssl_ca_file=".$Config{ZM_DB_SSL_CA_CERT}, - "mysql_ssl_client_key=".$Config{ZM_DB_SSL_CLIENT_KEY}, - "mysql_ssl_client_cert=".$Config{ZM_DB_SSL_CLIENT_CERT} + $sslOptions = join(';','', + 'mysql_ssl=1', + 'mysql_ssl_ca_file='.$Config{ZM_DB_SSL_CA_CERT}, + 'mysql_ssl_client_key='.$Config{ZM_DB_SSL_CLIENT_KEY}, + 'mysql_ssl_client_cert='.$Config{ZM_DB_SSL_CLIENT_CERT} ); } - $this->{dbh} = DBI->connect( "DBI:mysql:database=".$Config{ZM_DB_NAME} + $this->{dbh} = DBI->connect( 'DBI:mysql:database='.$Config{ZM_DB_NAME} .$socket.$sslOptions , $Config{ZM_DB_USER} , $Config{ZM_DB_PASS} ); if ( !$this->{dbh} ) { $databaseLevel = NOLOG; - Error( "Unable to write log entries to DB, can't connect to database '" + Error( 'Unable to write log entries to DB, can\'t connect to database ' .$Config{ZM_DB_NAME} - ."' on host '" + .' on host ' .$Config{ZM_DB_HOST} - ."'" ); } else { $this->{dbh}->{AutoCommit} = 1; - Fatal( "Can't set AutoCommit on in database connection" ) + Fatal('Can\'t set AutoCommit on in database connection' ) unless( $this->{dbh}->{AutoCommit} ); $this->{dbh}->{mysql_auto_reconnect} = 1; - Fatal( "Can't set mysql_auto_reconnect on in database connection" ) + Fatal('Can\'t set mysql_auto_reconnect on in database connection' ) unless( $this->{dbh}->{mysql_auto_reconnect} ); $this->{dbh}->trace( 0 ); } @@ -479,7 +479,7 @@ sub databaseLevel { $this->{databaseLevel} = $databaseLevel; } } - return( $this->{databaseLevel} ); + return $this->{databaseLevel}; } sub fileLevel { @@ -487,13 +487,12 @@ sub fileLevel { my $fileLevel = shift; if ( defined($fileLevel) ) { $fileLevel = $this->limit($fileLevel); - if ( $this->{fileLevel} != $fileLevel ) { - $this->closeFile() if ( $this->{fileLevel} > NOLOG ); - $this->{fileLevel} = $fileLevel; - $this->openFile() if ( $this->{fileLevel} > NOLOG ); - } + # The filename might have changed, so always close and re-open + $this->closeFile() if ( $this->{fileLevel} > NOLOG ); + $this->{fileLevel} = $fileLevel; + $this->openFile() if ( $this->{fileLevel} > NOLOG ); } - return( $this->{fileLevel} ); + return $this->{fileLevel}; } sub syslogLevel { @@ -512,7 +511,7 @@ sub syslogLevel { sub openSyslog { my $this = shift; - openlog( $this->{id}, 'pid', "local1" ); + openlog( $this->{id}, 'pid', 'local1' ); } sub closeSyslog { @@ -532,27 +531,25 @@ sub logFile { sub openFile { my $this = shift; - if ( open( $LOGFILE, ">>", $this->{logFile} ) ) { - $LOGFILE->autoflush() if ( $this->{autoFlush} ); + if ( open($LOGFILE, '>>', $this->{logFile}) ) { + $LOGFILE->autoflush() if $this->{autoFlush}; - my $webUid = (getpwnam( $Config{ZM_WEB_USER} ))[2]; - my $webGid = (getgrnam( $Config{ZM_WEB_GROUP} ))[2]; + my $webUid = (getpwnam($Config{ZM_WEB_USER}))[2]; + my $webGid = (getgrnam($Config{ZM_WEB_GROUP}))[2]; if ( $> == 0 ) { chown( $webUid, $webGid, $this->{logFile} ) - or Fatal( "Can't change permissions on log file '" - .$this->{logFile}."': $!" - ) + or Fatal("Can't change permissions on log file $$this{logFile}: $!"); } } else { - $this->fileLevel( NOLOG ); - $this->termLevel( INFO ); - Error( "Can't open log file '".$this->{logFile}."': $!" ); + $this->fileLevel(NOLOG); + $this->termLevel(INFO); + Error("Can't open log file $$this{logFile}: $!"); } } sub closeFile { - my $this = shift; - close( $LOGFILE ) if ( fileno($LOGFILE) ); + #my $this = shift; + close($LOGFILE) if fileno($LOGFILE); } sub logPrint { @@ -568,7 +565,7 @@ sub logPrint { my ($seconds, $microseconds) = gettimeofday(); my $message = sprintf( '%s.%06d %s[%d].%s [%s]' - , strftime( '%x %H:%M:%S' ,localtime( $seconds ) ) + , strftime('%x %H:%M:%S', localtime($seconds)) , $microseconds , $this->{id} , $$ @@ -576,42 +573,43 @@ sub logPrint { , $string ); if ( $this->{trace} ) { - $message = Carp::shortmess( $message ); + $message = Carp::shortmess($message); } else { $message = $message."\n"; } if ( $level <= $this->{syslogLevel} ) { - syslog( $priorities{$level}, $code." [%s]", $string ); + syslog($priorities{$level}, $code.' [%s]', $string); } - print( $LOGFILE $message ) if ( $level <= $this->{fileLevel} ); + print($LOGFILE $message) if $level <= $this->{fileLevel}; if ( $level <= $this->{databaseLevel} ) { - my $sql = 'insert into Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( ?, ?, ?, ?, ?, ?, ?, NULL )'; - $this->{sth} = $this->{dbh}->prepare_cached( $sql ); + my $sql = 'INSERT INTO Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) VALUES ( ?, ?, ?, ?, ?, ?, ?, NULL )'; + $this->{sth} = $this->{dbh}->prepare_cached($sql); if ( !$this->{sth} ) { $this->{databaseLevel} = NOLOG; - Fatal( "Can't prepare log entry '$sql': ".$this->{dbh}->errstr() ); + Error("Can't prepare log entry '$sql': ".$this->{dbh}->errstr()); + } else { + my $res = $this->{sth}->execute($seconds+($microseconds/1000000.0) + , $this->{id} + , $$ + , $level + , $code + , $string + , $this->{fileName} + ); + if ( !$res ) { + $this->{databaseLevel} = NOLOG; + Error("Can't execute log entry '$sql': ".$this->{sth}->errstr()); + } } - my $res = $this->{sth}->execute( $seconds+($microseconds/1000000.0) - , $this->{id} - , $$ - , $level - , $code - , $string - , $this->{fileName} - ); - if ( !$res ) { - $this->{databaseLevel} = NOLOG; - Fatal( "Can't execute log entry '$sql': ".$this->{sth}->errstr() ); - } - } - print( STDERR $message ) if ( $level <= $this->{termLevel} ); - } + } # end if doing db logging + print(STDERR $message) if $level <= $this->{termLevel}; + } # end if level < effectivelevel } sub logInit( ;@ ) { my %options = @_ ? @_ : (); $logger = ZoneMinder::Logger->new() if !$logger; - $logger->initialise( %options ); + $logger->initialise(%options); } sub logReinit { @@ -619,14 +617,14 @@ sub logReinit { } sub logTerm { - return unless ( $logger ); + return unless $logger; $logger->terminate(); $logger = undef; } sub logHupHandler { my $savedErrno = $!; - return unless( $logger ); + return unless $logger; fetch()->reinitialise(); logSetSignal(); $! = $savedErrno; @@ -641,88 +639,87 @@ sub logClearSignal { } sub logLevel { - return( fetch()->level( @_ ) ); + return fetch()->level(@_); } sub logDebugging { - return( fetch()->debugOn() ); + return fetch()->debugOn(); } sub logTermLevel { - return( fetch()->termLevel( @_ ) ); + return fetch()->termLevel(@_); } sub logDatabaseLevel { - return( fetch()->databaseLevel( @_ ) ); + return fetch()->databaseLevel(@_); } sub logFileLevel { - return( fetch()->fileLevel( @_ ) ); + return fetch()->fileLevel(@_); } sub logSyslogLevel { - return( fetch()->syslogLevel( @_ ) ); + return fetch()->syslogLevel(@_); } sub Mark { my $level = shift; - $level = DEBUG unless( defined($level) ); + $level = DEBUG unless defined($level); my $tag = 'Mark'; - fetch()->logPrint( $level, $tag ); + fetch()->logPrint($level, $tag); } sub Dump { my $var = shift; my $label = shift; - $label = 'VAR' unless( defined($label) ); - fetch()->logPrint( DEBUG, Data::Dumper->Dump( [ $var ], [ $label ] ) ); + $label = 'VAR' unless defined($label); + fetch()->logPrint(DEBUG, Data::Dumper->Dump([ $var ], [ $label ])); } sub debug { my $log = shift; - $log->logPrint( DEBUG, @_ ); -} + $log->logPrint(DEBUG, @_); + } sub Debug( @ ) { - fetch()->logPrint( DEBUG, @_ ); + fetch()->logPrint(DEBUG, @_); } sub Info( @ ) { - fetch()->logPrint( INFO, @_ ); + fetch()->logPrint(INFO, @_); } sub info { my $log = shift; - $log->logPrint( INFO, @_ ); + $log->logPrint(INFO, @_); } - sub Warning( @ ) { - fetch()->logPrint( WARNING, @_ ); + fetch()->logPrint(WARNING, @_); } sub warn { my $log = shift; - $log->logPrint( WARNING, @_ ); + $log->logPrint(WARNING, @_); } sub Error( @ ) { - fetch()->logPrint( ERROR, @_ ); + fetch()->logPrint(ERROR, @_); } sub error { my $log = shift; - $log->logPrint( ERROR, @_ ); + $log->logPrint(ERROR, @_); } sub Fatal( @ ) { - fetch()->logPrint( FATAL, @_ ); - if ( $SIG{TERM} ne 'DEFAULT' ) { + fetch()->logPrint(FATAL, @_); + if ( $SIG{TERM} and ( $SIG{TERM} ne 'DEFAULT' ) ) { $SIG{TERM}(); } - exit( -1 ); + exit(-1); } sub Panic( @ ) { - fetch()->logPrint( PANIC, @_ ); - confess( $_[0] ); + fetch()->logPrint(PANIC, @_); + confess($_[0]); } 1; @@ -741,10 +738,10 @@ logInit( 'myproc', DEBUG ); Debug( 'This is what is happening' ); Info( 'Something interesting is happening' ); -Warning( "Something might be going wrong." ); -Error( "Something has gone wrong!!" ); -Fatal( "Something has gone badly wrong, gotta stop!!" ); -Panic( "Something fundamental has gone wrong, die with stack trace ); +Warning( 'Something might be going wrong.' ); +Error( 'Something has gone wrong!!' ); +Fatal( 'Something has gone badly wrong, gotta stop!!' ); +Panic( 'Something fundamental has gone wrong, die with stack trace' ); =head1 DESCRIPTION diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Memory.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/Memory.pm.in index 2386c5d6f..834e0747c 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Memory.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/Memory.pm.in @@ -166,6 +166,8 @@ our $mem_data = { last_write_time => { type=>'time_t64', seq=>$mem_seq++ }, last_read_time => { type=>'time_t64', seq=>$mem_seq++ }, control_state => { type=>'uint8[256]', seq=>$mem_seq++ }, + alarm_cause => { type=>'int8[256]', seq=>$mem_seq++ }, + } }, trigger_data => { type=>'TriggerData', seq=>$mem_seq++, 'contents'=> { @@ -315,6 +317,12 @@ sub zmMemRead { my $type = $mem_data->{$section}->{contents}->{$element}->{type}; my $size = $mem_data->{$section}->{contents}->{$element}->{size}; + if (!defined $offset || !defined $type || !defined $size) { + Error ("Invalid field:".$field." setting to undef and exiting zmMemRead"); + zmMemInvalidate( $monitor ); + return( undef ); + } + my $data = zmMemGet( $monitor, $offset, $size ); if ( !defined($data) ) { Error( "Unable to read '$field' from memory for monitor ".$monitor->{Id} ); @@ -820,6 +828,7 @@ colour Read/write location for the current monitor colour contrast Read/write location for the current monitor contrast alarm_x Image x co-ordinate (from left) of the centre of the last motion event, -1 if none alarm_y Image y co-ordinate (from top) of the centre of the last motion event, -1 if none +alarm_cause The current alarm event cause string along with zone names(s) alarmed trigger_data The triggered event mapped memory section size The size, in bytes of this section diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Object.pm b/scripts/ZoneMinder/lib/ZoneMinder/Object.pm index baa77059a..073b6c17a 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Object.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Object.pm @@ -125,6 +125,7 @@ sub load { if ( $data and %$data ) { @$self{keys %$data} = values %$data; } # end if + return $data; } # end sub load sub lock_and_load { @@ -156,7 +157,7 @@ sub lock_and_load { if ( $ZoneMinder::Database::dbh->errstr ) { Error( "Failure to load Object record for $$self{$primary_key}: Reason: " . $ZoneMinder::Database::dbh->errstr ); } else { - Debug("No Results Loading $type from $table WHERE $primary_key = $$self{$primary_key}"); + Debug("No Results Lock and Loading $type from $table WHERE $primary_key = $$self{$primary_key}"); } # end if } # end if if ( $data and %$data ) { diff --git a/scripts/zmaudit.pl.in b/scripts/zmaudit.pl.in index 0e1faf640..0ab4e4e9d 100644 --- a/scripts/zmaudit.pl.in +++ b/scripts/zmaudit.pl.in @@ -246,7 +246,7 @@ MAIN: while( $loop ) { { my @day_dirs = glob("$monitor_dir/[0-9][0-9]/[0-9][0-9]/[0-9][0-9]"); - Debug(qq`Checking for Deep Events under using glob("$monitor_dir/[0-9][0-9]/[0-9][0-9]/[0-9][0-9]") returned `. scalar @day_dirs . " events"); + Debug(qq`Checking for Deep Events under $$Storage{Path} using glob("$monitor_dir/[0-9][0-9]/[0-9][0-9]/[0-9][0-9]") returned `. scalar @day_dirs . ' events'); foreach my $day_dir ( @day_dirs ) { Debug( "Checking day dir $day_dir" ); ( $day_dir ) = ( $day_dir =~ /^(.*)$/ ); # De-taint @@ -294,7 +294,7 @@ MAIN: while( $loop ) { } # end foreach day dir } - Debug("Checking for Medium Scheme Events under $monitor_dir"); + Debug("Checking for Medium Scheme Events under $$Storage{Path}/$monitor_dir"); { my @event_dirs = glob("$monitor_dir/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/*"); Debug(qq`glob("$monitor_dir/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/*") returned ` . scalar @event_dirs . " entries." ); diff --git a/scripts/zmdc.pl.in b/scripts/zmdc.pl.in index e606be872..686f09096 100644 --- a/scripts/zmdc.pl.in +++ b/scripts/zmdc.pl.in @@ -104,6 +104,10 @@ my @daemons = ( 'zmtelemetry.pl' ); +if ($Config{ZM_OPT_USE_EVENTNOTIFICATION}) { + push @daemons,'zmeventnotification.pl'; +} + my $command = shift @ARGV; if( ! $command ) { print( STDERR "No command given\n" ); @@ -236,8 +240,8 @@ use Sys::MemInfo qw(totalmem freemem totalswap freeswap); use Sys::CpuLoad; #use Data::Dumper; -# We count 100 of these, so total timeout is this value *100. -use constant KILL_DELAY => 100*1000; # 1/10th of a second +# We count 10 of these, so total timeout is this value *10. +use constant KILL_DELAY => 1; # seconds our %cmd_hash; our %pid_hash; @@ -289,9 +293,8 @@ sub run { if ( $Config{ZM_SERVER_ID} ) { require ZoneMinder::Server; - dPrint( ZoneMinder::Logger::INFO, 'Loading Server record' ); $Server = new ZoneMinder::Server( $Config{ZM_SERVER_ID} ); - dPrint( ZoneMinder::Logger::INFO, 'Loading Server record have ' . $$Server{Name} ); + dPrint( ZoneMinder::Logger::INFO, 'Loading Server record have ' . $$Server{Name} ); } while( 1 ) { @@ -300,7 +303,7 @@ sub run { if ( ! ( $secs_count % 60 ) ) { $dbh = zmDbConnect() if ! $dbh->ping(); my @cpuload = Sys::CpuLoad::load(); - dPrint( ZoneMinder::Logger::INFO, 'Updating Server record' ); + dPrint( ZoneMinder::Logger::DEBUG, 'Updating Server record' ); if ( ! defined $dbh->do(q{UPDATE Servers SET Status=?,CpuLoad=?,TotalMem=?,FreeMem=?,TotalSwap=?,FreeSwap=? WHERE Id=?}, undef, 'Running', $cpuload[0], &totalmem, &freemem, &totalswap, &freeswap, $Config{ZM_SERVER_ID} ) ) { Error("Failed Updating status of Server record for Id=$Config{ZM_SERVER_ID}".$dbh->errstr()); @@ -385,6 +388,7 @@ sub cPrint { } } +# I think the purpose of this is to echo the logs to the client process so it can then display them. sub dPrint { my $logLevel = shift; if ( fileno(CLIENT) ) { @@ -523,7 +527,7 @@ sub kill_until_dead { my $blockset = POSIX::SigSet->new(SIGCHLD); sigprocmask(SIG_BLOCK, $blockset, $sigset ) or die "dying at block...\n"; while( $process and $$process{pid} and kill( 0, $$process{pid} ) ) { - if ( $count++ > 100 ) { + if ( $count++ > 10 ) { dPrint( ZoneMinder::Logger::WARNING, "'$$process{command}' has not stopped at " .strftime( '%y/%m/%d %H:%M:%S', localtime() ) .". Sending KILL to pid $$process{pid}\n" @@ -532,8 +536,9 @@ sub kill_until_dead { last; } + # THe purpose of the signal blocking is to simplify the concurrency sigprocmask(SIG_UNBLOCK, $blockset) or die "dying at unblock...\n"; - usleep( KILL_DELAY ); + sleep( KILL_DELAY ); sigprocmask(SIG_BLOCK, $blockset, $sigset ) or die "dying at block...\n"; } sigprocmask(SIG_UNBLOCK, $blockset) or die "dying at unblock...\n"; diff --git a/scripts/zmfilter.pl.in b/scripts/zmfilter.pl.in index 12dae98cf..d876a58fc 100644 --- a/scripts/zmfilter.pl.in +++ b/scripts/zmfilter.pl.in @@ -327,6 +327,7 @@ sub checkFilter { Error( "Unable toto delete event $event->{Id} as previous operations failed\n" ); } } # end if AutoDelete + if ( $filter->{AutoMove} ) { my $Event = new ZoneMinder::Event( $$event{Id}, $event ); my $NewStorage = new ZoneMinder::Storage( $filter->{AutoMoveTo} ); diff --git a/scripts/zmpkg.pl.in b/scripts/zmpkg.pl.in index 3daadbc26..7d993ed07 100644 --- a/scripts/zmpkg.pl.in +++ b/scripts/zmpkg.pl.in @@ -205,6 +205,7 @@ if ( $command =~ /^(?:start|restart)$/ ) { $sql = 'SELECT * FROM Monitors'; } + { my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); my $res = $sth->execute( @values ) @@ -226,9 +227,24 @@ if ( $command =~ /^(?:start|restart)$/ ) { } } $sth->finish(); - + } + { + my $sql = 'SELECT Id FROM Filters WHERE Background=1'; + my $sth = $dbh->prepare_cached($sql) + or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() + or Fatal( "Can't execute: ".$sth->errstr() ); + if ( $sth->rows ) { + while( my $filter = $sth->fetchrow_hashref() ) { # This is now started unconditionally - runCommand('zmdc.pl start zmfilter.pl'); + runCommand("zmdc.pl start zmfilter.pl --filter_id=$$filter{Id}"); + } + } else { + runCommand('zmdc.pl start zmfilter.pl'); + } + $sth->finish(); + } + if ( $Config{ZM_RUN_AUDIT} ) { if ( $Server and exists $$Server{'zmaudit'} and ! $$Server{'zmaudit'} ) { Debug("Not running zmaudit.pl because it is turned off for this server."); @@ -253,6 +269,9 @@ if ( $command =~ /^(?:start|restart)$/ ) { if ( $Config{ZM_TELEMETRY_DATA} ) { runCommand('zmdc.pl start zmtelemetry.pl'); } + if ($Config{ZM_OPT_USE_EVENTNOTIFICATION} ) { + runCommand('zmdc.pl start zmeventnotification.pl'); + } if ( $Server and exists $$Server{'zmstats'} and ! $$Server{'zmstats'} ) { Debug("Not running zmstats.pl because it is turned off for this server."); } else { diff --git a/scripts/zmstats.pl.in b/scripts/zmstats.pl.in index 3c955020c..888a18351 100644 --- a/scripts/zmstats.pl.in +++ b/scripts/zmstats.pl.in @@ -83,10 +83,10 @@ while( 1 ) { $dbh = zmDbConnect(); } - $dbh->do('DELETE FROM Events_Hour WHERE StartTime < DATE_SUB(NOW(), INTERVAL 1 hour)'); - $dbh->do('DELETE FROM Events_Day WHERE StartTime < DATE_SUB(NOW(), INTERVAL 1 day)'); - $dbh->do('DELETE FROM Events_Week WHERE StartTime < DATE_SUB(NOW(), INTERVAL 1 week)'); - $dbh->do('DELETE FROM Events_Month WHERE StartTime < DATE_SUB(NOW(), INTERVAL 1 month)'); + $dbh->do('DELETE FROM Events_Hour WHERE StartTime < DATE_SUB(NOW(), INTERVAL 1 hour)') or Error($dbh->errstr()); + $dbh->do('DELETE FROM Events_Day WHERE StartTime < DATE_SUB(NOW(), INTERVAL 1 day)') or Error($dbh->errstr()); + $dbh->do('DELETE FROM Events_Week WHERE StartTime < DATE_SUB(NOW(), INTERVAL 1 week)') or Error($dbh->errstr()); + $dbh->do('DELETE FROM Events_Month WHERE StartTime < DATE_SUB(NOW(), INTERVAL 1 month)') or Error($dbh->errstr()); sleep( $Config{ZM_STATS_UPDATE_INTERVAL} ); } # end while (1) diff --git a/scripts/zmtelemetry.pl.in b/scripts/zmtelemetry.pl.in index 54521d335..c23240891 100644 --- a/scripts/zmtelemetry.pl.in +++ b/scripts/zmtelemetry.pl.in @@ -53,67 +53,70 @@ GetOptions( version => \$version ); if ( $version ) { - print( ZoneMinder::Base::ZM_VERSION . "\n"); - exit(0); + print( ZoneMinder::Base::ZM_VERSION . "\n"); + exit(0); } if ( $help ) { - pod2usage(-exitstatus => -1); + pod2usage(-exitstatus => -1); } if ( ! defined $interval ) { $interval = eval($Config{ZM_TELEMETRY_INTERVAL}); } -if ( $Config{ZM_TELEMETRY_DATA} or $force ) { - print "Update agent starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n"; +if ( !($Config{ZM_TELEMETRY_DATA} or $force) ) { + print "ZoneMinder Telemetry Agent not enabled. Exiting.\n"; + exit(0); +} + +print 'ZoneMinder Telemetry Agent starting at '.strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n"; - my $lastCheck = $Config{ZM_TELEMETRY_LAST_UPLOAD}; +my $lastCheck = $Config{ZM_TELEMETRY_LAST_UPLOAD}; - while( 1 ) { - my $now = time(); - my $since_last_check = $now-$lastCheck; - Debug(" Last Check time (now($now) - lastCheck($lastCheck)) = $since_last_check > interval($interval) or force($force)"); - if ( $since_last_check < 0 ) { - Warning( "Seconds since last check is negative! Which means that lastCheck is in the future!" ); - next; - } - if ( ( ($now-$lastCheck) > $interval ) or $force ) { - print "Collecting data to send to ZoneMinder Telemetry server.\n"; - my $dbh = zmDbConnect(); +while( 1 ) { + my $now = time(); + my $since_last_check = $now-$lastCheck; + Debug(" Last Check time (now($now) - lastCheck($lastCheck)) = $since_last_check > interval($interval) or force($force)"); + if ( $since_last_check < 0 ) { + Warning( 'Seconds since last check is negative! Which means that lastCheck is in the future!' ); + next; + } + if ( ( ($since_last_check) > $interval ) or $force ) { + print "Collecting data to send to ZoneMinder Telemetry server.\n"; + my $dbh = zmDbConnect(); # Build the telemetry hash # We should keep *BSD systems in mind when calling system commands - my %telemetry; - $telemetry{uuid} = getUUID($dbh); - $telemetry{ip} = getIP(); - $telemetry{timestamp} = strftime( '%Y-%m-%dT%H:%M:%S%z', localtime() ); - $telemetry{monitor_count} = countQuery($dbh,'Monitors'); - $telemetry{event_count} = countQuery($dbh,'Events'); - $telemetry{architecture} = runSysCmd('uname -p'); - ($telemetry{kernel}, $telemetry{distro}, $telemetry{version}) = getDistro(); - $telemetry{zm_version} = ZoneMinder::Base::ZM_VERSION; - $telemetry{system_memory} = totalmem(); - $telemetry{processor_count} = cpu_count(); - $telemetry{monitors} = getMonitorRef($dbh); + my %telemetry; + $telemetry{uuid} = getUUID($dbh); + $telemetry{ip} = getIP(); + $telemetry{timestamp} = strftime( '%Y-%m-%dT%H:%M:%S%z', localtime() ); + $telemetry{monitor_count} = countQuery($dbh,'Monitors'); + $telemetry{event_count} = countQuery($dbh,'Events'); + $telemetry{architecture} = runSysCmd('uname -p'); + ($telemetry{kernel}, $telemetry{distro}, $telemetry{version}) = getDistro(); + $telemetry{zm_version} = ZoneMinder::Base::ZM_VERSION; + $telemetry{system_memory} = totalmem(); + $telemetry{processor_count} = cpu_count(); + $telemetry{monitors} = getMonitorRef($dbh); - Info( 'Sending data to ZoneMinder Telemetry server.' ); + Info('Sending data to ZoneMinder Telemetry server.'); - my $result = jsonEncode( \%telemetry ); + my $result = jsonEncode(\%telemetry); - if ( sendData($result) ) { - - my $sql = q`UPDATE Config SET Value = ? WHERE Name = 'ZM_TELEMETRY_LAST_UPLOAD'`; - my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); - my $res = $sth->execute( $now ) or die( "Can't execute: ".$sth->errstr() ); - $sth->finish(); - $Config{ZM_TELEMETRY_LAST_UPLOAD} = $now; - } - zmDbDisconnect(); - } elsif ( -t STDIN ) { - print "Update agent sleeping for 1 hour because ($now-$lastCheck=$since_last_check > $interval\n"; - } - sleep( 3600 ); - } - print 'Update agent exiting at '.strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n"; -} + if ( sendData($result) ) { + my $sql = q`UPDATE Config SET Value = ? WHERE Name = 'ZM_TELEMETRY_LAST_UPLOAD'`; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute($now) or die( "Can't execute: ".$sth->errstr() ); + $sth->finish(); + $Config{ZM_TELEMETRY_LAST_UPLOAD} = $now; + } + zmDbDisconnect(); + } elsif ( -t STDIN ) { + print "ZoneMinder Telemetry Agent sleeping for $interval seconds because ($now-$lastCheck=$since_last_check > $interval\n"; + } + $lastCheck = $now; + sleep($interval); +} # end while +print 'ZoneMinder Telemetry Agent exiting at '.strftime('%y/%m/%d %H:%M:%S', localtime())."\n"; ############### # SUBROUTINES # @@ -178,7 +181,7 @@ sub sendData { # Retrieves the UUID from the database. Creates a new UUID if one does not exist. sub getUUID { my $dbh = shift; - my $uuid= ""; + my $uuid= ''; # Verify the current UUID is valid and not nil if (( $Config{ZM_TELEMETRY_UUID} =~ /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i ) && ( $Config{ZM_TELEMETRY_UUID} ne '00000000-0000-0000-0000-000000000000' )) { diff --git a/scripts/zmvideo.pl.in b/scripts/zmvideo.pl.in index 788ecde87..1f1b33acc 100644 --- a/scripts/zmvideo.pl.in +++ b/scripts/zmvideo.pl.in @@ -197,8 +197,6 @@ my $sql = " SELECT (SELECT max(Delta) FROM Frames WHERE EventId=Events.Id)-(SELE Events.*, unix_timestamp(Events.StartTime) as Time, M.Name as MonitorName, - M.Width as MonitorWidth, - M.Height as MonitorHeight, M.Palette FROM Events INNER JOIN Monitors as M on Events.MonitorId = M.Id diff --git a/src/zm_camera.h b/src/zm_camera.h index 204aa526d..4b17f314a 100644 --- a/src/zm_camera.h +++ b/src/zm_camera.h @@ -89,7 +89,7 @@ public: bool IscURL() const { return( type == CURL_SRC ); } unsigned int Width() const { return( width ); } unsigned int Height() const { return( height ); } - unsigned int Colours() const { return( colours ); } + unsigned int Colours() const { return colours; } unsigned int SubpixelOrder() const { return( subpixelorder ); } unsigned int Pixels() const { return( pixels ); } unsigned int ImageSize() const { return( imagesize ); } diff --git a/src/zm_comms.h b/src/zm_comms.h index b5974771d..133c0d19f 100644 --- a/src/zm_comms.h +++ b/src/zm_comms.h @@ -194,7 +194,7 @@ public: SockAddrUnix(); SockAddrUnix( const SockAddrUnix &addr ) : SockAddr( (const struct sockaddr *)&mAddrUn ), mAddrUn( addr.mAddrUn ) { } - SockAddrUnix( const struct sockaddr_un *addr ) : SockAddr( (const struct sockaddr *)&mAddrUn ), mAddrUn( *addr ) { + explicit SockAddrUnix( const struct sockaddr_un *addr ) : SockAddr( (const struct sockaddr *)&mAddrUn ), mAddrUn( *addr ) { } bool resolve( const char *path, const char *proto ); @@ -622,9 +622,9 @@ protected: public: Select(); - Select( struct timeval timeout ); - Select( int timeout ); - Select( double timeout ); + explicit Select( struct timeval timeout ); + explicit Select( int timeout ); + explicit Select( double timeout ); void setTimeout( int timeout ); void setTimeout( double timeout ); diff --git a/src/zm_db.cpp b/src/zm_db.cpp index fc5ee5fe0..131306854 100644 --- a/src/zm_db.cpp +++ b/src/zm_db.cpp @@ -34,31 +34,31 @@ bool zmDbConnect() { //if ( zmDbConnected ) //return; - if ( !mysql_init( &dbconn ) ) { - Error( "Can't initialise database connection: %s", mysql_error( &dbconn ) ); + if ( !mysql_init(&dbconn) ) { + Error("Can't initialise database connection: %s", mysql_error(&dbconn)); return false; } my_bool reconnect = 1; - if ( mysql_options( &dbconn, MYSQL_OPT_RECONNECT, &reconnect ) ) - Error( "Can't set database auto reconnect option: %s", mysql_error( &dbconn) ); + if ( mysql_options(&dbconn, MYSQL_OPT_RECONNECT, &reconnect) ) + Error("Can't set database auto reconnect option: %s", mysql_error(&dbconn)); if ( !staticConfig.DB_SSL_CA_CERT.empty() ) - mysql_ssl_set( &dbconn, + mysql_ssl_set(&dbconn, staticConfig.DB_SSL_CLIENT_KEY.c_str(), staticConfig.DB_SSL_CLIENT_CERT.c_str(), staticConfig.DB_SSL_CA_CERT.c_str(), - NULL, NULL ); - std::string::size_type colonIndex = staticConfig.DB_HOST.find( ":" ); + NULL, NULL); + std::string::size_type colonIndex = staticConfig.DB_HOST.find(":"); if ( colonIndex == std::string::npos ) { - if ( !mysql_real_connect( &dbconn, staticConfig.DB_HOST.c_str(), staticConfig.DB_USER.c_str(), staticConfig.DB_PASS.c_str(), NULL, 0, NULL, 0 ) ) { - Error( "Can't connect to server: %s", mysql_error( &dbconn ) ); + if ( !mysql_real_connect(&dbconn, staticConfig.DB_HOST.c_str(), staticConfig.DB_USER.c_str(), staticConfig.DB_PASS.c_str(), NULL, 0, NULL, 0) ) { + Error( "Can't connect to server: %s", mysql_error(&dbconn)); return false; } } else { std::string dbHost = staticConfig.DB_HOST.substr( 0, colonIndex ); std::string dbPortOrSocket = staticConfig.DB_HOST.substr( colonIndex+1 ); if ( dbPortOrSocket[0] == '/' ) { - if ( !mysql_real_connect( &dbconn, NULL, staticConfig.DB_USER.c_str(), staticConfig.DB_PASS.c_str(), NULL, 0, dbPortOrSocket.c_str(), 0 ) ) { - Error( "Can't connect to server: %s", mysql_error( &dbconn ) ); + if ( !mysql_real_connect(&dbconn, NULL, staticConfig.DB_USER.c_str(), staticConfig.DB_PASS.c_str(), NULL, 0, dbPortOrSocket.c_str(), 0) ) { + Error("Can't connect to server: %s", mysql_error(&dbconn)); return false; } } else { @@ -70,7 +70,7 @@ bool zmDbConnect() { } if ( mysql_select_db( &dbconn, staticConfig.DB_NAME.c_str() ) ) { Error( "Can't select database: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); + return false; } zmDbConnected = true; return zmDbConnected; @@ -78,67 +78,72 @@ bool zmDbConnect() { void zmDbClose() { if ( zmDbConnected ) { + db_mutex.lock(); mysql_close( &dbconn ); // mysql_init() call implicitly mysql_library_init() but // mysql_close() does not call mysql_library_end() mysql_library_end(); zmDbConnected = false; + db_mutex.unlock(); } } -MYSQL_RES * zmDbFetch( const char * query ) { +MYSQL_RES * zmDbFetch(const char * query) { if ( ! zmDbConnected ) { - Error( "Not connected." ); + Error("Not connected."); return NULL; } db_mutex.lock(); - if ( mysql_query( &dbconn, query ) ) { - Error( "Can't run query: %s", mysql_error( &dbconn ) ); + if ( mysql_query(&dbconn, query) ) { + Error("Can't run query: %s", mysql_error(&dbconn)); + db_mutex.unlock(); return NULL; } - Debug( 4, "Success running query: %s", query ); - MYSQL_RES *result = mysql_store_result( &dbconn ); + Debug(4, "Success running query: %s", query); + MYSQL_RES *result = mysql_store_result(&dbconn); if ( !result ) { - Error( "Can't use query result: %s for query %s", mysql_error( &dbconn ), query ); - return NULL; + Error("Can't use query result: %s for query %s", mysql_error(&dbconn), query); } db_mutex.unlock(); return result; -} // end MYSQL_RES * zmDbFetch( const char * query ); +} // end MYSQL_RES * zmDbFetch(const char * query); -zmDbRow *zmDbFetchOne( const char *query ) { +zmDbRow *zmDbFetchOne(const char *query) { zmDbRow *row = new zmDbRow(); - if ( row->fetch( query ) ) { + if ( row->fetch(query) ) { return row; } delete row; return NULL; } -MYSQL_RES *zmDbRow::fetch( const char *query ) { - result_set = zmDbFetch( query ); +MYSQL_RES *zmDbRow::fetch(const char *query) { + result_set = zmDbFetch(query); if ( ! result_set ) return result_set; - int n_rows = mysql_num_rows( result_set ); + int n_rows = mysql_num_rows(result_set); if ( n_rows != 1 ) { - Error( "Bogus number of lines return from query, %d returned for query %s.", n_rows, query ); - mysql_free_result( result_set ); + Error("Bogus number of lines return from query, %d returned for query %s.", n_rows, query); + mysql_free_result(result_set); result_set = NULL; return result_set; } - row = mysql_fetch_row( result_set ); + row = mysql_fetch_row(result_set); if ( ! row ) { - mysql_free_result( result_set ); + mysql_free_result(result_set); result_set = NULL; - Error("Error getting row from query %s. Error is %s", query, mysql_error( &dbconn ) ); + Error("Error getting row from query %s. Error is %s", query, mysql_error(&dbconn)); } else { Debug(5, "Success"); } return result_set; } + zmDbRow::~zmDbRow() { - if ( result_set ) - mysql_free_result( result_set ); + if ( result_set ) { + mysql_free_result(result_set); + result_set = NULL; + } } diff --git a/src/zm_db.h b/src/zm_db.h index 267995e70..de47a6108 100644 --- a/src/zm_db.h +++ b/src/zm_db.h @@ -33,6 +33,8 @@ class zmDbRow { zmDbRow( MYSQL_RES *, MYSQL_ROW *row ); ~zmDbRow(); + MYSQL_ROW mysql_row() const { return row; }; + char *operator[](unsigned int index) const { return row[index]; } diff --git a/src/zm_event.cpp b/src/zm_event.cpp index e275fa963..b88a9e71b 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -49,10 +49,10 @@ Event::Event( const std::string &p_cause, const StringSetMap &p_noteSetMap ) : - monitor( p_monitor ), - start_time( p_start_time ), - cause( p_cause ), - noteSetMap( p_noteSetMap ) + monitor(p_monitor), + start_time(p_start_time), + cause(p_cause), + noteSetMap(p_noteSetMap) { std::string notes; @@ -71,6 +71,7 @@ Event::Event( } Storage * storage = monitor->getStorage(); + scheme = storage->Scheme(); unsigned int state_id = 0; zmDbRow dbrow; @@ -78,8 +79,12 @@ Event::Event( state_id = atoi(dbrow[0]); } - static char sql[ZM_SQL_MED_BUFSIZ]; - snprintf( sql, sizeof(sql), "INSERT INTO Events ( MonitorId, StorageId, Name, StartTime, Width, Height, Cause, Notes, StateId, Orientation, Videoed, DefaultVideo, SaveJPEGs, Scheme ) values ( %d, %d, 'New Event', from_unixtime( %ld ), %d, %d, '%s', '%s', %d, %d, %d, '', %d, '%s' )", + char sql[ZM_SQL_MED_BUFSIZ]; + snprintf(sql, sizeof(sql), + "INSERT INTO Events " + "( MonitorId, StorageId, Name, StartTime, Width, Height, Cause, Notes, StateId, Orientation, Videoed, DefaultVideo, SaveJPEGs, Scheme )" + " VALUES " + "( %d, %d, 'New Event', from_unixtime( %ld ), %d, %d, '%s', '%s', %d, %d, %d, '', %d, '%s' )", monitor->Id(), storage->Id(), start_time.tv_sec, @@ -93,16 +98,16 @@ Event::Event( monitor->GetOptSaveJPEGs(), storage->SchemeString().c_str() ); - db_mutex.lock(); - if ( mysql_query( &dbconn, sql ) ) { - Error( "Can't insert event: %s. sql was (%s)", mysql_error( &dbconn ), sql ); - exit( mysql_errno( &dbconn ) ); + if ( mysql_query(&dbconn, sql) ) { + Error("Can't insert event: %s. sql was (%s)", mysql_error(&dbconn), sql); + db_mutex.unlock(); + return; } - id = mysql_insert_id( &dbconn ); + id = mysql_insert_id(&dbconn); db_mutex.unlock(); if ( untimedEvent ) { - Warning( "Event %d has zero time, setting to current", id ); + Warning("Event %d has zero time, setting to current", id); } end_time.tv_sec = 0; frames = 0; @@ -111,12 +116,10 @@ Event::Event( max_score = 0; have_video_keyframe = false; - char id_file[PATH_MAX]; - struct tm *stime = localtime( &start_time.tv_sec ); + struct tm *stime = localtime(&start_time.tv_sec); if ( storage->Scheme() == Storage::DEEP ) { - char *path_ptr = path; - path_ptr += snprintf( path_ptr, sizeof(path), "%s/%d", storage->Path(), monitor->Id() ); + path = stringtf("%s/%d", storage->Path(), monitor->Id()); int dt_parts[6]; dt_parts[0] = stime->tm_year-100; @@ -130,55 +133,54 @@ Event::Event( char time_path[PATH_MAX] = ""; char *time_path_ptr = time_path; for ( unsigned int i = 0; i < sizeof(dt_parts)/sizeof(*dt_parts); i++ ) { - path_ptr += snprintf( path_ptr, sizeof(path)-(path_ptr-path), "/%02d", dt_parts[i] ); + path += stringtf("/%02d", dt_parts[i]); errno = 0; - if ( mkdir( path, 0755 ) ) { + if ( mkdir(path.c_str(), 0755) ) { // FIXME This should not be fatal. Should probably move to a different storage area. if ( errno != EEXIST ) { - Error( "Can't mkdir %s: %s", path, strerror(errno)); + Error("Can't mkdir %s: %s", path.c_str(), strerror(errno)); } } if ( i == 2 ) - strncpy( date_path, path, sizeof(date_path) ); + strncpy(date_path, path.c_str(), sizeof(date_path)); else if ( i >= 3 ) - time_path_ptr += snprintf( time_path_ptr, sizeof(time_path)-(time_path_ptr-time_path), "%s%02d", i>3?"/":"", dt_parts[i] ); + time_path_ptr += snprintf(time_path_ptr, sizeof(time_path)-(time_path_ptr-time_path), "%s%02d", i>3?"/":"", dt_parts[i]); } // Create event id symlink - snprintf( id_file, sizeof(id_file), "%s/.%d", date_path, id ); - if ( symlink( time_path, id_file ) < 0 ) - Error( "Can't symlink %s -> %s: %s", id_file, path, strerror(errno)); + std::string id_file = stringtf("%s/.%llu", date_path, id); + if ( symlink(time_path, id_file.c_str()) < 0 ) + Error("Can't symlink %s -> %s: %s", id_file.c_str(), path.c_str(), strerror(errno)); } else if ( storage->Scheme() == Storage::MEDIUM ) { - char *path_ptr = path; - path_ptr += snprintf( path_ptr, sizeof(path), "%s/%d/%04d-%02d-%02d", + path = stringtf("%s/%d/%04d-%02d-%02d", storage->Path(), monitor->Id(), stime->tm_year+1900, stime->tm_mon+1, stime->tm_mday ); - if ( mkdir( path, 0755 ) ) { + if ( mkdir(path.c_str(), 0755) ) { // FIXME This should not be fatal. Should probably move to a different storage area. if ( errno != EEXIST ) - Error( "Can't mkdir %s: %s", path, strerror(errno)); + Error("Can't mkdir %s: %s", path.c_str(), strerror(errno)); } - path_ptr += snprintf( path_ptr, sizeof(path), "/%d", id ); - if ( mkdir( path, 0755 ) ) { + path += stringtf("/%llu", id); + if ( mkdir(path.c_str(), 0755) ) { // FIXME This should not be fatal. Should probably move to a different storage area. if ( errno != EEXIST ) - Error( "Can't mkdir %s: %s", path, strerror(errno)); + Error("Can't mkdir %s: %s", path.c_str(), strerror(errno)); } } else { // Shallow Storage - snprintf( path, sizeof(path), "%s/%d/%d", storage->Path(), monitor->Id(), id ); - if ( mkdir( path, 0755 ) ) { + path = stringtf("%s/%d/%llu", storage->Path(), monitor->Id(), id); + if ( mkdir(path.c_str(), 0755) ) { if ( errno != EEXIST ) { - Error( "Can't mkdir %s: %s", path, strerror(errno)); + Error("Can't mkdir %s: %s", path.c_str(), strerror(errno)); } } // Create empty id tag file - snprintf( id_file, sizeof(id_file), "%s/.%d", path, id ); - if ( FILE *id_fp = fopen( id_file, "w" ) ) - fclose( id_fp ); + std::string id_file = stringtf("%s/.%llu", path, id); + if ( FILE *id_fp = fopen(id_file.c_str(), "w") ) + fclose(id_fp); else - Error( "Can't fopen %s: %s", id_file, strerror(errno)); + Error("Can't fopen %s: %s", id_file.c_str(), strerror(errno)); } // deep storage or not last_db_frame = 0; @@ -197,9 +199,9 @@ Event::Event( } } - snprintf( video_name, sizeof(video_name), "%d-%s.%s", id, "video", container.c_str() ); - snprintf( video_file, sizeof(video_file), staticConfig.video_file_format, path, video_name ); - Debug(1,"Writing video file to %s", video_file ); + snprintf(video_name, sizeof(video_name), "%llu-%s.%s", id, "video", container.c_str()); + snprintf(video_file, sizeof(video_file), staticConfig.video_file_format, path.c_str(), video_name); + Debug(1,"Writing video file to %s", video_file); Camera * camera = monitor->getCamera(); videoStore = new VideoStore( video_file, @@ -211,28 +213,14 @@ Event::Event( if ( ! videoStore->open() ) { delete videoStore; videoStore = NULL; - } + } } } // Event::Event( Monitor *p_monitor, struct timeval p_start_time, const std::string &p_cause, const StringSetMap &p_noteSetMap, bool p_videoEvent ) Event::~Event() { - static char sql[ZM_SQL_MED_BUFSIZ]; - struct DeltaTimeval delta_time; - DELTA_TIMEVAL(delta_time, end_time, start_time, DT_PREC_2); - Debug(2, "start_time:%d.%d end_time%d.%d", start_time.tv_sec, start_time.tv_usec, end_time.tv_sec, end_time.tv_usec ); - if ( frames > last_db_frame ) { - Debug( 1, "Adding closing frame %d to DB", frames ); - snprintf( sql, sizeof(sql), - "insert into Frames ( EventId, FrameId, TimeStamp, Delta ) values ( %d, %d, from_unixtime( %ld ), %s%ld.%02ld )", - id, frames, end_time.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec ); - db_mutex.lock(); - if ( mysql_query( &dbconn, sql ) ) { - Error( "Can't insert frame: %s", mysql_error( &dbconn ) ); - } - db_mutex.unlock(); - } + // We close the videowriter first, because if we finish the event, we might try to view the file, but we aren't done writing it yet. /* Close the video file */ if ( videoStore ) { @@ -240,15 +228,41 @@ Event::~Event() { videoStore = NULL; } - snprintf( sql, sizeof(sql), "UPDATE Events SET Name='%s%d', EndTime = from_unixtime( %ld ), Length = %s%ld.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d, DefaultVideo = '%s' where Id = %d", monitor->EventPrefix(), id, end_time.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec, frames, alarm_frames, tot_score, (int)(alarm_frames?(tot_score/alarm_frames):0), max_score, video_name, id ); + // Should not be static because we are multi-threaded + char sql[ZM_SQL_MED_BUFSIZ]; + struct DeltaTimeval delta_time; + DELTA_TIMEVAL(delta_time, end_time, start_time, DT_PREC_2); + Debug(2, "start_time:%d.%d end_time%d.%d", start_time.tv_sec, start_time.tv_usec, end_time.tv_sec, end_time.tv_usec); + + if ( frames > last_db_frame ) { + Debug(1, "Adding closing frame %d to DB", frames); + snprintf(sql, sizeof(sql), + "INSERT INTO Frames ( EventId, FrameId, TimeStamp, Delta ) VALUES ( %llu, %d, from_unixtime( %ld ), %s%ld.%02ld )", + id, frames, end_time.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec); + db_mutex.lock(); + if ( mysql_query(&dbconn, sql) ) { + Error("Can't insert frame: %s", mysql_error(&dbconn)); + } else { + Debug(1,"Success writing last frame"); + } + db_mutex.unlock(); + } + + snprintf(sql, sizeof(sql), + "UPDATE Events SET Name='%s %llu', EndTime = from_unixtime( %ld ), Length = %s%ld.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d, DefaultVideo = '%s' where Id = %llu", + monitor->EventPrefix(), id, end_time.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec, frames, alarm_frames, tot_score, (int)(alarm_frames?(tot_score/alarm_frames):0), max_score, video_name, id ); db_mutex.lock(); - if ( mysql_query( &dbconn, sql ) ) { - Error( "Can't update event: %s", mysql_error( &dbconn ) ); + while ( mysql_query(&dbconn, sql) ) { + Error("Can't update event: %s reason: %s", sql, mysql_error(&dbconn)); + db_mutex.unlock(); + sleep(1); + db_mutex.lock(); } db_mutex.unlock(); -} // ~Event -void Event::createNotes( std::string ¬es ) { +} // Event::~Event() + +void Event::createNotes(std::string ¬es) { notes.clear(); for ( StringSetMap::const_iterator mapIter = noteSetMap.begin(); mapIter != noteSetMap.end(); ++mapIter ) { notes += mapIter->first; @@ -380,10 +394,10 @@ void Event::updateNotes( const StringSetMap &newNoteSetMap ) { #else static char escapedNotes[ZM_SQL_MED_BUFSIZ]; - mysql_real_escape_string( &dbconn, escapedNotes, notes.c_str(), notes.length() ); + mysql_real_escape_string(&dbconn, escapedNotes, notes.c_str(), notes.length()); + snprintf(sql, sizeof(sql), "UPDATE Events SET Notes = '%s' WHERE Id = %llu", escapedNotes, id); db_mutex.lock(); - snprintf( sql, sizeof(sql), "UPDATE Events SET Notes = '%s' WHERE Id = %d", escapedNotes, id ); if ( mysql_query( &dbconn, sql ) ) { Error( "Can't insert event: %s", mysql_error( &dbconn ) ); } @@ -392,13 +406,13 @@ void Event::updateNotes( const StringSetMap &newNoteSetMap ) { } } -void Event::AddFrames( int n_frames, Image **images, struct timeval **timestamps ) { +void Event::AddFrames(int n_frames, Image **images, struct timeval **timestamps) { for (int i = 0; i < n_frames; i += ZM_SQL_BATCH_SIZE) { AddFramesInternal(n_frames, i, images, timestamps); } } -void Event::AddFramesInternal( int n_frames, int start_frame, Image **images, struct timeval **timestamps ) { +void Event::AddFramesInternal(int n_frames, int start_frame, Image **images, struct timeval **timestamps) { static char sql[ZM_SQL_LGE_BUFSIZ]; strncpy( sql, "insert into Frames ( EventId, FrameId, TimeStamp, Delta ) values ", sizeof(sql) ); int frameCount = 0; @@ -441,7 +455,7 @@ void Event::AddFramesInternal( int n_frames, int start_frame, Image **images, st } int sql_len = strlen(sql); - snprintf( sql+sql_len, sizeof(sql)-sql_len, "( %d, %d, from_unixtime(%ld), %s%ld.%02ld ), ", id, frames, timestamps[i]->tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec ); + snprintf( sql+sql_len, sizeof(sql)-sql_len, "( %llu, %d, from_unixtime(%ld), %s%ld.%02ld ), ", id, frames, timestamps[i]->tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec ); frameCount++; } @@ -465,7 +479,7 @@ void Event::AddPacket( ZMPacket *packet, int score, Image *alarm_image ) { have_video_keyframe = have_video_keyframe || ( ( packet->codec_type == AVMEDIA_TYPE_VIDEO ) && packet->keyframe ); if ( videoStore ) { if ( have_video_keyframe ) { - videoStore->writePacket( packet ); + videoStore->writePacket(packet); } else { Debug(2, "No video keyframe yet, not writing"); } @@ -474,7 +488,7 @@ void Event::AddPacket( ZMPacket *packet, int score, Image *alarm_image ) { Debug(2,"AddPacket but no videostore?!"); } if ( have_video_keyframe && ( packet->codec_type == AVMEDIA_TYPE_VIDEO ) ) { - AddFrame( packet->image, *packet->timestamp, score, alarm_image ); + AddFrame(packet->image, *packet->timestamp, score, alarm_image); } // end if is video return; } @@ -514,28 +528,23 @@ void Event::AddFrame( Image *image, struct timeval timestamp, int score, Image * bool db_frame = ( frame_type != BULK ) || ((frames%config.bulk_frame_interval)==0) || !frames; if ( db_frame ) { - Debug( 1, "Adding frame %d of type \"%s\" to DB", frames, Event::frame_type_names[frame_type] ); + Debug(1, "Adding frame %d of type \"%s\" to DB", frames, Event::frame_type_names[frame_type]); static char sql[ZM_SQL_MED_BUFSIZ]; - snprintf( sql, sizeof(sql), "INSERT INTO Frames ( EventId, FrameId, Type, TimeStamp, Delta, Score ) VALUES ( %d, %d, '%s', from_unixtime( %ld ), %s%ld.%02ld, %d )", id, frames, frame_type_names[frame_type], timestamp.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec, score ); + snprintf(sql, sizeof(sql), "INSERT INTO Frames ( EventId, FrameId, Type, TimeStamp, Delta, Score ) values ( %llu, %d, '%s', from_unixtime( %ld ), %s%ld.%02ld, %d )", id, frames, frame_type_names[frame_type], timestamp.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec, score); db_mutex.lock(); if ( mysql_query(&dbconn, sql) ) { - Error("Can't insert frame: (%s) reason:%s", sql, mysql_error(&dbconn)); - zmDbClose(); - if ( ! zmDbConnect() ) { - Error("Unable to connect to db"); - exit(mysql_errno(&dbconn)); - } - if ( mysql_query(&dbconn, sql) ) { - Error("REALLY Can't insert frame: (%s) reason:%s", sql, mysql_error(&dbconn)); - exit(mysql_errno(&dbconn)); - } + Error("Can't insert frame: %s", mysql_error(&dbconn)); + Error("SQL was %s", sql); + db_mutex.unlock(); + return; } db_mutex.unlock(); last_db_frame = frames; // We are writing a Bulk frame if ( frame_type == BULK ) { - snprintf( sql, sizeof(sql), "update Events set Length = %s%ld.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d where Id = %d", + snprintf( sql, sizeof(sql), + "UPDATE Events SET Length = %s%ld.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d where Id = %llu", ( delta_time.positive?"":"-" ), delta_time.sec, delta_time.fsec, frames, @@ -546,8 +555,11 @@ void Event::AddFrame( Image *image, struct timeval timestamp, int score, Image * id ); db_mutex.lock(); - if ( mysql_query( &dbconn, sql ) ) { - Error( "Can't update event: %s", mysql_error( &dbconn ) ); + while ( mysql_query(&dbconn, sql) ) { + Error("Can't update event: %s", mysql_error(&dbconn)); + db_mutex.unlock(); + sleep(1); + db_mutex.lock(); } db_mutex.unlock(); } @@ -564,9 +576,9 @@ void Event::AddFrame( Image *image, struct timeval timestamp, int score, Image * max_score = score; if ( alarm_image ) { - snprintf( event_file, sizeof(event_file), staticConfig.analyse_file_format, path, frames ); + snprintf(event_file, sizeof(event_file), staticConfig.analyse_file_format, path, frames); - Debug( 1, "Writing analysis frame %d", frames ); + Debug(1, "Writing analysis frame %d", frames); if ( monitor->GetOptSaveJPEGs() & 2 ) { WriteFrameImage(alarm_image, timestamp, event_file, true); } diff --git a/src/zm_event.h b/src/zm_event.h index b513eae99..3e47f6886 100644 --- a/src/zm_event.h +++ b/src/zm_event.h @@ -75,7 +75,7 @@ class Event { static int pre_alarm_count; static PreAlarmData pre_alarm_data[MAX_PRE_ALARM_FRAMES]; - unsigned int id; + unsigned long long int id; Monitor *monitor; struct timeval start_time; struct timeval end_time; @@ -85,15 +85,15 @@ class Event { int alarm_frames; unsigned int tot_score; unsigned int max_score; - char path[PATH_MAX]; + std::string path; VideoStore *videoStore; char video_name[64]; char video_file[PATH_MAX]; int last_db_frame; bool have_video_keyframe; // a flag to tell us if we have had a video keyframe when writing an mp4. The first frame SHOULD be a video keyframe. + Storage::Schemes scheme; void createNotes( std::string ¬es ); - Storage::Schemes scheme; public: static bool OpenFrameSocket( int ); @@ -102,15 +102,15 @@ class Event { Event( Monitor *p_monitor, struct timeval p_start_time, const std::string &p_cause, const StringSetMap &p_noteSetMap ); ~Event(); - int Id() const { return( id ); } - const std::string &Cause() { return( cause ); } - int Frames() const { return( frames ); } - int AlarmFrames() const { return( alarm_frames ); } + unsigned long long int Id() const { return id; } + const std::string &Cause() { return cause; } + int Frames() const { return frames; } + int AlarmFrames() const { return alarm_frames; } - const struct timeval &StartTime() const { return( start_time ); } - const struct timeval &EndTime() const { return( end_time ); } - struct timeval &StartTime() { return( start_time ); } - struct timeval &EndTime() { return( end_time ); } + const struct timeval &StartTime() const { return start_time; } + const struct timeval &EndTime() const { return end_time; } + struct timeval &StartTime() { return start_time; } + struct timeval &EndTime() { return end_time; } bool SendFrameImage( const Image *image, bool alarm_frame=false ); bool WriteFrameImage( Image *image, struct timeval timestamp, const char *event_file, bool alarm_frame=false ); @@ -132,7 +132,7 @@ class Event { return( subpath ); } static const char *getSubPath( time_t *time ) { - return( Event::getSubPath( localtime( time ) ) ); + return Event::getSubPath( localtime( time ) ); } char* getEventFile(void) { @@ -141,7 +141,7 @@ class Event { public: static int PreAlarmCount() { - return( pre_alarm_count ); + return pre_alarm_count; } static void EmptyPreAlarmFrames() { if ( pre_alarm_count > 0 ) { diff --git a/src/zm_eventstream.cpp b/src/zm_eventstream.cpp index c475493fc..319399bef 100644 --- a/src/zm_eventstream.cpp +++ b/src/zm_eventstream.cpp @@ -43,30 +43,30 @@ bool EventStream::loadInitialEventData( int monitor_id, time_t event_time ) { static char sql[ZM_SQL_SML_BUFSIZ]; - snprintf( sql, sizeof(sql), "select Id from Events where MonitorId = %d and unix_timestamp( EndTime ) > %ld order by Id asc limit 1", monitor_id, event_time ); + snprintf(sql, sizeof(sql), "SELECT Id FROM Events WHERE MonitorId = %d AND unix_timestamp(EndTime) > %ld ORDER BY Id ASC LIMIT 1", monitor_id, event_time); - if ( mysql_query( &dbconn, sql ) ) { - Error( "Can't run query: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); + if ( mysql_query(&dbconn, sql) ) { + Error("Can't run query: %s", mysql_error(&dbconn)); + exit(mysql_errno(&dbconn)); } - MYSQL_RES *result = mysql_store_result( &dbconn ); + MYSQL_RES *result = mysql_store_result(&dbconn); if ( !result ) { - Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + Error("Can't use query result: %s", mysql_error(&dbconn)); exit( mysql_errno( &dbconn ) ); } - MYSQL_ROW dbrow = mysql_fetch_row( result ); + MYSQL_ROW dbrow = mysql_fetch_row(result); - if ( mysql_errno( &dbconn ) ) { - Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); + if ( mysql_errno(&dbconn) ) { + Error("Can't fetch row: %s", mysql_error(&dbconn)); + exit( mysql_errno(&dbconn)); } - int init_event_id = atoi( dbrow[0] ); + unsigned long long init_event_id = atoll(dbrow[0]); - mysql_free_result( result ); + mysql_free_result(result); - loadEventData( init_event_id ); + loadEventData(init_event_id); if ( event_time ) { curr_stream_time = event_time; @@ -84,47 +84,52 @@ bool EventStream::loadInitialEventData( int monitor_id, time_t event_time ) { Debug( 3, "Skipping %ld frames", event_data->frame_count ); } } - return( true ); + return true; } -bool EventStream::loadInitialEventData( int init_event_id, unsigned int init_frame_id ) { - loadEventData( init_event_id ); +bool EventStream::loadInitialEventData( unsigned long long init_event_id, unsigned int init_frame_id ) { + loadEventData(init_event_id); if ( init_frame_id ) { - curr_stream_time = event_data->frames[init_frame_id-1].timestamp; - curr_frame_id = init_frame_id; + if ( init_frame_id >= event_data->frame_count ) { + Error("Invalid frame id specified. %d > %d", init_frame_id, event_data->frame_count ); + curr_stream_time = event_data->start_time; + } else { + curr_stream_time = event_data->frames[init_frame_id-1].timestamp; + curr_frame_id = init_frame_id; + } } else { curr_stream_time = event_data->start_time; } - return( true ); + return true; } -bool EventStream::loadEventData( int event_id ) { +bool EventStream::loadEventData(unsigned long long event_id) { static char sql[ZM_SQL_MED_BUFSIZ]; - snprintf( sql, sizeof(sql), "SELECT MonitorId, StorageId, Frames, unix_timestamp( StartTime ) AS StartTimestamp, (SELECT max(Delta)-min(Delta) FROM Frames WHERE EventId=Events.Id) AS Duration, DefaultVideo, Scheme FROM Events WHERE Id = %d", event_id ); + snprintf(sql, sizeof(sql), "SELECT MonitorId, StorageId, Frames, unix_timestamp( StartTime ) AS StartTimestamp, (SELECT max(Delta)-min(Delta) FROM Frames WHERE EventId=Events.Id) AS Duration, DefaultVideo, Scheme FROM Events WHERE Id = %llu", event_id); - if ( mysql_query( &dbconn, sql ) ) { - Error( "Can't run query: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); + if ( mysql_query(&dbconn, sql) ) { + Error("Can't run query: %s", mysql_error(&dbconn)); + exit(mysql_errno(&dbconn)); } - MYSQL_RES *result = mysql_store_result( &dbconn ); + MYSQL_RES *result = mysql_store_result(&dbconn); if ( !result ) { - Error( "Can't use query result: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); + Error("Can't use query result: %s", mysql_error(&dbconn)); + exit(mysql_errno(&dbconn)); } - if ( !mysql_num_rows( result ) ) { - Fatal( "Unable to load event %d, not found in DB", event_id ); + if ( !mysql_num_rows(result) ) { + Fatal("Unable to load event %d, not found in DB", event_id); } - MYSQL_ROW dbrow = mysql_fetch_row( result ); + MYSQL_ROW dbrow = mysql_fetch_row(result); - if ( mysql_errno( &dbconn ) ) { - Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); + if ( mysql_errno(&dbconn) ) { + Error("Can't fetch row: %s", mysql_error(&dbconn)); + exit(mysql_errno(&dbconn)); } delete event_data; @@ -147,50 +152,53 @@ bool EventStream::loadEventData( int event_id ) { } mysql_free_result( result ); - Storage * storage = new Storage( event_data->storage_id ); + Storage * storage = new Storage(event_data->storage_id); const char *storage_path = storage->Path(); if ( event_data->scheme == Storage::DEEP ) { - struct tm *event_time = localtime( &event_data->start_time ); + struct tm *event_time = localtime(&event_data->start_time); if ( storage_path[0] == '/' ) - snprintf( event_data->path, sizeof(event_data->path), "%s/%ld/%02d/%02d/%02d/%02d/%02d/%02d", storage_path, event_data->monitor_id, event_time->tm_year-100, event_time->tm_mon+1, event_time->tm_mday, event_time->tm_hour, event_time->tm_min, event_time->tm_sec ); + snprintf( event_data->path, sizeof(event_data->path), "%s/%ld/%02d/%02d/%02d/%02d/%02d/%02d", + storage_path, event_data->monitor_id, event_time->tm_year-100, event_time->tm_mon+1, event_time->tm_mday, event_time->tm_hour, event_time->tm_min, event_time->tm_sec ); else - snprintf( event_data->path, sizeof(event_data->path), "%s/%s/%ld/%02d/%02d/%02d/%02d/%02d/%02d", staticConfig.PATH_WEB.c_str(), storage_path, event_data->monitor_id, event_time->tm_year-100, event_time->tm_mon+1, event_time->tm_mday, event_time->tm_hour, event_time->tm_min, event_time->tm_sec ); + snprintf( event_data->path, sizeof(event_data->path), "%s/%s/%ld/%02d/%02d/%02d/%02d/%02d/%02d", + staticConfig.PATH_WEB.c_str(), storage_path, event_data->monitor_id, event_time->tm_year-100, event_time->tm_mon+1, event_time->tm_mday, event_time->tm_hour, event_time->tm_min, event_time->tm_sec ); } else if ( event_data->scheme == Storage::MEDIUM ) { struct tm *event_time = localtime( &event_data->start_time ); if ( storage_path[0] == '/' ) - snprintf( event_data->path, sizeof(event_data->path), "%s/%ld/%04d-%02d-%02d/%ld", + snprintf( event_data->path, sizeof(event_data->path), "%s/%ld/%04d-%02d-%02d/%llu", storage_path, event_data->monitor_id, event_time->tm_year+1900, event_time->tm_mon+1, event_time->tm_mday, event_data->event_id ); else - snprintf( event_data->path, sizeof(event_data->path), "%s/%s/%ld/%04d-%02d-%02d/%ld", + snprintf( event_data->path, sizeof(event_data->path), "%s/%s/%ld/%04d-%02d-%02d/%llu", staticConfig.PATH_WEB.c_str(), storage_path, event_data->monitor_id, event_time->tm_year+1900, event_time->tm_mon+1, event_time->tm_mday, event_data->event_id ); } else { if ( storage_path[0] == '/' ) - snprintf( event_data->path, sizeof(event_data->path), "%s/%ld/%ld", storage_path, event_data->monitor_id, event_data->event_id ); + snprintf( event_data->path, sizeof(event_data->path), "%s/%ld/%llu", + storage_path, event_data->monitor_id, event_data->event_id ); else - snprintf( event_data->path, sizeof(event_data->path), "%s/%s/%ld/%ld", staticConfig.PATH_WEB.c_str(), storage_path, event_data->monitor_id, event_data->event_id ); + snprintf( event_data->path, sizeof(event_data->path), "%s/%s/%ld/%llu", + staticConfig.PATH_WEB.c_str(), storage_path, event_data->monitor_id, event_data->event_id ); } delete storage; storage = NULL; updateFrameRate( (double)event_data->frame_count/event_data->duration ); - - snprintf( sql, sizeof(sql), "select FrameId, unix_timestamp( `TimeStamp` ), Delta from Frames where EventId = %d order by FrameId asc", event_id ); - if ( mysql_query( &dbconn, sql ) ) { - Error( "Can't run query: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); + snprintf(sql, sizeof(sql), "SELECT FrameId, unix_timestamp( `TimeStamp` ), Delta FROM Frames where EventId = %llu ORDER BY FrameId ASC", event_id); + if ( mysql_query(&dbconn, sql) ) { + Error("Can't run query: %s", mysql_error(&dbconn)); + exit(mysql_errno(&dbconn)); } - result = mysql_store_result( &dbconn ); + result = mysql_store_result(&dbconn); if ( !result ) { - Error( "Can't use query result: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); + Error("Can't use query result: %s", mysql_error(&dbconn)); + exit(mysql_errno(&dbconn)); } - event_data->n_frames = mysql_num_rows( result ); + event_data->n_frames = mysql_num_rows(result); event_data->frames = new FrameData[event_data->frame_count]; int last_id = 0; @@ -223,7 +231,7 @@ bool EventStream::loadEventData( int event_id ) { exit( mysql_errno( &dbconn ) ); } - mysql_free_result( result ); + mysql_free_result(result); //for ( int i = 0; i < 250; i++ ) //{ //Info( "%d -> %d @ %f (%d)", i+1, event_data->frames[i].timestamp, event_data->frames[i].delta, event_data->frames[i].in_db ); @@ -231,33 +239,31 @@ bool EventStream::loadEventData( int event_id ) { if ( event_data->video_file[0] ) { char filepath[PATH_MAX]; - snprintf( filepath, sizeof(filepath), "%s/%s", event_data->path, event_data->video_file ); + snprintf(filepath, sizeof(filepath), "%s/%s", event_data->path, event_data->video_file); ffmpeg_input = new FFmpeg_Input(); if ( 0 > ffmpeg_input->Open( filepath ) ) { - Warning("Unable to open ffmpeg_input %s/%s", event_data->path, event_data->video_file ); + Warning("Unable to open ffmpeg_input %s/%s", event_data->path, event_data->video_file); delete ffmpeg_input; ffmpeg_input = NULL; } } - if ( forceEventChange || mode == MODE_ALL_GAPLESS ) { if ( replay_rate > 0 ) curr_stream_time = event_data->frames[0].timestamp; else curr_stream_time = event_data->frames[event_data->frame_count-1].timestamp; } - Debug( 2, "Event:%ld, Frames:%ld, Duration: %.2f", event_data->event_id, event_data->frame_count, event_data->duration ); + Debug(2, "Event:%llu, Frames:%ld, Duration: %.2f", event_data->event_id, event_data->frame_count, event_data->duration); - return( true ); + return true; } // bool EventStream::loadEventData( int event_id ) -void EventStream::processCommand( const CmdMsg *msg ) { - Debug( 2, "Got message, type %d, msg %d", msg->msg_type, msg->msg_data[0] ); +void EventStream::processCommand(const CmdMsg *msg) { + Debug(2, "Got message, type %d, msg %d", msg->msg_type, msg->msg_data[0]); // Check for incoming command switch( (MsgCommand)msg->msg_data[0] ) { case CMD_PAUSE : - { Debug( 1, "Got PAUSE command" ); // Set paused flag @@ -265,12 +271,9 @@ void EventStream::processCommand( const CmdMsg *msg ) { replay_rate = ZM_RATE_BASE; last_frame_sent = TV_2_FLOAT( now ); break; - } case CMD_PLAY : - { Debug( 1, "Got PLAY command" ); if ( paused ) { - // Clear paused flag paused = false; } @@ -284,30 +287,20 @@ void EventStream::processCommand( const CmdMsg *msg ) { replay_rate = ZM_RATE_BASE; break; - } case CMD_VARPLAY : - { Debug( 1, "Got VARPLAY command" ); if ( paused ) { - // Clear paused flag paused = false; } replay_rate = ntohs(((unsigned char)msg->msg_data[2]<<8)|(unsigned char)msg->msg_data[1])-32768; break; - } case CMD_STOP : - { Debug( 1, "Got STOP command" ); - - // Clear paused flag paused = false; break; - } case CMD_FASTFWD : - { Debug( 1, "Got FAST FWD command" ); if ( paused ) { - // Clear paused flag paused = false; } // Set play rate @@ -330,36 +323,21 @@ void EventStream::processCommand( const CmdMsg *msg ) { break; } break; - } case CMD_SLOWFWD : - { Debug( 1, "Got SLOW FWD command" ); - // Set paused flag paused = true; - // Set play rate replay_rate = ZM_RATE_BASE; - // Set step step = 1; break; - } case CMD_SLOWREV : - { Debug( 1, "Got SLOW REV command" ); - // Set paused flag paused = true; - // Set play rate replay_rate = ZM_RATE_BASE; - // Set step step = -1; break; - } case CMD_FASTREV : - { Debug( 1, "Got FAST REV command" ); - if ( paused ) { - // Clear paused flag - paused = false; - } + paused = false; // Set play rate switch ( replay_rate ) { case -2 * ZM_RATE_BASE : @@ -380,9 +358,7 @@ void EventStream::processCommand( const CmdMsg *msg ) { break; } break; - } case CMD_ZOOMIN : - { x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; Debug( 1, "Got ZOOM IN command, to %d,%d", x, y ); @@ -406,10 +382,7 @@ void EventStream::processCommand( const CmdMsg *msg ) { } send_frame = true; break; - - } case CMD_ZOOMOUT : - { Debug( 1, "Got ZOOM OUT command" ); switch ( zoom ) { case 500: @@ -431,22 +404,16 @@ void EventStream::processCommand( const CmdMsg *msg ) { } send_frame = true; break; - } case CMD_PAN : - { x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; Debug( 1, "Got PAN command, to %d,%d", x, y ); break; - } case CMD_SCALE : - { scale = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; Debug( 1, "Got SCALE command, to %d", scale ); break; - } case CMD_PREV : - { Debug( 1, "Got PREV command" ); if ( replay_rate >= 0 ) curr_frame_id = 0; @@ -455,9 +422,7 @@ void EventStream::processCommand( const CmdMsg *msg ) { paused = false; forceEventChange = true; break; - } case CMD_NEXT : - { Debug( 1, "Got NEXT command" ); if ( replay_rate >= 0 ) curr_frame_id = event_data->frame_count+1; @@ -466,7 +431,6 @@ void EventStream::processCommand( const CmdMsg *msg ) { paused = false; forceEventChange = true; break; - } case CMD_SEEK : { int offset = ((unsigned char)msg->msg_data[1]<<24)|((unsigned char)msg->msg_data[2]<<16)|((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; @@ -476,35 +440,30 @@ void EventStream::processCommand( const CmdMsg *msg ) { break; } case CMD_QUERY : - { Debug( 1, "Got QUERY command, sending STATUS" ); break; - } case CMD_QUIT : - { - Info ("User initiated exit - CMD_QUIT"); + Info("User initiated exit - CMD_QUIT"); break; - } default : - { // Do nothing, for now - } + break; } struct { - int event; + unsigned long long event_id; int progress; int rate; int zoom; bool paused; } status_data; - status_data.event = event_data->event_id; + status_data.event_id = event_data->event_id; status_data.progress = (int)event_data->frames[curr_frame_id-1].offset; status_data.rate = replay_rate; status_data.zoom = zoom; status_data.paused = paused; - Debug( 2, "Event:%d, Paused:%d, progress:%d Rate:%d, Zoom:%d", - status_data.event, + Debug( 2, "Event:%llu, Paused:%d, progress:%d Rate:%d, Zoom:%d", + status_data.event_id, status_data.paused, status_data.progress, status_data.rate, @@ -513,19 +472,19 @@ void EventStream::processCommand( const CmdMsg *msg ) { DataMsg status_msg; status_msg.msg_type = MSG_DATA_EVENT; - memcpy( &status_msg.msg_data, &status_data, sizeof(status_data) ); - if ( sendto( sd, &status_msg, sizeof(status_msg), MSG_DONTWAIT, (sockaddr *)&rem_addr, sizeof(rem_addr) ) < 0 ) { + memcpy(&status_msg.msg_data, &status_data, sizeof(status_data)); + if ( sendto(sd, &status_msg, sizeof(status_msg), MSG_DONTWAIT, (sockaddr *)&rem_addr, sizeof(rem_addr)) < 0 ) { //if ( errno != EAGAIN ) { - Error( "Can't sendto on sd %d: %s", sd, strerror(errno) ); - exit( -1 ); + Error("Can't sendto on sd %d: %s", sd, strerror(errno)); + exit(-1); } } // quit after sending a status, if this was a quit request - if ((MsgCommand)msg->msg_data[0]==CMD_QUIT) + if ( (MsgCommand)msg->msg_data[0]==CMD_QUIT ) exit(0); - updateFrameRate( (double)event_data->frame_count/event_data->duration ); + updateFrameRate((double)event_data->frame_count/event_data->duration); } void EventStream::checkEventLoaded() { @@ -533,10 +492,10 @@ void EventStream::checkEventLoaded() { static char sql[ZM_SQL_SML_BUFSIZ]; if ( curr_frame_id <= 0 ) { - snprintf( sql, sizeof(sql), "select Id from Events where MonitorId = %ld and Id < %ld order by Id desc limit 1", event_data->monitor_id, event_data->event_id ); + snprintf( sql, sizeof(sql), "SELECT Id FROM Events WHERE MonitorId = %ld AND Id < %llu ORDER BY Id DESC LIMIT 1", event_data->monitor_id, event_data->event_id ); reload_event = true; } else if ( (unsigned int)curr_frame_id > event_data->frame_count ) { - snprintf( sql, sizeof(sql), "select Id from Events where MonitorId = %ld and Id > %ld order by Id asc limit 1", event_data->monitor_id, event_data->event_id ); + snprintf( sql, sizeof(sql), "SELECT Id FROM Events WHERE MonitorId = %ld AND Id > %llu ORDER BY Id ASC LIMIT 1", event_data->monitor_id, event_data->event_id ); reload_event = true; } @@ -561,10 +520,10 @@ void EventStream::checkEventLoaded() { } if ( dbrow ) { - int event_id = atoi(dbrow[0]); - Debug( 1, "Loading new event %d", event_id ); + unsigned long long event_id = atoll(dbrow[0]); + Debug( 1, "Loading new event %llu", event_id ); - loadEventData( event_id ); + loadEventData(event_id); Debug( 2, "Current frame id = %d", curr_frame_id ); if ( replay_rate < 0 ) @@ -594,14 +553,15 @@ void EventStream::checkEventLoaded() { Image * EventStream::getImage( ) { static char filepath[PATH_MAX]; - Debug( 2, "EventStream::getImage path(%s) frame(%d)", event_data->path, curr_frame_id ); - snprintf( filepath, sizeof(filepath), staticConfig.capture_file_format, event_data->path, curr_frame_id ); - Image *image = new Image( filepath ); + Debug(2, "EventStream::getImage path(%s) frame(%d)", event_data->path, curr_frame_id); + snprintf( filepath, sizeof(filepath), staticConfig.capture_file_format, event_data->path, curr_frame_id); + Debug(2, "EventStream::getImage path(%s) ", filepath, curr_frame_id); + Image *image = new Image(filepath); return image; } -bool EventStream::sendFrame( int delta_us ) { - Debug( 2, "Sending frame %d", curr_frame_id ); +bool EventStream::sendFrame(int delta_us) { + Debug(2, "Sending frame %d", curr_frame_id); static char filepath[PATH_MAX]; static struct stat filestat; @@ -626,13 +586,14 @@ bool EventStream::sendFrame( int delta_us ) { #if HAVE_LIBAVCODEC if ( type == STREAM_MPEG ) { +Debug(2,"Streaming MPEG"); Image image( filepath ); - Image *send_image = prepareImage( &image ); + Image *send_image = prepareImage(&image); if ( !vid_stream ) { - vid_stream = new VideoStream( "pipe:", format, bitrate, effective_fps, send_image->Colours(), send_image->SubpixelOrder(), send_image->Width(), send_image->Height() ); - fprintf( stdout, "Content-type: %s\r\n\r\n", vid_stream->MimeType() ); + vid_stream = new VideoStream("pipe:", format, bitrate, effective_fps, send_image->Colours(), send_image->SubpixelOrder(), send_image->Width(), send_image->Height()); + fprintf(stdout, "Content-type: %s\r\n\r\n", vid_stream->MimeType()); vid_stream->OpenStream(); } /* double pts = */ vid_stream->EncodeFrame( send_image->Buffer(), send_image->Size(), config.mpeg_timed_frames, delta_us*1000 ); @@ -648,34 +609,35 @@ bool EventStream::sendFrame( int delta_us ) { fprintf( stdout, "--ZoneMinderFrame\r\n" ); - if ( type != STREAM_JPEG ) + if ( (type != STREAM_JPEG) || (!filepath[0]) ) send_raw = false; if ( send_raw ) { - fdj = fopen( filepath, "rb" ); + fdj = fopen(filepath, "rb"); if ( !fdj ) { - Error( "Can't open %s: %s", filepath, strerror(errno) ); - return( false ); + Error("Can't open %s: %s", filepath, strerror(errno)); + return false; } #if HAVE_SENDFILE if( fstat(fileno(fdj),&filestat) < 0 ) { Error( "Failed getting information about file %s: %s", filepath, strerror(errno) ); - return( false ); + return false; } #else - img_buffer_size = fread( img_buffer, 1, sizeof(temp_img_buffer), fdj ); + img_buffer_size = fread(img_buffer, 1, sizeof(temp_img_buffer), fdj); #endif } else { Image *image = NULL; if ( filepath[0] ) { - image = new Image( filepath ); +Debug(1, "Loading image"); + image = new Image(filepath); } else if ( ffmpeg_input ) { // Get the frame from the mp4 input Debug(1,"Getting frame from ffmpeg"); AVFrame *frame = ffmpeg_input->get_frame( ffmpeg_input->get_video_stream_id(), curr_frame_id ); if ( frame ) { - image = new Image( frame ); + image = new Image(frame); av_frame_free(&frame); } else { Error("Failed getting a frame."); @@ -686,16 +648,16 @@ bool EventStream::sendFrame( int delta_us ) { return false; } - Image *send_image = prepareImage( image ); + Image *send_image = prepareImage(image); switch( type ) { case STREAM_JPEG : - send_image->EncodeJpeg( img_buffer, &img_buffer_size ); + send_image->EncodeJpeg(img_buffer, &img_buffer_size); break; case STREAM_ZIP : #if HAVE_ZLIB_H unsigned long zip_buffer_size; - send_image->Zip( img_buffer, &zip_buffer_size ); + send_image->Zip(img_buffer, &zip_buffer_size); img_buffer_size = zip_buffer_size; break; #else @@ -716,16 +678,16 @@ bool EventStream::sendFrame( int delta_us ) { switch( type ) { case STREAM_JPEG : - fprintf( stdout, "Content-Type: image/jpeg\r\n" ); + fputs( "Content-Type: image/jpeg\r\n", stdout ); break; case STREAM_RAW : - fprintf( stdout, "Content-Type: image/x-rgb\r\n" ); + fputs( "Content-Type: image/x-rgb\r\n", stdout ); break; case STREAM_ZIP : - fprintf( stdout, "Content-Type: image/x-rgbz\r\n" ); + fputs( "Content-Type: image/x-rgbz\r\n", stdout ); break; default : - Fatal( "Unexpected frame type %d", type ); + Fatal("Unexpected frame type %d", type); break; } @@ -759,11 +721,11 @@ bool EventStream::sendFrame( int delta_us ) { } } - fprintf( stdout, "\r\n\r\n" ); - fflush( stdout ); + fputs("\r\n\r\n", stdout); + fflush(stdout); } - last_frame_sent = TV_2_FLOAT( now ); - return( true ); + last_frame_sent = TV_2_FLOAT(now); + return true; } void EventStream::runStream() { @@ -772,20 +734,19 @@ void EventStream::runStream() { checkInitialised(); - if ( type == STREAM_JPEG ) - fprintf( stdout, "Content-Type: multipart/x-mixed-replace;boundary=ZoneMinderFrame\r\n\r\n" ); + fputs("Content-Type: multipart/x-mixed-replace;boundary=ZoneMinderFrame\r\n\r\n", stdout); if ( !event_data ) { - sendTextFrame( "No event data found" ); - exit( 0 ); + sendTextFrame("No event data found"); + exit(0); } - Debug(3, "frame rate is: (%f)", (double)event_data->frame_count/event_data->duration ); - updateFrameRate( (double)event_data->frame_count/event_data->duration ); + Debug(3, "frame rate is: (%f)", (double)event_data->frame_count/event_data->duration); + updateFrameRate((double)event_data->frame_count/event_data->duration); while( !zm_terminate ) { - gettimeofday( &now, NULL ); + gettimeofday(&now, NULL); unsigned int delta_us = 0; send_frame = false; @@ -818,11 +779,11 @@ void EventStream::runStream() { in_event = false; } if ( !in_event ) { - double actual_delta_time = TV_2_FLOAT( now ) - last_frame_sent; + double actual_delta_time = TV_2_FLOAT(now) - last_frame_sent; if ( actual_delta_time > 1 ) { static char frame_text[64]; - snprintf( frame_text, sizeof(frame_text), "Time to next event = %d seconds", (int)time_to_event ); - if ( !sendTextFrame( frame_text ) ) + snprintf(frame_text, sizeof(frame_text), "Time to next event = %d seconds", (int)time_to_event); + if ( !sendTextFrame(frame_text) ) zm_terminate = true; } //else @@ -851,16 +812,16 @@ void EventStream::runStream() { send_frame = true; } else if ( !send_frame ) { // We are paused, and doing nothing - double actual_delta_time = TV_2_FLOAT( now ) - last_frame_sent; + double actual_delta_time = TV_2_FLOAT(now) - last_frame_sent; if ( actual_delta_time > MAX_STREAM_DELAY ) { // Send keepalive - Debug( 2, "Sending keepalive frame" ); + Debug(2, "Sending keepalive frame"); send_frame = true; } } if ( send_frame ) - if ( !sendFrame( delta_us ) ) + if ( !sendFrame(delta_us) ) zm_terminate = true; curr_stream_time = frame_data->timestamp; @@ -885,3 +846,17 @@ void EventStream::runStream() { closeComms(); } +void EventStream::setStreamStart( unsigned long long init_event_id, unsigned int init_frame_id=0 ) { + loadInitialEventData( init_event_id, init_frame_id ); + if ( !(monitor = Monitor::Load( event_data->monitor_id, false, Monitor::QUERY )) ) { + Fatal( "Unable to load monitor id %d for streaming", event_data->monitor_id ); + return; + } +} +void EventStream::setStreamStart( int monitor_id, time_t event_time ) { + loadInitialEventData(monitor_id, event_time); + if ( !(monitor = Monitor::Load(event_data->monitor_id, false, Monitor::QUERY)) ) { + Fatal("Unable to load monitor id %d for streaming", monitor_id); + return; + } +} diff --git a/src/zm_eventstream.h b/src/zm_eventstream.h index 02e90f70a..37feafafe 100644 --- a/src/zm_eventstream.h +++ b/src/zm_eventstream.h @@ -54,7 +54,7 @@ class EventStream : public StreamBase { }; struct EventData { - unsigned long event_id; + unsigned long long event_id; unsigned long monitor_id; unsigned long storage_id; unsigned long frame_count; @@ -83,8 +83,8 @@ class EventStream : public StreamBase { FFmpeg_Input *ffmpeg_input; protected: - bool loadEventData( int event_id ); - bool loadInitialEventData( int init_event_id, unsigned int init_frame_id ); + bool loadEventData( unsigned long long event_id ); + bool loadInitialEventData( unsigned long long init_event_id, unsigned int init_frame_id ); bool loadInitialEventData( int monitor_id, time_t event_time ); void checkEventLoaded(); @@ -110,20 +110,8 @@ class EventStream : public StreamBase { ffmpeg_input = NULL; } - void setStreamStart( int init_event_id, unsigned int init_frame_id=0 ) { - loadInitialEventData( init_event_id, init_frame_id ); - if ( !(monitor = Monitor::Load( event_data->monitor_id, false, Monitor::QUERY )) ) { - Fatal( "Unable to load monitor id %d for streaming", event_data->monitor_id ); - return; - } - } - void setStreamStart( int monitor_id, time_t event_time ) { - loadInitialEventData( monitor_id, event_time ); - if ( !(monitor = Monitor::Load( event_data->monitor_id, false, Monitor::QUERY )) ) { - Fatal( "Unable to load monitor id %d for streaming", monitor_id ); - return; - } - } + void setStreamStart( unsigned long long init_event_id, unsigned int init_frame_id ); + void setStreamStart( int monitor_id, time_t event_time ); void setStreamMode( StreamMode p_mode ) { mode = p_mode; } diff --git a/src/zm_ffmpeg.cpp b/src/zm_ffmpeg.cpp index 77e3c90aa..997e71b35 100644 --- a/src/zm_ffmpeg.cpp +++ b/src/zm_ffmpeg.cpp @@ -243,7 +243,7 @@ void zm_dump_codecpar ( const AVCodecParameters *par ) { } #endif -void zm_dump_codec ( const AVCodecContext *codec ) { +void zm_dump_codec(const AVCodecContext *codec) { Debug(1, "Dumping codec_context codec_type(%d) codec_id(%d) width(%d) height(%d) timebase(%d/%d) format(%s)", codec->codec_type, codec->codec_id, @@ -425,7 +425,7 @@ int zm_receive_frame( AVCodecContext *context, AVFrame *frame, AVPacket &packet #endif # else - int frameComplete; + int frameComplete = 0; while ( !frameComplete ) { if ( (ret = zm_avcodec_decode_video( context, frame, &frameComplete, &packet )) < 0 ) { Error( "Unable to decode frame at frame: %s, continuing", @@ -436,6 +436,7 @@ int zm_receive_frame( AVCodecContext *context, AVFrame *frame, AVPacket &packet #endif return 1; } // end int zm_receive_frame( AVCodecContext *context, AVFrame *frame, AVPacket &packet ) + void dumpPacket(AVPacket *pkt, const char *text) { char b[10240]; diff --git a/src/zm_ffmpeg.h b/src/zm_ffmpeg.h index 7e3cf9651..ab214204d 100644 --- a/src/zm_ffmpeg.h +++ b/src/zm_ffmpeg.h @@ -300,11 +300,11 @@ void zm_dump_codecpar ( const AVCodecParameters *par ); #endif #if LIBAVCODEC_VERSION_CHECK(56, 8, 0, 60, 100) - #define zm_av_packet_unref( packet ) av_packet_unref( packet ) - #define zm_av_packet_ref( dst, src ) av_packet_ref( dst, src ) + #define zm_av_packet_unref(packet) av_packet_unref(packet) + #define zm_av_packet_ref(dst, src) av_packet_ref(dst, src) #else - #define zm_av_packet_unref( packet ) av_free_packet( packet ) -unsigned int zm_av_packet_ref( AVPacket *dst, AVPacket *src ); + #define zm_av_packet_unref(packet) av_free_packet(packet) +unsigned int zm_av_packet_ref(AVPacket *dst, AVPacket *src); #endif #if LIBAVCODEC_VERSION_CHECK(52, 23, 0, 23, 0) #define zm_avcodec_decode_video( context, rawFrame, frameComplete, packet ) avcodec_decode_video2( context, rawFrame, frameComplete, packet ) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 9c0f6a9c9..25c415d10 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Ffmpeg Camera Class Implementation, $Date: 2009-01-16 12:18:50 +0000 (Fri, 16 Jan 2009) $, $Revision: 2713 $ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm.h" @@ -120,12 +120,12 @@ FfmpegCamera::~FfmpegCamera() { int FfmpegCamera::PrimeCapture() { if ( mCanCapture ) { - Info( "Priming capture from %s, CLosing", mPath.c_str() ); + Info("Priming capture from %s, Closing", mPath.c_str()); CloseFfmpeg(); } mVideoStreamId = -1; mAudioStreamId = -1; - Info( "Priming capture from %s", mPath.c_str() ); + Info("Priming capture from %s", mPath.c_str()); return ! OpenFfmpeg(); } @@ -134,7 +134,7 @@ int FfmpegCamera::PreCapture() { return 0; } -int FfmpegCamera::Capture( ZMPacket &zm_packet ) { +int FfmpegCamera::Capture(ZMPacket &zm_packet) { if ( ! mCanCapture ) { return -1; } @@ -143,19 +143,22 @@ int FfmpegCamera::Capture( ZMPacket &zm_packet ) { // If the reopen thread has a value, but mCanCapture != 0, then we have just reopened the connection to the ffmpeg device, and we can clean up the thread. - if ( (ret = av_read_frame( mFormatContext, &packet )) < 0 ) { + if ( (ret = av_read_frame(mFormatContext, &packet)) < 0 ) { if ( // Check if EOF. (ret == AVERROR_EOF || (mFormatContext->pb && mFormatContext->pb->eof_reached)) || // Check for Connection failure. (ret == -110) ) { - Info( "av_read_frame returned \"%s\". Reopening stream.", av_make_error_string(ret).c_str() ); - ReopenFfmpeg(); - return 0; - } - Error( "Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, ret, av_make_error_string(ret).c_str() ); - return -1; + Info("Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, ret, + av_make_error_string(ret).c_str() + ); + } else { + Error("Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, ret, + av_make_error_string(ret).c_str() + ); + } + return -1; } dumpPacket(&packet, "ffmpeg_camera in"); if ( 0 && ( packet.dts < 0 ) ) { @@ -163,8 +166,8 @@ int FfmpegCamera::Capture( ZMPacket &zm_packet ) { return 0; } - zm_packet.set_packet( &packet ); - zm_av_packet_unref( &packet ); + zm_packet.set_packet(&packet); + zm_av_packet_unref(&packet); return 1; } // FfmpegCamera::Capture @@ -175,13 +178,12 @@ int FfmpegCamera::PostCapture() { int FfmpegCamera::OpenFfmpeg() { - Debug(2, "OpenFfmpeg called."); int ret; // Open the input, not necessarily a file #if !LIBAVFORMAT_VERSION_CHECK(53, 2, 0, 4, 0) - Debug ( 1, "Calling av_open_input_file" ); - if ( av_open_input_file( &mFormatContext, mPath.c_str(), NULL, 0, NULL ) != 0 ) + Debug(1, "Calling av_open_input_file"); + if ( av_open_input_file(&mFormatContext, mPath.c_str(), NULL, 0, NULL) != 0 ) #else // Handle options AVDictionary *opts = NULL; @@ -201,27 +203,33 @@ int FfmpegCamera::OpenFfmpeg() { } else if ( method == "rtpRtspHttp" ) { ret = av_dict_set(&opts, "rtsp_transport", "http", 0); } else { - Warning("Unknown method (%s)", method.c_str() ); + Warning("Unknown method (%s)", method.c_str()); } if ( ret < 0 ) { Warning("Could not set rtsp_transport method '%s'\n", method.c_str()); } - Debug ( 1, "Calling avformat_alloc_context for %s", mPath.c_str() ); + Debug(1, "Calling avformat_open_input for %s", mPath.c_str()); - mFormatContext = avformat_alloc_context( ); + //mFormatContext = avformat_alloc_context( ); + // Speed up find_stream_info + //FIXME can speed up initial analysis but need sensible parameters... + //mFormatContext->probesize = 32; + //mFormatContext->max_analyze_duration = 32; - if ( avformat_open_input( &mFormatContext, mPath.c_str(), NULL, &opts ) != 0 ) + if ( avformat_open_input(&mFormatContext, mPath.c_str(), NULL, &opts) != 0 ) #endif { Error("Unable to open input %s due to: %s", mPath.c_str(), strerror(errno)); #if !LIBAVFORMAT_VERSION_CHECK(53, 17, 0, 25, 0) - av_close_input_file( mFormatContext ); + av_close_input_file(mFormatContext); #else - avformat_close_input( &mFormatContext ); + if ( mFormatContext ) { + avformat_close_input(&mFormatContext); + mFormatContext = NULL; + } #endif - mFormatContext = NULL; av_dict_free(&opts); return -1; @@ -229,7 +237,7 @@ int FfmpegCamera::OpenFfmpeg() { AVDictionaryEntry *e = NULL; while ( (e = av_dict_get(opts, "", e, AV_DICT_IGNORE_SUFFIX)) != NULL ) { - Warning( "Option %s not recognized by ffmpeg", e->key); + Warning("Option %s not recognized by ffmpeg", e->key); } av_dict_free(&opts); @@ -237,12 +245,12 @@ int FfmpegCamera::OpenFfmpeg() { Debug(1, "Opened input"); - Info( "Stream open %s, parsing streams...", mPath.c_str() ); + Info("Stream open %s, parsing streams...", mPath.c_str()); #if !LIBAVFORMAT_VERSION_CHECK(53, 6, 0, 6, 0) - if ( av_find_stream_info( mFormatContext ) < 0 ) + if ( av_find_stream_info(mFormatContext) < 0 ) #else - if ( avformat_find_stream_info( mFormatContext, 0 ) < 0 ) + if ( avformat_find_stream_info(mFormatContext, 0) < 0 ) #endif { Error("Unable to find stream info from %s due to: %s", mPath.c_str(), strerror(errno)); @@ -270,7 +278,7 @@ int FfmpegCamera::OpenFfmpeg() { // if we break, then we won't find the audio stream continue; } else { - Debug(2, "Have another video stream." ); + Debug(2, "Have another video stream."); } } #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) @@ -285,14 +293,14 @@ int FfmpegCamera::OpenFfmpeg() { if ( mAudioStreamId == -1 ) { mAudioStreamId = i; } else { - Debug(2, "Have another audio stream." ); + Debug(2, "Have another audio stream."); } } } // end foreach stream if ( mVideoStreamId == -1 ) - Fatal( "Unable to locate video stream in %s", mPath.c_str() ); + Fatal("Unable to locate video stream in %s", mPath.c_str()); if ( mAudioStreamId == -1 ) - Debug( 3, "Unable to locate audio stream in %s", mPath.c_str() ); + Debug(3, "Unable to locate audio stream in %s", mPath.c_str()); Debug(3, "Found video stream at index %d", mVideoStreamId); Debug(3, "Found audio stream at index %d", mAudioStreamId); @@ -319,7 +327,7 @@ int FfmpegCamera::OpenFfmpeg() { if ( ! mVideoCodec ) { // Try to open an hwaccel codec. - if ( (mVideoCodec = avcodec_find_decoder_by_name("h264_vaapi")) == NULL ) { + if ( (mVideoCodec = avcodec_find_decoder_by_name("h264_vaapi")) == NULL ) { Debug(1, "Failed to find decoder (h264_vaapi)" ); } else { Debug(1, "Success finding decoder (h264_vaapi)" ); @@ -327,7 +335,7 @@ int FfmpegCamera::OpenFfmpeg() { } if ( ! mVideoCodec ) { // Try to open an hwaccel codec. - if ( (mVideoCodec = avcodec_find_decoder_by_name("h264_qsv")) == NULL ) { + if ( (mVideoCodec = avcodec_find_decoder_by_name("h264_qsv")) == NULL ) { Debug(1, "Failed to find decoder (h264_qsv)" ); } else { Debug(1, "Success finding decoder (h264_qsv)" ); @@ -347,13 +355,20 @@ int FfmpegCamera::OpenFfmpeg() { } } // end if h264 #endif + if ( mVideoCodecContext->codec_id == AV_CODEC_ID_H264 ) { + if ( (mVideoCodec = avcodec_find_decoder_by_name("h264_mmal")) == NULL ) { + Debug(1, "Failed to find decoder (h264_mmal)" ); + } else { + Debug(1, "Success finding decoder (h264_mmal)" ); + } + } if ( (!mVideoCodec) and ( (mVideoCodec = avcodec_find_decoder(mVideoCodecContext->codec_id)) == NULL ) ) { // Try and get the codec from the codec context Error("Can't find codec for video stream from %s", mPath.c_str()); return -1; } else { - Debug(1, "Video Found decoder"); + Debug(1, "Video Found decoder %s", mVideoCodec->name); zm_dump_stream_format(mFormatContext, mVideoStreamId, 0, 0); // Open the codec @@ -366,15 +381,15 @@ int FfmpegCamera::OpenFfmpeg() { #endif AVDictionaryEntry *e = NULL; while ( (e = av_dict_get(opts, "", e, AV_DICT_IGNORE_SUFFIX)) != NULL ) { - Warning( "Option %s not recognized by ffmpeg", e->key); + Warning("Option %s not recognized by ffmpeg", e->key); } - Error( "Unable to open codec for video stream from %s", mPath.c_str() ); + Error("Unable to open codec for video stream from %s", mPath.c_str()); av_dict_free(&opts); return -1; } else { AVDictionaryEntry *e = NULL; if ( (e = av_dict_get(opts, "", e, AV_DICT_IGNORE_SUFFIX)) != NULL ) { - Warning( "Option %s not recognized by ffmpeg", e->key); + Warning("Option %s not recognized by ffmpeg", e->key); } av_dict_free(&opts); } @@ -387,8 +402,8 @@ int FfmpegCamera::OpenFfmpeg() { } if ( mAudioStreamId >= 0 ) { #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) - mAudioCodecContext = avcodec_alloc_context3( NULL ); - avcodec_parameters_to_context( mAudioCodecContext, mFormatContext->streams[mAudioStreamId]->codecpar ); + mAudioCodecContext = avcodec_alloc_context3(NULL); + avcodec_parameters_to_context(mAudioCodecContext, mFormatContext->streams[mAudioStreamId]->codecpar); #else mAudioCodecContext = mFormatContext->streams[mAudioStreamId]->codec; #endif @@ -399,20 +414,20 @@ int FfmpegCamera::OpenFfmpeg() { zm_dump_stream_format(mFormatContext, mAudioStreamId, 0, 0); // Open the codec #if !LIBAVFORMAT_VERSION_CHECK(53, 8, 0, 8, 0) - Debug ( 1, "Calling avcodec_open" ); + Debug(1, "Calling avcodec_open"); if ( avcodec_open(mAudioCodecContext, mAudioCodec) < 0 ) #else - Debug ( 1, "Calling avcodec_open2" ); + Debug(1, "Calling avcodec_open2"); if ( avcodec_open2(mAudioCodecContext, mAudioCodec, 0) < 0 ) #endif - Fatal( "Unable to open codec for video stream from %s", mPath.c_str() ); + Fatal("Unable to open codec for video stream from %s", mPath.c_str()); } - Debug ( 1, "Opened audio codec" ); + Debug(1, "Opened audio codec"); } // end if have audio stream if ( (unsigned int)mVideoCodecContext->width != width || (unsigned int)mVideoCodecContext->height != height ) { - Warning( "Monitor dimensions are %dx%d but camera is sending %dx%d", width, height, mVideoCodecContext->width, mVideoCodecContext->height ); + Warning("Monitor dimensions are %dx%d but camera is sending %dx%d", width, height, mVideoCodecContext->width, mVideoCodecContext->height); } mCanCapture = true; @@ -420,14 +435,6 @@ int FfmpegCamera::OpenFfmpeg() { return 1; } // int FfmpegCamera::OpenFfmpeg() -int FfmpegCamera::ReopenFfmpeg() { - - Debug(2, "ReopenFfmpeg called."); - - CloseFfmpeg(); - return OpenFfmpeg(); -} - int FfmpegCamera::CloseFfmpeg() { Debug(2, "CloseFfmpeg called."); @@ -461,14 +468,14 @@ int FfmpegCamera::CloseFfmpeg() { if ( mFormatContext ) { #if !LIBAVFORMAT_VERSION_CHECK(53, 17, 0, 25, 0) - av_close_input_file( mFormatContext ); + av_close_input_file(mFormatContext); #else - avformat_close_input( &mFormatContext ); + avformat_close_input(&mFormatContext); #endif mFormatContext = NULL; } return 0; -} // end int FfmpegCamera::CloseFfmpeg() +} // end FfmpegCamera::Close #endif // HAVE_LIBAVFORMAT diff --git a/src/zm_ffmpeg_camera.h b/src/zm_ffmpeg_camera.h index 828d24499..bb8f0c80c 100644 --- a/src/zm_ffmpeg_camera.h +++ b/src/zm_ffmpeg_camera.h @@ -69,11 +69,8 @@ class FfmpegCamera : public Camera { AVPacket packet; int OpenFfmpeg(); - int ReopenFfmpeg(); int CloseFfmpeg(); - bool mIsOpening; bool mCanCapture; - int mOpenStart; #endif // HAVE_LIBAVFORMAT public: diff --git a/src/zm_ffmpeg_input.cpp b/src/zm_ffmpeg_input.cpp index 240dfff24..56358c649 100644 --- a/src/zm_ffmpeg_input.cpp +++ b/src/zm_ffmpeg_input.cpp @@ -28,15 +28,15 @@ int FFmpeg_Input::Open( const char *filepath ) { /** Open the input file to read from it. */ if ( (error = avformat_open_input( &input_format_context, filepath, NULL, NULL)) < 0 ) { - Error("Could not open input file '%s' (error '%s')\n", - filepath, av_make_error_string(error).c_str() ); + Error("Could not open input file '%s' (error '%s')", + filepath, av_make_error_string(error).c_str()); input_format_context = NULL; return error; } /** Get information on the input file (number of streams etc.). */ if ( (error = avformat_find_stream_info(input_format_context, NULL)) < 0 ) { - Error( "Could not open find stream info (error '%s')\n", + Error("Could not open find stream info (error '%s')", av_make_error_string(error).c_str() ); avformat_close_input(&input_format_context); return error; @@ -51,37 +51,37 @@ int FFmpeg_Input::Open( const char *filepath ) { video_stream_id = i; // if we break, then we won't find the audio stream } else { - Warning( "Have another video stream." ); + Warning("Have another video stream."); } - } else if ( is_audio_stream( input_format_context->streams[i] ) ) { + } else if ( is_audio_stream(input_format_context->streams[i]) ) { if ( audio_stream_id == -1 ) { audio_stream_id = i; } else { - Warning( "Have another audio stream." ); + Warning("Have another audio stream."); } } streams[i].frame_count = 0; #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) - streams[i].context = avcodec_alloc_context3( NULL ); - avcodec_parameters_to_context( streams[i].context, input_format_context->streams[i]->codecpar ); + streams[i].context = avcodec_alloc_context3(NULL); + avcodec_parameters_to_context(streams[i].context, input_format_context->streams[i]->codecpar); #else streams[i].context = input_format_context->streams[i]->codec; #endif if ( !(streams[i].codec = avcodec_find_decoder(streams[i].context->codec_id)) ) { - Error( "Could not find input codec\n"); + Error("Could not find input codec\n"); avformat_close_input(&input_format_context); return AVERROR_EXIT; } else { - Debug(1, "Using codec (%s) for stream %d", streams[i].codec->name, i ); + Debug(1, "Using codec (%s) for stream %d", streams[i].codec->name, i); } if ((error = avcodec_open2( streams[i].context, streams[i].codec, NULL)) < 0) { - Error( "Could not open input codec (error '%s')\n", - av_make_error_string(error).c_str() ); + Error("Could not open input codec (error '%s')\n", + av_make_error_string(error).c_str()); #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) - avcodec_free_context( &streams[i].context ); + avcodec_free_context(&streams[i].context); #endif avformat_close_input(&input_format_context); return error; @@ -89,9 +89,9 @@ int FFmpeg_Input::Open( const char *filepath ) { } // end foreach stream if ( video_stream_id == -1 ) - Error( "Unable to locate video stream in %s", filepath ); + Error("Unable to locate video stream in %s", filepath); if ( audio_stream_id == -1 ) - Debug( 3, "Unable to locate audio stream in %s", filepath ); + Debug(3, "Unable to locate audio stream in %s", filepath); return 0; } // end int FFmpeg_Input::Open( const char * filepath ) @@ -99,9 +99,9 @@ int FFmpeg_Input::Open( const char *filepath ) { int FFmpeg_Input::Close( ) { for ( unsigned int i = 0; i < input_format_context->nb_streams; i += 1 ) { if ( streams[i].context ) { - avcodec_close( streams[i].context ); + avcodec_close(streams[i].context); #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) - avcodec_free_context(& streams[i].context ); + avcodec_free_context(&streams[i].context); #endif streams[i].context = NULL; } @@ -109,20 +109,20 @@ int FFmpeg_Input::Close( ) { if ( input_format_context ) { #if !LIBAVFORMAT_VERSION_CHECK(53, 17, 0, 25, 0) - av_close_input_file( input_format_context ); + av_close_input_file(input_format_context); #else - avformat_close_input( &input_format_context ); + avformat_close_input(&input_format_context); #endif input_format_context = NULL; } return 1; } // end int FFmpeg_Input::Close() -AVFrame *FFmpeg_Input::get_frame( int stream_id, int frame_number ) { - Debug(1, "Getting frame from stream %d, frame_number(%d)", stream_id, frame_number ); +AVFrame *FFmpeg_Input::get_frame(int stream_id, int frame_number) { + Debug(1, "Getting frame from stream %d, frame_number(%d)", stream_id, frame_number); AVPacket packet; - av_init_packet( &packet ); + av_init_packet(&packet); AVFrame *frame = zm_av_frame_alloc(); while ( frame_number >= streams[stream_id].frame_count ) { @@ -135,10 +135,10 @@ AVFrame *FFmpeg_Input::get_frame( int stream_id, int frame_number ) { // Check for Connection failure. (ret == -110) ) { - Info( "av_read_frame returned %s.", av_make_error_string(ret).c_str() ); + Info("av_read_frame returned %s.", av_make_error_string(ret).c_str()); } else { - Error( "Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, ret, - av_make_error_string(ret).c_str() ); + Error("Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, ret, + av_make_error_string(ret).c_str()); } return NULL; } @@ -148,7 +148,7 @@ AVFrame *FFmpeg_Input::get_frame( int stream_id, int frame_number ) { return NULL; } - if ( ! zm_receive_frame( streams[packet.stream_index].context, frame, packet ) ) { + if ( ! zm_receive_frame(streams[packet.stream_index].context, frame, packet) ) { Error("Unable to get frame %d, continuing", streams[packet.stream_index].frame_count); zm_av_packet_unref( &packet ); continue; @@ -157,7 +157,7 @@ AVFrame *FFmpeg_Input::get_frame( int stream_id, int frame_number ) { streams[packet.stream_index].frame_count += 1; } - zm_av_packet_unref( &packet ); + zm_av_packet_unref(&packet); if ( frame_number == -1 ) break; diff --git a/src/zm_image.cpp b/src/zm_image.cpp index 782e4df4c..31676a461 100644 --- a/src/zm_image.cpp +++ b/src/zm_image.cpp @@ -768,7 +768,7 @@ bool Image::ReadRaw( const char *filename ) { return false; } - if ( statbuf.st_size != size ) { + if ( (unsigned int)statbuf.st_size != size ) { fclose(infile); Error("Raw file size mismatch, expected %d bytes, found %ld", size, statbuf.st_size); return false; @@ -803,57 +803,51 @@ bool Image::WriteRaw( const char *filename ) const { return true; } -bool Image::ReadJpeg( const char *filename, unsigned int p_colours, unsigned int p_subpixelorder) -{ +bool Image::ReadJpeg(const char *filename, unsigned int p_colours, unsigned int p_subpixelorder) { unsigned int new_width, new_height, new_colours, new_subpixelorder; struct jpeg_decompress_struct *cinfo = readjpg_dcinfo; - if ( !cinfo ) - { + if ( !cinfo ) { cinfo = readjpg_dcinfo = new jpeg_decompress_struct; - cinfo->err = jpeg_std_error( &jpg_err.pub ); + cinfo->err = jpeg_std_error(&jpg_err.pub); jpg_err.pub.error_exit = zm_jpeg_error_exit; jpg_err.pub.emit_message = zm_jpeg_emit_message; - jpeg_create_decompress( cinfo ); + jpeg_create_decompress(cinfo); } FILE *infile; - if ( (infile = fopen( filename, "rb" )) == NULL ) - { - Error( "Can't open %s: %s", filename, strerror(errno) ); - return( false ); + if ( (infile = fopen(filename, "rb")) == NULL ) { + Error("Can't open %s: %s", filename, strerror(errno)); + return false; } - if ( setjmp( jpg_err.setjmp_buffer ) ) - { - jpeg_abort_decompress( cinfo ); - fclose( infile ); - return( false ); + if ( setjmp(jpg_err.setjmp_buffer) ) { + jpeg_abort_decompress(cinfo); + fclose(infile); + return false; } - jpeg_stdio_src( cinfo, infile ); + jpeg_stdio_src(cinfo, infile); - jpeg_read_header( cinfo, TRUE ); + jpeg_read_header(cinfo, TRUE); - if ( cinfo->num_components != 1 && cinfo->num_components != 3 ) - { + if ( cinfo->num_components != 1 && cinfo->num_components != 3 ) { Error( "Unexpected colours when reading jpeg image: %d", colours ); - jpeg_abort_decompress( cinfo ); - fclose( infile ); - return( false ); + jpeg_abort_decompress(cinfo); + fclose(infile); + return false; } /* Check if the image has at least one huffman table defined. If not, use the standard ones */ /* This is required for the MJPEG capture palette of USB devices */ - if(cinfo->dc_huff_tbl_ptrs[0] == NULL) { + if ( cinfo->dc_huff_tbl_ptrs[0] == NULL ) { zm_use_std_huff_tables(cinfo); } new_width = cinfo->image_width; new_height = cinfo->image_height; - if ( width != new_width || height != new_height ) - { + if ( width != new_width || height != new_height ) { Debug(9,"Image dimensions differ. Old: %ux%u New: %ux%u",width,height,new_width,new_height); } @@ -1663,30 +1657,24 @@ void Image::Blend( const Image &image, int transparency ) AssignDirect( width, height, colours, subpixelorder, new_buffer, size, ZM_BUFTYPE_ZM); } -Image *Image::Merge( unsigned int n_images, Image *images[] ) -{ - if ( n_images <= 0 ) return( 0 ); - if ( n_images == 1 ) return( new Image( *images[0] ) ); +Image *Image::Merge( unsigned int n_images, Image *images[] ) { + if ( n_images == 1 ) return new Image(*images[0]); unsigned int width = images[0]->width; unsigned int height = images[0]->height; unsigned int colours = images[0]->colours; - for ( unsigned int i = 1; i < n_images; i++ ) - { - if ( !(width == images[i]->width && height == images[i]->height && colours == images[i]->colours) ) - { + for ( unsigned int i = 1; i < n_images; i++ ) { + if ( !(width == images[i]->width && height == images[i]->height && colours == images[i]->colours) ) { Panic( "Attempt to merge different sized images, expected %dx%dx%d, got %dx%dx%d, for image %d", width, height, colours, images[i]->width, images[i]->height, images[i]->colours, i ); } } Image *result = new Image( width, height, images[0]->colours, images[0]->subpixelorder); unsigned int size = result->size; - for ( unsigned int i = 0; i < size; i++ ) - { + for ( unsigned int i = 0; i < size; i++ ) { unsigned int total = 0; uint8_t *pdest = result->buffer; - for ( unsigned int j = 0; j < n_images; j++ ) - { + for ( unsigned int j = 0; j < n_images; j++ ) { uint8_t *psrc = images[j]->buffer; total += *psrc; psrc++; @@ -1694,21 +1682,17 @@ Image *Image::Merge( unsigned int n_images, Image *images[] ) *pdest = total/n_images; pdest++; } - return( result ); + return result; } -Image *Image::Merge( unsigned int n_images, Image *images[], double weight ) -{ - if ( n_images <= 0 ) return( 0 ); - if ( n_images == 1 ) return( new Image( *images[0] ) ); +Image *Image::Merge( unsigned int n_images, Image *images[], double weight ) { + if ( n_images == 1 ) return new Image(*images[0]); unsigned int width = images[0]->width; unsigned int height = images[0]->height; unsigned int colours = images[0]->colours; - for ( unsigned int i = 1; i < n_images; i++ ) - { - if ( !(width == images[i]->width && height == images[i]->height && colours == images[i]->colours) ) - { + for ( unsigned int i = 1; i < n_images; i++ ) { + if ( !(width == images[i]->width && height == images[i]->height && colours == images[i]->colours) ) { Panic( "Attempt to merge different sized images, expected %dx%dx%d, got %dx%dx%d, for image %d", width, height, colours, images[i]->width, images[i]->height, images[i]->colours, i ); } } @@ -1716,55 +1700,46 @@ Image *Image::Merge( unsigned int n_images, Image *images[], double weight ) Image *result = new Image( *images[0] ); unsigned int size = result->size; double factor = 1.0*weight; - for ( unsigned int i = 1; i < n_images; i++ ) - { + for ( unsigned int i = 1; i < n_images; i++ ) { uint8_t *pdest = result->buffer; uint8_t *psrc = images[i]->buffer; - for ( unsigned int j = 0; j < size; j++ ) - { + for ( unsigned int j = 0; j < size; j++ ) { *pdest = (uint8_t)(((*pdest)*(1.0-factor))+((*psrc)*factor)); pdest++; psrc++; } factor *= weight; } - return( result ); + return result; } Image *Image::Highlight( unsigned int n_images, Image *images[], const Rgb threshold, const Rgb ref_colour ) { - if ( n_images <= 0 ) return( 0 ); - if ( n_images == 1 ) return( new Image( *images[0] ) ); + if ( n_images == 1 ) return new Image(*images[0]); unsigned int width = images[0]->width; unsigned int height = images[0]->height; unsigned int colours = images[0]->colours; - for ( unsigned int i = 1; i < n_images; i++ ) - { - if ( !(width == images[i]->width && height == images[i]->height && colours == images[i]->colours) ) - { + for ( unsigned int i = 1; i < n_images; i++ ) { + if ( !(width == images[i]->width && height == images[i]->height && colours == images[i]->colours) ) { Panic( "Attempt to highlight different sized images, expected %dx%dx%d, got %dx%dx%d, for image %d", width, height, colours, images[i]->width, images[i]->height, images[i]->colours, i ); } } Image *result = new Image( width, height, images[0]->colours, images[0]->subpixelorder ); unsigned int size = result->size; - for ( unsigned int c = 0; c < colours; c++ ) - { + for ( unsigned int c = 0; c < colours; c++ ) { unsigned int ref_colour_rgb = RGB_VAL(ref_colour,c); - for ( unsigned int i = 0; i < size; i++ ) - { + for ( unsigned int i = 0; i < size; i++ ) { unsigned int count = 0; uint8_t *pdest = result->buffer+c; - for ( unsigned int j = 0; j < n_images; j++ ) - { + for ( unsigned int j = 0; j < n_images; j++ ) { uint8_t *psrc = images[j]->buffer+c; unsigned int diff = ((*psrc)-ref_colour_rgb) > 0 ? (*psrc)-ref_colour_rgb : ref_colour_rgb - (*psrc); - if (diff >= RGB_VAL(threshold,c)) - { + if (diff >= RGB_VAL(threshold,c)) { count++; } psrc += colours; diff --git a/src/zm_local_camera.cpp b/src/zm_local_camera.cpp index c8a653b14..a56bcbe76 100644 --- a/src/zm_local_camera.cpp +++ b/src/zm_local_camera.cpp @@ -668,7 +668,7 @@ LocalCamera::~LocalCamera() { sws_freeContext(imgConversionContext); imgConversionContext = NULL; - av_frame_free( &tmpPicture ); + av_frame_free(&tmpPicture); } #endif } // end LocalCamera::~LocalCamera @@ -1091,54 +1091,51 @@ void LocalCamera::Initialise() { void LocalCamera::Terminate() { #if ZM_HAS_V4L2 if ( v4l_version == 2 ) { - Debug( 3, "Terminating video stream" ); + Debug(3, "Terminating video stream"); //enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; // enum v4l2_buf_type type = v4l2_data.fmt.type; enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type; - if ( vidioctl( vid_fd, VIDIOC_STREAMOFF, &type ) < 0 ) - Error( "Failed to stop capture stream: %s", strerror(errno) ); + if ( vidioctl(vid_fd, VIDIOC_STREAMOFF, &type) < 0 ) + Error("Failed to stop capture stream: %s", strerror(errno)); - Debug( 3, "Unmapping video buffers" ); + Debug(3, "Unmapping video buffers"); for ( unsigned int i = 0; i < v4l2_data.reqbufs.count; i++ ) { #if HAVE_LIBSWSCALE /* Free capture pictures */ #if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101) - av_frame_free( &capturePictures[i] ); + av_frame_free(&capturePictures[i]); #else - av_freep( &capturePictures[i] ); + av_freep(&capturePictures[i]); #endif #endif - if ( munmap( v4l2_data.buffers[i].start, v4l2_data.buffers[i].length ) < 0 ) - Error( "Failed to munmap buffer %d: %s", i, strerror(errno) ); + if ( munmap(v4l2_data.buffers[i].start, v4l2_data.buffers[i].length) < 0 ) + Error("Failed to munmap buffer %d: %s", i, strerror(errno)); } - } else #endif // ZM_HAS_V4L2 - #if ZM_HAS_V4L1 if ( v4l_version == 1 ) { #if HAVE_LIBSWSCALE - for(int i=0; i < v4l1_data.frames.frames; i++) { + for( int i=0; i < v4l1_data.frames.frames; i++ ) { /* Free capture pictures */ #if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101) - av_frame_free( &capturePictures[i] ); + av_frame_free(&capturePictures[i]); #else - av_freep( &capturePictures[i] ); + av_freep(&capturePictures[i]); #endif } #endif - Debug( 3, "Unmapping video buffers" ); + Debug(3, "Unmapping video buffers"); if ( munmap((char*)v4l1_data.bufptr, v4l1_data.frames.size) < 0 ) - Error( "Failed to munmap buffers: %s", strerror(errno) ); + Error("Failed to munmap buffers: %s", strerror(errno)); delete[] v4l1_data.buffers; } // end if using v4l1 #endif // ZM_HAS_V4L1 - close( vid_fd ); - + close(vid_fd); } // end LocalCamera::Terminate uint32_t LocalCamera::AutoSelectFormat(int p_colours) { diff --git a/src/zm_logger.cpp b/src/zm_logger.cpp index a76ee92f3..43094729b 100644 --- a/src/zm_logger.cpp +++ b/src/zm_logger.cpp @@ -62,22 +62,22 @@ void Logger::usrHandler( int sig ) { logger->level( logger->level()+1 ); else if ( sig == SIGUSR2 ) logger->level( logger->level()-1 ); - Info( "Logger - Level changed to %d", logger->level() ); + Info("Logger - Level changed to %d", logger->level()); } Logger::Logger() : - mLevel( INFO ), - mTermLevel( NOLOG ), - mDatabaseLevel( NOLOG ), - mFileLevel( NOLOG ), - mSyslogLevel( NOLOG ), - mEffectiveLevel( NOLOG ), + mLevel(INFO), + mTerminalLevel(NOLOG), + mDatabaseLevel(NOLOG), + mFileLevel(NOLOG), + mSyslogLevel(NOLOG), + mEffectiveLevel(NOLOG), //mLogPath( staticConfig.PATH_LOGS.c_str() ), //mLogFile( mLogPath+"/"+mId+".log" ), - mDbConnected( false ), - mLogFileFP( NULL ), - mHasTerm( false ), - mFlush( false ) { + mDbConnected(false), + mLogFileFP(NULL), + mHasTerminal(false), + mFlush(false) { if ( smInstance ) { Panic( "Attempt to create second instance of Logger class" ); @@ -99,7 +99,7 @@ Logger::Logger() : char code[4] = ""; for ( int i = DEBUG1; i <= DEBUG9; i++ ) { - snprintf( code, sizeof(code), "DB%d", i ); + snprintf(code, sizeof(code), "DB%d", i); smCodes[i] = code; smSyslogPriorities[i] = LOG_DEBUG; } @@ -108,13 +108,14 @@ Logger::Logger() : } if ( fileno(stderr) && isatty(fileno(stderr)) ) - mHasTerm = true; + mHasTerminal = true; } Logger::~Logger() { terminate(); smCodes.clear(); smSyslogPriorities.clear(); + smInitialised = false; #if 0 for ( StringMap::iterator itr = smCodes.begin(); itr != smCodes.end(); itr ++ ) { smCodes.erase( itr ); @@ -125,7 +126,7 @@ Logger::~Logger() { #endif } -void Logger::initialise( const std::string &id, const Options &options ) { +void Logger::initialise(const std::string &id, const Options &options) { char *envPtr; if ( !id.empty() ) @@ -133,7 +134,7 @@ void Logger::initialise( const std::string &id, const Options &options ) { std::string tempLogFile; - if ( (envPtr = getTargettedEnv( "LOG_FILE" )) ) + if ( (envPtr = getTargettedEnv("LOG_FILE")) ) tempLogFile = envPtr; else if ( options.mLogFile.size() ) tempLogFile = options.mLogFile; @@ -145,13 +146,13 @@ void Logger::initialise( const std::string &id, const Options &options ) { } Level tempLevel = INFO; - Level tempTermLevel = mTermLevel; + Level tempTerminalLevel = mTerminalLevel; Level tempDatabaseLevel = mDatabaseLevel; Level tempFileLevel = mFileLevel; Level tempSyslogLevel = mSyslogLevel; - if ( options.mTermLevel != NOOPT ) - tempTermLevel = options.mTermLevel; + if ( options.mTerminalLevel != NOOPT ) + tempTerminalLevel = options.mTerminalLevel; if ( options.mDatabaseLevel != NOOPT ) tempDatabaseLevel = options.mDatabaseLevel; @@ -170,22 +171,22 @@ void Logger::initialise( const std::string &id, const Options &options ) { // Legacy if ( (envPtr = getenv( "LOG_PRINT" )) ) - tempTermLevel = atoi(envPtr) ? DEBUG9 : NOLOG; + tempTerminalLevel = atoi(envPtr) ? DEBUG9 : NOLOG; - if ( (envPtr = getTargettedEnv( "LOG_LEVEL" )) ) + if ( (envPtr = getTargettedEnv("LOG_LEVEL")) ) tempLevel = atoi(envPtr); - if ( (envPtr = getTargettedEnv( "LOG_LEVEL_TERM" )) ) - tempTermLevel = atoi(envPtr); - if ( (envPtr = getTargettedEnv( "LOG_LEVEL_DATABASE" )) ) + if ( (envPtr = getTargettedEnv("LOG_LEVEL_TERM")) ) + tempTerminalLevel = atoi(envPtr); + if ( (envPtr = getTargettedEnv("LOG_LEVEL_DATABASE")) ) tempDatabaseLevel = atoi(envPtr); - if ( (envPtr = getTargettedEnv( "LOG_LEVEL_FILE" )) ) + if ( (envPtr = getTargettedEnv("LOG_LEVEL_FILE")) ) tempFileLevel = atoi(envPtr); - if ( (envPtr = getTargettedEnv( "LOG_LEVEL_SYSLOG" )) ) + if ( (envPtr = getTargettedEnv("LOG_LEVEL_SYSLOG")) ) tempSyslogLevel = atoi(envPtr); if ( config.log_debug ) { - StringVector targets = split( config.log_debug_target, "|" ); + StringVector targets = split(config.log_debug_target, "|"); for ( unsigned int i = 0; i < targets.size(); i++ ) { const std::string &target = targets[i]; if ( target == mId || target == "_"+mId || target == "_"+mIdRoot || target == "" ) { @@ -202,20 +203,19 @@ void Logger::initialise( const std::string &id, const Options &options ) { // if we don't have debug turned on, then the max effective log level is INFO if ( tempSyslogLevel > INFO ) tempSyslogLevel = INFO; if ( tempFileLevel > INFO ) tempFileLevel = INFO; - if ( tempTermLevel > INFO ) tempTermLevel = INFO; + if ( tempTerminalLevel > INFO ) tempTerminalLevel = INFO; if ( tempDatabaseLevel > INFO ) tempDatabaseLevel = INFO; if ( tempLevel > INFO ) tempLevel = INFO; } // end if config.log_debug + logFile(tempLogFile); - logFile( tempLogFile ); + terminalLevel(tempTerminalLevel); + databaseLevel(tempDatabaseLevel); + fileLevel(tempFileLevel); + syslogLevel(tempSyslogLevel); - termLevel( tempTermLevel ); - databaseLevel( tempDatabaseLevel ); - fileLevel( tempFileLevel ); - syslogLevel( tempSyslogLevel ); - - level( tempLevel ); + level(tempLevel); mFlush = false; if ( (envPtr = getenv("LOG_FLUSH")) ) { @@ -224,27 +224,27 @@ void Logger::initialise( const std::string &id, const Options &options ) { mFlush = true; } - //mRuntime = (envPtr = getenv( "LOG_RUNTIME")) ? atoi( envPtr ) : false; { struct sigaction action; - memset( &action, 0, sizeof(action) ); + memset(&action, 0, sizeof(action)); action.sa_handler = usrHandler; action.sa_flags = SA_RESTART; - if ( sigaction( SIGUSR1, &action, 0 ) < 0 ) { - Fatal( "sigaction(), error = %s", strerror(errno) ); + // Does this REALLY need to be fatal? + if ( sigaction(SIGUSR1, &action, 0) < 0 ) { + Fatal("sigaction(), error = %s", strerror(errno)); } - if ( sigaction( SIGUSR2, &action, 0 ) < 0) { - Fatal( "sigaction(), error = %s", strerror(errno) ); + if ( sigaction(SIGUSR2, &action, 0) < 0) { + Fatal("sigaction(), error = %s", strerror(errno)); } } mInitialised = true; - Debug( 1, "LogOpts: level=%s/%s, screen=%s, database=%s, logfile=%s->%s, syslog=%s", + Debug(1, "LogOpts: level=%s/%s, screen=%s, database=%s, logfile=%s->%s, syslog=%s", smCodes[mLevel].c_str(), smCodes[mEffectiveLevel].c_str(), - smCodes[mTermLevel].c_str(), + smCodes[mTerminalLevel].c_str(), smCodes[mDatabaseLevel].c_str(), smCodes[mFileLevel].c_str(), mLogFile.c_str(), @@ -253,7 +253,7 @@ void Logger::initialise( const std::string &id, const Options &options ) { } void Logger::terminate() { - Debug(1, "Terminating Logger" ); + Debug(1, "Terminating Logger"); if ( mFileLevel > NOLOG ) closeFile(); @@ -265,66 +265,67 @@ void Logger::terminate() { closeDatabase(); } -bool Logger::boolEnv( const std::string &name, bool defaultValue ) { - const char *envPtr = getenv( name.c_str() ); - return( envPtr ? atoi( envPtr ) : defaultValue ); +// These don't belong here, they have nothing to do with logging +bool Logger::boolEnv(const std::string &name, bool defaultValue) { + const char *envPtr = getenv(name.c_str()); + return envPtr ? atoi(envPtr) : defaultValue; } -int Logger::intEnv( const std::string &name, bool defaultValue ) { - const char *envPtr = getenv( name.c_str() ); - return( envPtr ? atoi( envPtr ) : defaultValue ); +int Logger::intEnv(const std::string &name, bool defaultValue) { + const char *envPtr = getenv(name.c_str()); + return envPtr ? atoi(envPtr) : defaultValue; } -std::string Logger::strEnv( const std::string &name, const std::string &defaultValue ) { - const char *envPtr = getenv( name.c_str() ); - return( envPtr ? envPtr : defaultValue ); +std::string Logger::strEnv(const std::string &name, const std::string &defaultValue) { + const char *envPtr = getenv(name.c_str()); + return envPtr ? envPtr : defaultValue; } -char *Logger::getTargettedEnv( const std::string &name ) { +char *Logger::getTargettedEnv(const std::string &name) { std::string envName = name+"_"+mId; - char *envPtr = getenv( envName.c_str() ); + char *envPtr = getenv(envName.c_str()); if ( !envPtr && mId != mIdRoot ) { envName = name+"_"+mIdRoot; - envPtr = getenv( envName.c_str() ); + envPtr = getenv(envName.c_str()); } if ( !envPtr ) - envPtr = getenv( name.c_str() ); + envPtr = getenv(name.c_str()); return envPtr; } -const std::string &Logger::id( const std::string &id ) { +const std::string &Logger::id(const std::string &id) { std::string tempId = id; size_t pos; // Remove whitespace while ( (pos = tempId.find_first_of( " \t" )) != std::string::npos ) { - tempId.replace( pos, 1, "" ); + tempId.replace(pos, 1, ""); } // Replace non-alphanum with underscore - while ( (pos = tempId.find_first_not_of( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_" )) != std::string::npos ) { - tempId.replace( pos, 1, "_" ); + while ( (pos = tempId.find_first_not_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")) != std::string::npos ) { + tempId.replace(pos, 1, "_"); } if ( mId != tempId ) { mId = tempId; - pos = mId.find( '_' ); + pos = mId.find('_'); if ( pos != std::string::npos ) { - mIdRoot = mId.substr( 0, pos ); + mIdRoot = mId.substr(0, pos); if ( ++pos < mId.size() ) - mIdArgs = mId.substr( pos ); + mIdArgs = mId.substr(pos); } } - return( mId ); + return mId; } -Logger::Level Logger::level( Logger::Level level ) { +Logger::Level Logger::level(Logger::Level level) { if ( level > NOOPT ) { level = limit(level); if ( mLevel != level ) mLevel = level; mEffectiveLevel = NOLOG; - if ( mTermLevel > mEffectiveLevel ) - mEffectiveLevel = mTermLevel; + if ( mTerminalLevel > mEffectiveLevel ) + mEffectiveLevel = mTerminalLevel; if ( mDatabaseLevel > mEffectiveLevel ) mEffectiveLevel = mDatabaseLevel; if ( mFileLevel > mEffectiveLevel ) @@ -334,18 +335,18 @@ Logger::Level Logger::level( Logger::Level level ) { if ( mEffectiveLevel > mLevel) mEffectiveLevel = mLevel; } - return( mLevel ); + return mLevel; } -Logger::Level Logger::termLevel( Logger::Level termLevel ) { - if ( termLevel > NOOPT ) { - if ( !mHasTerm ) - termLevel = NOLOG; - termLevel = limit(termLevel); - if ( mTermLevel != termLevel ) - mTermLevel = termLevel; +Logger::Level Logger::terminalLevel( Logger::Level terminalLevel ) { + if ( terminalLevel > NOOPT ) { + if ( !mHasTerminal ) + terminalLevel = NOLOG; + terminalLevel = limit(terminalLevel); + if ( mTerminalLevel != terminalLevel ) + mTerminalLevel = terminalLevel; } - return( mTermLevel ); + return mTerminalLevel; } Logger::Level Logger::databaseLevel( Logger::Level databaseLevel ) { @@ -359,7 +360,7 @@ Logger::Level Logger::databaseLevel( Logger::Level databaseLevel ) { } // end if ( mDatabaseLevel != databaseLevel ) } // end if ( databaseLevel > NOOPT ) - return( mDatabaseLevel ); + return mDatabaseLevel; } Logger::Level Logger::fileLevel( Logger::Level fileLevel ) { @@ -372,7 +373,7 @@ Logger::Level Logger::fileLevel( Logger::Level fileLevel ) { if ( mFileLevel > NOLOG ) openFile(); } - return( mFileLevel ); + return mFileLevel; } Logger::Level Logger::syslogLevel( Logger::Level syslogLevel ) { @@ -386,7 +387,7 @@ Logger::Level Logger::syslogLevel( Logger::Level syslogLevel ) { openSyslog(); } } - return( mSyslogLevel ); + return mSyslogLevel; } void Logger::logFile( const std::string &logFile ) { @@ -448,9 +449,9 @@ void Logger::logPrint( bool hex, const char * const filepath, const int line, co const char *classString = smCodes[level].c_str(); if ( level < PANIC || level > DEBUG9 ) - Panic( "Invalid logger level %d", level ); + Panic("Invalid logger level %d", level); - gettimeofday( &timeVal, NULL ); + gettimeofday(&timeVal, NULL); #if 0 if ( logRuntime ) { @@ -462,8 +463,8 @@ void Logger::logPrint( bool hex, const char * const filepath, const int line, co } else { #endif char *timePtr = timeString; - timePtr += strftime( timePtr, sizeof(timeString), "%x %H:%M:%S", localtime(&timeVal.tv_sec) ); - snprintf( timePtr, sizeof(timeString)-(timePtr-timeString), ".%06ld", timeVal.tv_usec ); + timePtr += strftime(timePtr, sizeof(timeString), "%x %H:%M:%S", localtime(&timeVal.tv_sec)); + snprintf(timePtr, sizeof(timeString)-(timePtr-timeString), ".%06ld", timeVal.tv_usec); #if 0 } #endif @@ -517,7 +518,7 @@ void Logger::logPrint( bool hex, const char * const filepath, const int line, co char *syslogEnd = logPtr; strncpy( logPtr, "]\n", sizeof(logString)-(logPtr-logString) ); - if ( level <= mTermLevel ) { + if ( level <= mTerminalLevel ) { puts( logString ); fflush( stdout ); } @@ -541,10 +542,10 @@ void Logger::logPrint( bool hex, const char * const filepath, const int line, co mysql_real_escape_string( &dbconn, escapedString, syslogStart, strlen(syslogStart) ); snprintf( sql, sizeof(sql), "insert into Logs ( TimeKey, Component, ServerId, Pid, Level, Code, Message, File, Line ) values ( %ld.%06ld, '%s', %d, %d, %d, '%s', '%s', '%s', %d )", timeVal.tv_sec, timeVal.tv_usec, mId.c_str(), staticConfig.SERVER_ID, tid, level, classString, escapedString, file, line ); - if ( mysql_query( &dbconn, sql ) ) { + if (mysql_query(&dbconn, sql)) { Level tempDatabaseLevel = mDatabaseLevel; - databaseLevel( NOLOG ); - Error( "Can't insert log entry: sql(%s) error(%s)", sql, mysql_error( &dbconn ) ); + databaseLevel(NOLOG); + Error("Can't insert log entry: sql(%s) error(%s)", sql, mysql_error(&dbconn)); databaseLevel(tempDatabaseLevel); } db_mutex.unlock(); @@ -561,7 +562,7 @@ void Logger::logPrint( bool hex, const char * const filepath, const int line, co zmDbClose(); if ( level <= PANIC ) abort(); - exit( -1 ); + exit(-1); } } diff --git a/src/zm_logger.h b/src/zm_logger.h index e5472c3e6..8e2ab6c9d 100644 --- a/src/zm_logger.h +++ b/src/zm_logger.h @@ -58,7 +58,7 @@ public: class Options { public: - int mTermLevel; + int mTerminalLevel; int mDatabaseLevel; int mFileLevel; int mSyslogLevel; @@ -67,8 +67,8 @@ public: std::string mLogFile; public: - Options( Level termLevel=NOOPT, Level databaseLevel=NOOPT, Level fileLevel=NOOPT, Level syslogLevel=NOOPT, const std::string &logPath=".", const std::string &logFile="" ) : - mTermLevel( termLevel ), + Options( Level terminalLevel=NOOPT, Level databaseLevel=NOOPT, Level fileLevel=NOOPT, Level syslogLevel=NOOPT, const std::string &logPath=".", const std::string &logFile="" ) : + mTerminalLevel( terminalLevel ), mDatabaseLevel( databaseLevel ), mFileLevel( fileLevel ), mSyslogLevel( syslogLevel ), @@ -93,7 +93,7 @@ private: std::string mIdArgs; Level mLevel; // Level that is currently in operation - Level mTermLevel; // Maximum level output via terminal + Level mTerminalLevel; // Maximum level output via terminal Level mDatabaseLevel; // Maximum level output via database Level mFileLevel; // Maximum level output via file Level mSyslogLevel; // Maximum level output via syslog @@ -104,25 +104,23 @@ private: std::string mLogFile; FILE *mLogFileFP; - bool mHasTerm; + bool mHasTerminal; bool mFlush; private: - static void usrHandler( int sig ); + static void usrHandler(int sig); public: - friend void logInit( const char *name, const Options &options ); + friend void logInit(const char *name, const Options &options); friend void logTerm(); - static Logger *fetch() - { - if ( !smInstance ) - { + static Logger *fetch() { + if ( !smInstance ) { smInstance = new Logger(); Options options; smInstance->initialise( "undef", options ); } - return( smInstance ); + return smInstance; } private: @@ -130,51 +128,48 @@ private: ~Logger(); public: - void initialise( const std::string &id, const Options &options ); + void initialise(const std::string &id, const Options &options); void terminate(); private: - int limit( int level ) - { + int limit(int level) { if ( level > DEBUG9 ) - return( DEBUG9 ); + return DEBUG9; if ( level < NOLOG ) - return( NOLOG ); - return( level ); + return NOLOG; + return level; } - bool boolEnv( const std::string &name, bool defaultValue=false ); - int intEnv( const std::string &name, bool defaultValue=0 ); - std::string strEnv( const std::string &name, const std::string &defaultValue="" ); - char *getTargettedEnv( const std::string &name ); + bool boolEnv(const std::string &name, bool defaultValue=false); + int intEnv(const std::string &name, bool defaultValue=0); + std::string strEnv(const std::string &name, const std::string &defaultValue=""); + char *getTargettedEnv(const std::string &name); void loadEnv(); public: - const std::string &id() const - { - return( mId ); + const std::string &id() const { + return mId; } - const std::string &id( const std::string &id ); + const std::string &id(const std::string &id); - Level level() const - { - return( mLevel ); + Level level() const { + return mLevel; } - Level level( Level=NOOPT ); + Level level(Level=NOOPT); bool debugOn() { - return( mEffectiveLevel >= DEBUG1 ); + return mEffectiveLevel >= DEBUG1; } - Level termLevel( Level=NOOPT ); - Level databaseLevel( Level=NOOPT ); - Level fileLevel( Level=NOOPT ); - Level syslogLevel( Level=NOOPT ); + Level terminalLevel(Level=NOOPT); + Level databaseLevel(Level=NOOPT); + Level fileLevel(Level=NOOPT); + Level syslogLevel(Level=NOOPT); private: - void logFile( const std::string &logFile ); + void logFile(const std::string &logFile); void openFile(); void closeFile(); void openSyslog(); @@ -182,22 +177,19 @@ private: void closeDatabase(); public: - void logPrint( bool hex, const char * const filepath, const int line, const int level, const char *fstring, ... ); + void logPrint(bool hex, const char * const filepath, const int line, const int level, const char *fstring, ...); }; -void logInit( const char *name, const Logger::Options &options=Logger::Options() ); +void logInit(const char *name, const Logger::Options &options=Logger::Options()); void logTerm(); inline const std::string &logId() { - return( Logger::fetch()->id() ); + return Logger::fetch()->id(); } inline Logger::Level logLevel() { - return( Logger::fetch()->level() ); -} -inline void logCapLevel( Logger::Level level ) { - Logger::fetch()->level( level ); + return Logger::fetch()->level(); } inline Logger::Level logDebugging() { - return( Logger::fetch()->debugOn() ); + return Logger::fetch()->debugOn(); } #define logPrintf(logLevel,params...) {\ diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index e1b91b082..247db97a0 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Monitor Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include #include @@ -63,17 +63,43 @@ #define MAP_LOCKED 0 #endif -Monitor::MonitorLink::MonitorLink( int p_id, const char *p_name ) : - id( p_id ), +// This is the official SQL (and ordering of the fields) to load a Monitor. +// It will be used whereever a Monitor dbrow is needed. WHERE conditions can be appended +std::string load_monitor_sql = +"SELECT Id, Name, ServerId, StorageId, Type, Function+0, Enabled, LinkedMonitors, " +"AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS," +"Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, " // V4L Settings +"Protocol, Method, Options, User, Pass, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, RTSPDescribe, " +"SaveJPEGs, VideoWriter, EncoderParameters, " +"OutputCodec, OutputContainer, " +"RecordAudio, " +"Brightness, Contrast, Hue, Colour, " +"EventPrefix, LabelFormat, LabelX, LabelY, LabelSize," +"ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, " +"SectionLength, FrameSkip, MotionFrameSkip, " +"FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif, SignalCheckColour FROM Monitors"; + +std::string CameraType_Strings[] = { + "Local", + "Remote", + "File", + "Ffmpeg", + "LibVLC", + "cURL", + "NVSOCKET", +}; + +Monitor::MonitorLink::MonitorLink(int p_id, const char *p_name) : + id(p_id), shared_data(NULL), trigger_data(NULL), video_store_data(NULL) { - strncpy( name, p_name, sizeof(name)-1 ); + strncpy(name, p_name, sizeof(name)-1); #if ZM_MEM_MAPPED map_fd = -1; - snprintf( mem_file, sizeof(mem_file), "%s/zm.mmap.%d", staticConfig.PATH_MAP.c_str(), id ); + snprintf(mem_file, sizeof(mem_file), "%s/zm.mmap.%d", staticConfig.PATH_MAP.c_str(), id); #else // ZM_MEM_MAPPED shm_id = 0; #endif // ZM_MEM_MAPPED @@ -166,7 +192,7 @@ bool Monitor::MonitorLink::connect() { return( true ); } return( false ); -} +} // end bool Monitor::MonitorLink::connect() bool Monitor::MonitorLink::disconnect() { if ( connected ) { @@ -225,135 +251,281 @@ bool Monitor::MonitorLink::inAlarm() { bool Monitor::MonitorLink::hasAlarmed() { if ( shared_data->state == ALARM ) { - return( true ); + return true; } - //} else if ( shared_data->last_event_id != (unsigned int)last_event ) { -// Why test for it, just set it... - last_event_id = shared_data->last_event_id; - //} - return( false ); + last_event_id = shared_data->last_event_id; + return false; } -Monitor::Monitor( - int p_id, - const char *p_name, - const unsigned int p_server_id, - const unsigned int p_storage_id, - int p_function, - bool p_enabled, - const char *p_linked_monitors, - Camera *p_camera, - int p_orientation, - unsigned int p_deinterlacing, - int p_savejpegs, - int p_colours, - VideoWriter p_videowriter, - std::string &p_encoderparams, - std::string &p_output_codec, - std::string &p_output_container, - bool p_record_audio, - const char *p_event_prefix, - const char *p_label_format, - const Coord &p_label_coord, - int p_label_size, - int p_image_buffer_count, - int p_warmup_count, - int p_pre_event_count, - int p_post_event_count, - int p_stream_replay_buffer, - int p_alarm_frame_count, - int p_section_length, - int p_frame_skip, - int p_motion_frame_skip, - double p_analysis_fps_limit, - unsigned int p_analysis_update_delay, - int p_capture_delay, - int p_alarm_capture_delay, - int p_fps_report_interval, - int p_ref_blend_perc, - int p_alarm_ref_blend_perc, - bool p_track_motion, - Rgb p_signal_check_colour, - bool p_embed_exif, - Purpose p_purpose, - int p_n_zones, - Zone *p_zones[] -) : id( p_id ), - server_id( p_server_id ), - storage_id( p_storage_id ), - function( (Function)p_function ), - enabled( p_enabled ), - width( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Height():p_camera->Width() ), - height( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Width():p_camera->Height() ), - orientation( (Orientation)p_orientation ), - deinterlacing( p_deinterlacing ), - savejpegspref( p_savejpegs ), - colours( p_colours ), - videowriter( p_videowriter ), - encoderparams( p_encoderparams ), - output_codec( p_output_codec ), - output_container( p_output_container ), - record_audio( p_record_audio ), - label_coord( p_label_coord ), - label_size( p_label_size ), - image_buffer_count( p_image_buffer_count ), - warmup_count( p_warmup_count ), - pre_event_count( p_pre_event_count ), - post_event_count( p_post_event_count ), - stream_replay_buffer( p_stream_replay_buffer ), - section_length( p_section_length ), - frame_skip( p_frame_skip ), - motion_frame_skip( p_motion_frame_skip ), - analysis_fps_limit( p_analysis_fps_limit ), - analysis_update_delay( p_analysis_update_delay ), - capture_delay( p_capture_delay ), - alarm_capture_delay( p_alarm_capture_delay ), - alarm_frame_count( p_alarm_frame_count ), - fps_report_interval( p_fps_report_interval ), - ref_blend_perc( p_ref_blend_perc ), - alarm_ref_blend_perc( p_alarm_ref_blend_perc ), - track_motion( p_track_motion ), - signal_check_colour( p_signal_check_colour ), - embed_exif( p_embed_exif ), - delta_image( width, height, ZM_COLOUR_GRAY8, ZM_SUBPIX_ORDER_NONE ), - ref_image( width, height, p_camera->Colours(), p_camera->SubpixelOrder() ), - purpose( p_purpose ), - last_motion_score(0), - camera( p_camera ), - n_zones( p_n_zones ), - zones( p_zones ), - timestamps( 0 ), - images( 0 ), - privacy_bitmask( NULL ) -{ - strncpy( name, p_name, sizeof(name)-1 ); +Monitor::Monitor() + : id(0), + name(""), + server_id(0), + storage_id(0), + type(LOCAL), + function(NONE), + enabled(0), + //protocol + //method + //options + //host + //port + //user + //pass + //path + //device + palette(0), + channel(0), + format(0), - strncpy( event_prefix, p_event_prefix, sizeof(event_prefix)-1 ); - strncpy( label_format, p_label_format, sizeof(label_format)-1 ); + width(0), + height(0), + //v4l_multi_buffer + //v4l_captures_per_frame + orientation(ROTATE_0), + deinterlacing(0), + deinterlacing_value(0), + videoRecording(0), + rtsp_describe(0), + + savejpegs(0), + colours(0), + videowriter(DISABLED), + encoderparams(""), + output_codec(""), + output_container(""), + record_audio(0), +//event_prefix +//label_format + label_coord(Coord(0,0)), + label_size(0), + image_buffer_count(0), + warmup_count(0), + pre_event_count(0), + post_event_count(0), + stream_replay_buffer(0), + section_length(0), + frame_skip(0), + motion_frame_skip(0), + analysis_fps_limit(0), + analysis_update_delay(0), + capture_delay(0), + alarm_capture_delay(0), + alarm_frame_count(0), + fps_report_interval(0), + ref_blend_perc(0), + alarm_ref_blend_perc(0), + track_motion(0), + signal_check_colour(0), + embed_exif(0), + purpose(QUERY), + auto_resume_time(0), + last_motion_score(0), + camera(0), + n_zones(0), + zones(NULL), + timestamps(0), + images(0), + privacy_bitmask( NULL ), + event_delete_thread(NULL), + n_linked_monitors(0), + linked_monitors(NULL) +{ + + if ( strcmp(config.event_close_mode, "time") == 0 ) + event_close_mode = CLOSE_TIME; + else if ( strcmp(config.event_close_mode, "alarm") == 0 ) + event_close_mode = CLOSE_ALARM; + else + event_close_mode = CLOSE_IDLE; + + start_time = last_fps_time = time( 0 ); + event = 0; + last_section_mod = 0; + + adaptive_skip = true; + + videoStore = NULL; +} // Monitor::Monitor + +/* + std::string load_monitor_sql = + "SELECT Id, Name, ServerId, StorageId, Type, Function+0, Enabled, LinkedMonitors, " + "AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS," + "Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, " // V4L Settings + "Protocol, Method, Options, User, Pass, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, RTSPDescribe, " + "SaveJPEGs, VideoWriter, EncoderParameters, +"OutputCodec, Encoder, OutputContainer," +" RecordAudio, " + "Brightness, Contrast, Hue, Colour, " + "EventPrefix, LabelFormat, LabelX, LabelY, LabelSize," + "ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, " + "SectionLength, FrameSkip, MotionFrameSkip, " + "FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif, SignalCheckColour FROM Monitors"; +*/ + +void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) { + purpose = p; + int col = 0; + + id = atoi(dbrow[col]); col++; + strncpy(name, dbrow[col], sizeof(name)-1); col++; + server_id = dbrow[col] ? atoi(dbrow[col]) : 0; col++; + + storage_id = atoi(dbrow[col]); col++; + storage = new Storage(storage_id); + Debug(1, "Storage path: %s", storage->Path() ); + + if ( ! strcmp(dbrow[col], "Local") ) { + type = LOCAL; + } else if ( ! strcmp(dbrow[col], "Ffmpeg") ) { + type = FFMPEG; + } else if ( ! strcmp(dbrow[col], "Remote") ) { + type = REMOTE; + } else if ( ! strcmp(dbrow[col], "File") ) { + type = FILE; + } else if ( ! strcmp(dbrow[col], "NVSocket") ) { + type = NVSOCKET; + } else if ( ! strcmp(dbrow[col], "Libvlc") ) { + type = LIBVLC; + } else if ( ! strcmp(dbrow[col], "cURL") ) { + type = CURL; + } else { + Fatal("Bogus monitor type '%s' for monitor %d", dbrow[col], id); + } + Debug(1,"Have camera type %s", CameraType_Strings[type].c_str()); + col++; + function = (Function)atoi(dbrow[col]); col++; + enabled = dbrow[col] ? atoi(dbrow[col]) : 0; col++; + + ReloadLinkedMonitors(dbrow[col]); col++; + + analysis_fps = dbrow[col] ? strtod(dbrow[col], NULL) : 0; col++; + analysis_update_delay = strtoul(dbrow[col++], NULL, 0); + capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + + if ( dbrow[col] ) + strncpy(device, dbrow[col], sizeof(device)-1); + else + device[0] = 0; + col++; + + channel = atoi(dbrow[col]); col++; + format = atoi(dbrow[col]); col++; + v4l_multi_buffer = config.v4l_multi_buffer; + if ( dbrow[col] ) { + if (*dbrow[col] == '0' ) { + v4l_multi_buffer = false; + } else if ( *dbrow[col] == '1' ) { + v4l_multi_buffer = true; + } + } + col++; + + v4l_captures_per_frame = 0; + if ( dbrow[col] ) { + v4l_captures_per_frame = atoi(dbrow[col]); + } else { + v4l_captures_per_frame = config.captures_per_frame; + } + col++; + + protocol = dbrow[col] ? dbrow[col] : ""; col++; + method = dbrow[col] ? dbrow[col] : ""; col++; + options = dbrow[col] ? dbrow[col] : ""; col++; + user = dbrow[col] ? dbrow[col] : ""; col++; + pass = dbrow[col] ? dbrow[col] : ""; col++; + host = dbrow[col] ? dbrow[col] : ""; col++; + port = dbrow[col] ? dbrow[col] : ""; col++; + path = dbrow[col] ? dbrow[col] : ""; col++; + + camera_width = atoi(dbrow[col]); col++; + camera_height = atoi(dbrow[col]); col++; + + colours = atoi(dbrow[col]); col++; + palette = atoi(dbrow[col]); col++; + orientation = (Orientation)atoi(dbrow[col]); col++; + width = (orientation==ROTATE_90||orientation==ROTATE_270) ? camera_height : camera_width; + height = (orientation==ROTATE_90||orientation==ROTATE_270) ? camera_width : camera_height; + + deinterlacing = atoi(dbrow[col]); col++; + deinterlacing_value = deinterlacing & 0xff; + + rtsp_describe = (dbrow[col] && *dbrow[col] != '0'); col++; + + savejpegs = atoi(dbrow[col]); col++; + videowriter = (VideoWriter)atoi(dbrow[col]); col++; + encoderparams = dbrow[col] ? dbrow[col] : ""; col++; + /* Parse encoder parameters */ + ParseEncoderParameters(encoderparams.c_str(), &encoderparamsvec); + + output_codec = dbrow[col] ? dbrow[col] : ""; col++; + output_container = dbrow[col] ? dbrow[col] : ""; col++; + record_audio = (*dbrow[col] != '0'); col++; + + brightness = atoi(dbrow[col]); col++; + contrast = atoi(dbrow[col]); col++; + hue = atoi(dbrow[col]); col++; + colour = atoi(dbrow[col]); col++; + + if ( dbrow[col] ) + strncpy(event_prefix, dbrow[col], sizeof(event_prefix)-1); + else + event_prefix[0] = 0; + col++; + + if ( dbrow[col] ) + strncpy(label_format, dbrow[col], sizeof(label_format)-1); + else + label_format[0] = 0; + col++; // Change \n to actual line feeds char *token_ptr = label_format; const char *token_string = "\n"; - while( ( token_ptr = strstr( token_ptr, token_string ) ) ) { + while( ( token_ptr = strstr(token_ptr, token_string) ) ) { if ( *(token_ptr+1) ) { *token_ptr = '\n'; token_ptr++; - strcpy( token_ptr, token_ptr+1 ); + strcpy(token_ptr, token_ptr+1); } else { *token_ptr = '\0'; break; } } - /* Parse encoder parameters */ - ParseEncoderParameters(encoderparams.c_str(), &encoderparamsvec); + label_coord = Coord(atoi(dbrow[col]), atoi(dbrow[col+1])); col += 2; + label_size = atoi(dbrow[col]); col++; + + image_buffer_count = atoi(dbrow[col]); col++; + warmup_count = atoi(dbrow[col]); col++; + pre_event_count = atoi(dbrow[col]); col++; + post_event_count = atoi(dbrow[col]); col++; + stream_replay_buffer = atoi(dbrow[col]); col++; + alarm_frame_count = atoi(dbrow[col]); col++; + if ( alarm_frame_count < 1 ) + alarm_frame_count = 1; + else if ( alarm_frame_count > MAX_PRE_ALARM_FRAMES ) + alarm_frame_count = MAX_PRE_ALARM_FRAMES; + pre_event_buffer_count = pre_event_count + alarm_frame_count + warmup_count - 1; + + section_length = atoi(dbrow[col]); col++; + frame_skip = atoi(dbrow[col]); col++; + motion_frame_skip = atoi(dbrow[col]); col++; + fps_report_interval = atoi(dbrow[col]); col++; + ref_blend_perc = atoi(dbrow[col]); col++; + alarm_ref_blend_perc = atoi(dbrow[col]); col++; + track_motion = atoi(dbrow[col]); col++; + + signal_check_colour = strtol(dbrow[col][0] == '#' ? dbrow[col]+1 : dbrow[col], 0, 16); col++; + embed_exif = (*dbrow[col] != '0'); col++; capture_fps = 0.0; analysis_fps = 0.0; event_count = 0; image_count = 0; analysis_image_count = 0; - deinterlacing_value = deinterlacing & 0xff; // How many frames we need to have before we start analysing ready_count = warmup_count; @@ -362,129 +534,223 @@ Monitor::Monitor( state = IDLE; last_signal = false; - if ( alarm_frame_count < 1 ) - alarm_frame_count = 1; - else if ( alarm_frame_count > MAX_PRE_ALARM_FRAMES ) - alarm_frame_count = MAX_PRE_ALARM_FRAMES; - - auto_resume_time = 0; - - if ( strcmp( config.event_close_mode, "time" ) == 0 ) - event_close_mode = CLOSE_TIME; - else if ( strcmp( config.event_close_mode, "alarm" ) == 0 ) - event_close_mode = CLOSE_ALARM; - else - event_close_mode = CLOSE_IDLE; - - Debug( 1, "monitor purpose=%d", purpose ); - + camera = NULL; mem_size = sizeof(SharedData) + sizeof(TriggerData) + sizeof(VideoStoreData) //Information to pass back to the capture process - + (image_buffer_count*sizeof(struct timeval)) - + (image_buffer_count*camera->ImageSize()) + + (image_buffer_count * sizeof(struct timeval)) + + (image_buffer_count * width * height * colours) + 64; /* Padding used to permit aligning the images buffer to 64 byte boundary */ - Debug( 1, "mem.size=%d", mem_size ); + Debug(1, "mem.size=%d", mem_size); mem_ptr = NULL; - storage = new Storage( storage_id ); - Debug(1, "Storage path: %s", storage->Path() ); - // Should maybe store this for later use - char monitor_dir[PATH_MAX] = ""; - snprintf( monitor_dir, sizeof(monitor_dir), "%s/%d", storage->Path(), id ); - struct stat statbuf; + Zone **zones = 0; + int n_zones = Zone::Load(this, zones); + this->AddZones(n_zones, zones); + this->AddPrivacyBitmask(zones); - // If we are going to actually do capture, then yes, we should stat this dir, otherwise not - if ( stat( monitor_dir, &statbuf ) ) { - if ( errno == ENOENT || errno == ENOTDIR ) { - if ( mkdir( monitor_dir, 0755 ) ) { - Error( "Can't mkdir %s: %s", monitor_dir, strerror(errno)); - } - } else { - Warning( "Error stat'ing %s, may be fatal. error is %s", monitor_dir, strerror(errno)); - } - } + //this0>delta_image( width, height, ZM_COLOUR_GRAY8, ZM_SUBPIX_ORDER_NONE ), + //ref_image( width, height, p_camera->Colours(), p_camera->SubpixelOrder() ), + Debug(1, "Loaded monitor %d(%s), %d zones", id, name, n_zones); +} // Monitor::Load - if ( purpose == CAPTURE ) { +Camera * Monitor::getCamera() { + if ( camera ) + return camera; - if ( ! this->connect() ) { - Error("unable to connect, but doing capture"); - exit(-1); - } - memset( mem_ptr, 0, mem_size ); - shared_data->size = sizeof(SharedData); - Debug( 1, "shared.size=%d", shared_data->size ); - shared_data->active = enabled; - shared_data->signal = false; - shared_data->state = IDLE; - shared_data->last_write_index = image_buffer_count; - shared_data->last_read_index = image_buffer_count; - shared_data->last_write_time = 0; - shared_data->last_event_id = 0; - shared_data->action = (Action)0; - shared_data->brightness = -1; - shared_data->hue = -1; - shared_data->colour = -1; - shared_data->contrast = -1; - shared_data->alarm_x = -1; - shared_data->alarm_y = -1; - shared_data->format = camera->SubpixelOrder(); - shared_data->imagesize = camera->ImageSize(); - trigger_data->size = sizeof(TriggerData); - trigger_data->trigger_state = TRIGGER_CANCEL; - trigger_data->trigger_score = 0; - trigger_data->trigger_cause[0] = 0; - trigger_data->trigger_text[0] = 0; - trigger_data->trigger_showtext[0] = 0; - shared_data->valid = true; - video_store_data->recording = (struct timeval){0}; - // Uh, why nothing? Why not NULL? - snprintf(video_store_data->event_file, sizeof(video_store_data->event_file), "nothing"); - video_store_data->size = sizeof(VideoStoreData); - //video_store_data->frameNumber = 0; - } + if ( type == LOCAL ) { - //if ( ( ! mem_ptr ) || ! shared_data->valid ) { - //if ( purpose != QUERY ) { - //Error( "Shared data not initialised by capture daemon for monitor %s", name ); - //exit( -1 ); - //} - //} + int extras = (deinterlacing>>24)&0xff; - start_time = last_fps_time = time( 0 ); - - event = 0; - last_section_mod = 0; - pre_event_buffer_count = pre_event_count + alarm_frame_count + warmup_count- 1; - - Debug( 1, "Monitor %s\ - function: %d\ - label_format: '%s', label_x = %d, label_y = %d, label size = %d \ - IBC = %d, WUC = %d, pEC = %d, PEC = %d, EAF = %d, FRI = %d, RBP = %d, ARBP = %d, FM = %d", - name, - function, label_format, label_coord.X(), label_coord.Y(), label_size, - image_buffer_count, warmup_count, - pre_event_count, post_event_count, alarm_frame_count, - fps_report_interval, ref_blend_perc, alarm_ref_blend_perc, track_motion + camera = new LocalCamera( + id, + device, + channel, + format, + v4l_multi_buffer, + v4l_captures_per_frame, + method, + camera_width, + camera_height, + colours, + palette, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE, + record_audio, + extras + ); + } else if ( type == REMOTE ) { + if ( protocol == "http" ) { + camera = new RemoteCameraHttp( + id, + method, + host, + port, + path, + camera_width, + camera_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE, + record_audio ); + } +#if HAVE_LIBAVFORMAT + else if ( protocol == "rtsp" ) { + camera = new RemoteCameraRtsp( + id, + method, + host, // Host + port, // Port + path, // Path + camera_width, + camera_height, + rtsp_describe, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE, + record_audio + ); + } +#endif // HAVE_LIBAVFORMAT + else { + Error( "Unexpected remote camera protocol '%s'", protocol.c_str() ); + } + } else if ( type == FILE ) { + camera = new FileCamera( + id, + path.c_str(), + camera_width, + camera_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE, + record_audio + ); + } else if ( type == FFMPEG ) { +#if HAVE_LIBAVFORMAT + camera = new FfmpegCamera( + id, + path, + method, + options, + camera_width, + camera_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE, + record_audio + ); +#endif // HAVE_LIBAVFORMAT + } else if ( type == NVSOCKET ) { + camera = new RemoteCameraNVSocket( + id, + host.c_str(), + port.c_str(), + path.c_str(), + camera_width, + camera_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE, + record_audio + ); + } else if ( type == LIBVLC ) { +#if HAVE_LIBVLC + camera = new LibvlcCamera( + id, + path.c_str(), + method, + options, + camera_width, + camera_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE, + record_audio + ); +#else // HAVE_LIBVLC + Error( "You must have vlc libraries installed to use vlc cameras for monitor %d", id ); +#endif // HAVE_LIBVLC + } else if ( type == CURL ) { +#if HAVE_LIBCURL + camera = new cURLCamera( + id, + path.c_str(), + user.c_str(), + pass.c_str(), + camera_width, + camera_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE, + record_audio + ); +#else // HAVE_LIBCURL + Error("You must have libcurl installed to use ffmpeg cameras for monitor %d", id); +#endif // HAVE_LIBCURL + } // end if type - n_linked_monitors = 0; - linked_monitors = 0; + camera->setMonitor(this); +} // end Monitor::getCamera - adaptive_skip = true; +Monitor *Monitor::Load(unsigned int p_id, bool load_zones, Purpose purpose) { + std::string sql = load_monitor_sql + stringtf(" WHERE Id=%d", p_id); - ReloadLinkedMonitors( p_linked_monitors ); - videoStore = NULL; -} // Monitor::Monitor + zmDbRow dbrow; + if ( !dbrow.fetch(sql.c_str()) ) { + Error("Can't use query result: %s", mysql_error(&dbconn)); + return NULL; + } + Monitor *monitor = new Monitor(); + monitor->Load(dbrow.mysql_row(),load_zones,purpose); + if ( purpose == CAPTURE ) { + Debug(1,"Connecting"); + if ( ! ( + monitor->getCamera() + && + monitor->connect() + ) ) { + delete monitor; + return NULL; + } + } + + return monitor; +} // end Monitor *Monitor::Load(unsigned int p_id, bool load_zones, Purpose purpose) bool Monitor::connect() { - Debug(3, "Connecting to monitor. Purpose is %d", purpose ); + Debug(3, "Connecting to monitor. Purpose is %d", purpose ); #if ZM_MEM_MAPPED - snprintf( mem_file, sizeof(mem_file), "%s/zm.mmap.%d", staticConfig.PATH_MAP.c_str(), id ); - map_fd = open( mem_file, O_RDWR|O_CREAT, (mode_t)0600 ); + snprintf(mem_file, sizeof(mem_file), "%s/zm.mmap.%d", staticConfig.PATH_MAP.c_str(), id); + map_fd = open(mem_file, O_RDWR|O_CREAT, (mode_t)0600); if ( map_fd < 0 ) { - Fatal( "Can't open memory map file %s, probably not enough space free: %s", mem_file, strerror(errno) ); + Fatal("Can't open memory map file %s, probably not enough space free: %s", mem_file, strerror(errno)); } else { Debug(3, "Success opening mmap file at (%s)", mem_file ); } @@ -508,19 +774,19 @@ bool Monitor::connect() { } } - Debug(3, "MMap file size is %ld", map_stat.st_size ); + Debug(3, "MMap file size is %ld", map_stat.st_size); #ifdef MAP_LOCKED - mem_ptr = (unsigned char *)mmap( NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED, map_fd, 0 ); + mem_ptr = (unsigned char *)mmap(NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED, map_fd, 0); if ( mem_ptr == MAP_FAILED ) { if ( errno == EAGAIN ) { - Debug( 1, "Unable to map file %s (%d bytes) to locked memory, trying unlocked", mem_file, mem_size ); + Debug(1, "Unable to map file %s (%d bytes) to locked memory, trying unlocked", mem_file, mem_size); #endif - mem_ptr = (unsigned char *)mmap( NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED, map_fd, 0 ); - Debug( 1, "Mapped file %s (%d bytes) to unlocked memory", mem_file, mem_size ); + mem_ptr = (unsigned char *)mmap(NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED, map_fd, 0); + Debug(1, "Mapped file %s (%d bytes) to unlocked memory", mem_file, mem_size); #ifdef MAP_LOCKED } else { - Error( "Unable to map file %s (%d bytes) to locked memory (%s)", mem_file, mem_size , strerror(errno) ); + Error("Unable to map file %s (%d bytes) to locked memory (%s)", mem_file, mem_size , strerror(errno)); } } #endif @@ -571,6 +837,47 @@ bool Monitor::connect() { next_buffer.image = new Image( width, height, camera->Colours(), camera->SubpixelOrder()); } + if ( purpose == CAPTURE ) { + memset( mem_ptr, 0, mem_size ); + shared_data->size = sizeof(SharedData); + Debug( 1, "shared.size=%d", shared_data->size ); + shared_data->active = enabled; + shared_data->signal = false; + shared_data->state = IDLE; + shared_data->last_write_index = image_buffer_count; + shared_data->last_read_index = image_buffer_count; + shared_data->last_write_time = 0; + shared_data->last_event_id = 0; + shared_data->action = (Action)0; + shared_data->brightness = -1; + shared_data->hue = -1; + shared_data->colour = -1; + shared_data->contrast = -1; + shared_data->alarm_x = -1; + shared_data->alarm_y = -1; + shared_data->format = camera->SubpixelOrder(); + shared_data->imagesize = camera->ImageSize(); + shared_data->alarm_cause[0] = 0; + trigger_data->size = sizeof(TriggerData); + trigger_data->trigger_state = TRIGGER_CANCEL; + trigger_data->trigger_score = 0; + trigger_data->trigger_cause[0] = 0; + trigger_data->trigger_text[0] = 0; + trigger_data->trigger_showtext[0] = 0; + shared_data->valid = true; + video_store_data->recording = (struct timeval){0}; + // Uh, why nothing? Why not NULL? + snprintf(video_store_data->event_file, sizeof(video_store_data->event_file), "nothing"); + video_store_data->size = sizeof(VideoStoreData); + //video_store_data->frameNumber = 0; + } + if ( ( ! mem_ptr ) || ! shared_data->valid ) { + if ( purpose != QUERY ) { + Error("Shared data not initialised by capture daemon for monitor %s", name); + exit(-1); + } + } + Debug(3, "Success connecting"); return true; } // Monitor::connect @@ -597,8 +904,15 @@ Monitor::~Monitor() { } if ( mem_ptr ) { if ( event ) { - Info( "%s: image_count:%d - Closing event %d, shutting down", name, image_count, event->Id() ); + Info( "%s: image_count:%d - Closing event %llu, shutting down", name, image_count, event->Id() ); closeEvent(); + + // closeEvent may start another thread to close the event, so wait for it to finish + if ( event_delete_thread ) { + event_delete_thread->join(); + delete event_delete_thread; + event_delete_thread = NULL; + } } if ( deinterlacing_value == 4 ) { @@ -691,7 +1005,7 @@ void Monitor::AddPrivacyBitmask( Zone *p_zones[] ) { } Monitor::State Monitor::GetState() const { - return( (State)shared_data->state ); + return (State)shared_data->state; } int Monitor::GetImage( int index, int scale ) { @@ -724,16 +1038,16 @@ Debug(3, "GetImage"); static char filename[PATH_MAX]; snprintf( filename, sizeof(filename), "Monitor%d.jpg", id ); - image->WriteJpeg( filename ); + image->WriteJpeg(filename); } else { Error( "Unable to generate image, no images in buffer" ); } - return( 0 ); + return 0; } -ZMPacket *Monitor::getSnapshot( int index ) { +ZMPacket *Monitor::getSnapshot(int index) const { - if ( index < 0 || index > image_buffer_count ) { + if ( (index < 0) || (index > image_buffer_count) ) { index = shared_data->last_write_index; } return &image_buffer[index]; @@ -741,8 +1055,8 @@ ZMPacket *Monitor::getSnapshot( int index ) { return NULL; } -struct timeval Monitor::GetTimestamp( int index ) { - ZMPacket *packet = getSnapshot( index ); +struct timeval Monitor::GetTimestamp(int index) const { + ZMPacket *packet = getSnapshot(index); if ( packet ) return *packet->timestamp; @@ -758,8 +1072,8 @@ unsigned int Monitor::GetLastWriteIndex() const { return( shared_data->last_write_index!=(unsigned int)image_buffer_count?shared_data->last_write_index:-1 ); } -uint32_t Monitor::GetLastEventId() const { - Debug(2, "mem_ptr(%x), size(%d) State(%d) last_read_index(%d) last_read_time(%d) last_event(%d)", +uint64_t Monitor::GetLastEventId() const { + Debug(2, "mem_ptr(%x), size(%d) State(%d) last_read_index(%d) last_read_time(%d) last_event(%llu)", mem_ptr, shared_data->size, shared_data->state, @@ -767,7 +1081,7 @@ uint32_t Monitor::GetLastEventId() const { shared_data->last_read_time, shared_data->last_event_id ); - return( shared_data->last_event_id ); + return shared_data->last_event_id; } // This function is crap. @@ -874,10 +1188,10 @@ void Monitor::actionEnable() { shared_data->action |= RELOAD; static char sql[ZM_SQL_SML_BUFSIZ]; - snprintf( sql, sizeof(sql), "update Monitors set Enabled = 1 where Id='%d'", id ); + snprintf(sql, sizeof(sql), "UPDATE Monitors SET Enabled = 1 WHERE Id = %d", id); db_mutex.lock(); - if ( mysql_query( &dbconn, sql ) ) { - Error( "Can't run query: %s", mysql_error( &dbconn ) ); + if ( mysql_query(&dbconn, sql) ) { + Error("Can't run query: %s", mysql_error(&dbconn)); } db_mutex.unlock(); } @@ -886,10 +1200,10 @@ void Monitor::actionDisable() { shared_data->action |= RELOAD; static char sql[ZM_SQL_SML_BUFSIZ]; - snprintf( sql, sizeof(sql), "update Monitors set Enabled = 0 where Id='%d'", id ); + snprintf(sql, sizeof(sql), "update Monitors set Enabled = 0 where Id = %d", id); db_mutex.lock(); - if ( mysql_query( &dbconn, sql ) ) { - Error( "Can't run query: %s", mysql_error( &dbconn ) ); + if ( mysql_query(&dbconn, sql) ) { + Error("Can't run query: %s", mysql_error(&dbconn)); } db_mutex.unlock(); } @@ -1032,8 +1346,8 @@ void Monitor::DumpZoneImage( const char *zone_string ) { Polygon extra_zone; if ( zone_string ) { - if ( !Zone::ParseZoneString( zone_string, exclude_id, extra_colour, extra_zone ) ) { - Error( "Failed to parse zone string, ignoring" ); + if ( !Zone::ParseZoneString(zone_string, exclude_id, extra_colour, extra_zone) ) { + Error("Failed to parse zone string, ignoring"); } } @@ -1042,29 +1356,31 @@ void Monitor::DumpZoneImage( const char *zone_string ) { Debug(3, "Trying to load from local zmc"); int index = shared_data->last_write_index; ZMPacket *snap = getSnapshot(index); - zone_image = new Image( *snap->image ); + zone_image = new Image(*snap->image); } else { Debug(3, "Trying to load from event"); // Grab the most revent event image - std::string sql = stringtf( "SELECT MAX(Id) FROM Events WHERE MonitorId=%d AND Frames > 0", id ); + std::string sql = stringtf("SELECT MAX(Id) FROM Events WHERE MonitorId=%d AND Frames > 0", id); zmDbRow eventid_row; - if ( eventid_row.fetch( sql.c_str() ) ) { - int event_id = atoi( eventid_row[0] ); + if ( eventid_row.fetch(sql.c_str()) ) { + uint64_t event_id = atoll(eventid_row[0]); - Debug( 3, "Got event %d", event_id ); + Debug(3, "Got event %llu", event_id); EventStream *stream = new EventStream(); - stream->setStreamStart( event_id, (unsigned int)1 ); + stream->setStreamStart(event_id, (unsigned int)1); zone_image = stream->getImage(); + delete stream; + stream = NULL; } else { - Error("Unable to load an event for monitor %d", id ); + Error("Unable to load an event for monitor %d", id); return; } } - if(zone_image->Colours() == ZM_COLOUR_GRAY8) { - zone_image->Colourise(ZM_COLOUR_RGB24, ZM_SUBPIX_ORDER_RGB ); + if ( zone_image->Colours() == ZM_COLOUR_GRAY8 ) { + zone_image->Colourise(ZM_COLOUR_RGB24, ZM_SUBPIX_ORDER_RGB); } - + for( int i = 0; i < n_zones; i++ ) { if ( exclude_id && (!extra_colour || extra_zone.getNumCoords()) && zones[i]->Id() == exclude_id ) continue; @@ -1117,7 +1433,7 @@ bool Monitor::CheckSignal( const Image *image ) { static uint8_t red_val; static uint8_t green_val; static uint8_t blue_val; - static uint8_t grayscale_val; /* 8bit grayscale color */ + static uint8_t grayscale_val; /* 8bit grayscale color */ static Rgb colour_val; /* RGB32 color */ static int usedsubpixorder; @@ -1148,15 +1464,15 @@ bool Monitor::CheckSignal( const Image *image ) { if ( index < (label_coord.Y()*width) || index >= (label_coord.Y()+Image::LINE_HEIGHT)*width ) break; } - - if(colours == ZM_COLOUR_GRAY8) { + + if ( colours == ZM_COLOUR_GRAY8 ) { if ( *(buffer+index) != grayscale_val ) return true; - } else if(colours == ZM_COLOUR_RGB24) { + } else if ( colours == ZM_COLOUR_RGB24 ) { const uint8_t *ptr = buffer+(index*colours); - if ( usedsubpixorder == ZM_SUBPIX_ORDER_BGR) { + if ( usedsubpixorder == ZM_SUBPIX_ORDER_BGR ) { if ( (RED_PTR_BGRA(ptr) != red_val) || (GREEN_PTR_BGRA(ptr) != green_val) || (BLUE_PTR_BGRA(ptr) != blue_val) ) return true; } else { @@ -1166,7 +1482,7 @@ bool Monitor::CheckSignal( const Image *image ) { } } else if ( colours == ZM_COLOUR_RGB32 ) { - if ( usedsubpixorder == ZM_SUBPIX_ORDER_ARGB || usedsubpixorder == ZM_SUBPIX_ORDER_ABGR) { + if ( usedsubpixorder == ZM_SUBPIX_ORDER_ARGB || usedsubpixorder == ZM_SUBPIX_ORDER_ABGR ) { if ( ARGB_ABGR_ZEROALPHA(*(((const Rgb*)buffer)+index)) != ARGB_ABGR_ZEROALPHA(colour_val) ) return true; } else { @@ -1175,30 +1491,30 @@ bool Monitor::CheckSignal( const Image *image ) { return true; } } - } - return( false ); - } - return( true ); + } // end for < signal_check_points + return false; + } // end if signal_check_points + return true; } void Monitor::CheckAction() { struct timeval now; - gettimeofday( &now, NULL ); + gettimeofday(&now, NULL); if ( shared_data->action ) { // Can there be more than 1 bit set in the action? Shouldn't these be elseifs? if ( shared_data->action & RELOAD ) { - Info( "Received reload indication at count %d", image_count ); + Info("Received reload indication at count %d", image_count); shared_data->action &= ~RELOAD; Reload(); } if ( shared_data->action & SUSPEND ) { if ( Active() ) { - Info( "Received suspend indication at count %d", image_count ); + Info("Received suspend indication at count %d", image_count); shared_data->active = false; //closeEvent(); } else { - Info( "Received suspend indication at count %d, but wasn't active", image_count ); + Info("Received suspend indication at count %d, but wasn't active", image_count); } if ( config.max_suspend_time ) { auto_resume_time = now.tv_sec + config.max_suspend_time; @@ -1206,7 +1522,7 @@ void Monitor::CheckAction() { shared_data->action &= ~SUSPEND; } else if ( shared_data->action & RESUME ) { if ( Enabled() && !Active() ) { - Info( "Received resume indication at count %d", image_count ); + Info("Received resume indication at count %d", image_count); shared_data->active = true; ref_image = *(image_buffer[shared_data->last_write_index].image); ready_count = image_count+(warmup_count/2); @@ -1217,7 +1533,7 @@ void Monitor::CheckAction() { } // end if shared_data->action if ( auto_resume_time && (now.tv_sec >= auto_resume_time) ) { - Info( "Auto resuming at count %d", image_count ); + Info("Auto resuming at count %d", image_count); shared_data->active = true; ref_image = *(image_buffer[shared_data->last_write_index].image); ready_count = image_count+(warmup_count/2); @@ -1398,7 +1714,7 @@ bool Monitor::Analyse() { Debug( 3, "Section length (%d) Last Section Mod(%d), tv_sec(%d) new section mod(%d)", section_length, last_section_mod, timestamp->tv_sec, section_mod ); // This is not clear, but basically due to pauses, etc we might not get section_mod == 0 if ( ( section_mod < last_section_mod ) && ( timestamp->tv_sec >= 10 ) ) { - Info( "%s: %03d - Closing event %d, section end forced ", name, analysis_image_count, event->Id() ); + Info( "%s: %03d - Closing event %llu, section end forced ", name, analysis_image_count, event->Id() ); closeEvent(); last_section_mod = 0; } else { @@ -1412,7 +1728,7 @@ bool Monitor::Analyse() { event = new Event( this, *timestamp, "Continuous", noteSetMap ); shared_data->last_event_id = event->Id(); video_store_data->recording = event->StartTime(); - Info( "%s: %03d - Opening new event %d, section start", name, analysis_image_count, event->Id() ); + Info( "%s: %03d - Opening new event %llu, section start", name, analysis_image_count, event->Id() ); /* To prevent cancelling out an existing alert\prealarm\alarm state */ if ( state == IDLE ) { shared_data->state = state = TAPE; @@ -1445,11 +1761,11 @@ bool Monitor::Analyse() { shared_data->state = state = ALERT; } else if ( state == ALERT ) { if ( analysis_image_count-last_alarm_count > post_event_count ) { - Info( "%s: %03d - Left alarm state (%d) - %d(%d) images", name, analysis_image_count, event->Id(), event->Frames(), event->AlarmFrames() ); + Info( "%s: %03d - Left alarm state (%llu) - %d(%d) images", name, analysis_image_count, event->Id(), event->Frames(), event->AlarmFrames() ); //if ( function != MOCORD || event_close_mode == CLOSE_ALARM || event->Cause() == SIGNAL_CAUSE ) if ( (function != RECORD && function != MOCORD ) || event_close_mode == CLOSE_ALARM ) { shared_data->state = state = IDLE; - Info( "%s: %03d - Closing event %d, alarm end%s", name, analysis_image_count, event->Id(), (function==MOCORD)?", section truncated":"" ); + Info( "%s: %03d - Closing event %llu, alarm end%s", name, analysis_image_count, event->Id(), (function==MOCORD)?", section truncated":"" ); closeEvent(); } else { shared_data->state = state = TAPE; @@ -1519,7 +1835,7 @@ bool Monitor::Analyse() { } else { Debug(3, "trigger == off"); if ( event ) { - Info( "%s: %03d - Closing event %d, trigger off", name, analysis_image_count, event->Id() ); + Info( "%s: %03d - Closing event %llu, trigger off", name, analysis_image_count, event->Id() ); closeEvent(); } shared_data->state = state = IDLE; @@ -1534,16 +1850,16 @@ bool Monitor::Analyse() { // We can't just loop here forever, because we may be capturing just as fast, and never leave the loop. // Only loop until we hit the analysis index while ( ( queued_packet = packetqueue->popPacket() ) ) { - Debug(2,"adding packet (%d) qp last_write_index(%d), written(%d)", queued_packet->image_index, last_write, written ); if ( snap == queued_packet ) { - event->AddPacket( queued_packet ); + Debug(2,"adding snap packet (%d) qp last_write_index(%d), written(%d)", queued_packet->image_index, last_write, written ); + event->AddPacket(queued_packet); // Pop may have already incrememented it //packetqueue->increment_analysis_it(); break; } else { queued_packet->lock(); - Debug(2,"adding packet (%d) qp last_write_index(%d), written(%d)", queued_packet->image_index, last_write, written ); - event->AddPacket( queued_packet ); + Debug(2,"adding queued packet (%d) qp last_write_index(%d), written(%d)", queued_packet->image_index, last_write, written ); + event->AddPacket(queued_packet); queued_packet->unlock(); } written ++; @@ -1570,79 +1886,19 @@ bool Monitor::Analyse() { } // end Monitor::Analyze void Monitor::Reload() { - Debug( 1, "Reloading monitor %s", name ); + Debug(1, "Reloading monitor %s", name); - if ( event ) - Info( "%s: %03d - Closing event %d, reloading", name, image_count, event->Id() ); - - closeEvent(); - - static char sql[ZM_SQL_MED_BUFSIZ]; - // This seems to have fallen out of date. - snprintf( sql, sizeof(sql), "select Function+0, Enabled, LinkedMonitors, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Id = '%d'", id ); - - db_mutex.lock(); - if ( mysql_query( &dbconn, sql ) ) { - Error( "Can't run query: %s", mysql_error( &dbconn ) ); - db_mutex.unlock(); - exit( mysql_errno( &dbconn ) ); + if ( event ) { + Info("%s: %03d - Closing event %llu, reloading", name, image_count, event->Id()); + closeEvent(); } - MYSQL_RES *result = mysql_store_result( &dbconn ); - db_mutex.unlock(); - if ( !result ) { - Error( "Can't use query result: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); - } - int n_monitors = mysql_num_rows( result ); - if ( n_monitors != 1 ) { - Error( "Bogus number of monitors, %d, returned. Can't reload", n_monitors ); - return; - } - - if ( MYSQL_ROW dbrow = mysql_fetch_row( result ) ) { - int index = 0; - function = (Function)atoi(dbrow[index++]); - enabled = atoi(dbrow[index++]); - const char *p_linked_monitors = dbrow[index++]; - - if ( dbrow[index] ) { - strncpy( event_prefix, dbrow[index++], sizeof(event_prefix)-1 ); - } else { - event_prefix[0] = 0; - index++; - } - if ( dbrow[index] ) { - strncpy( label_format, dbrow[index++], sizeof(label_format)-1 ); - } else { - label_format[0] = 0; - index++; - } - - label_coord = Coord( atoi(dbrow[index]), atoi(dbrow[index+1]) ); index += 2; - label_size = atoi(dbrow[index++]); - warmup_count = atoi(dbrow[index++]); - pre_event_count = atoi(dbrow[index++]); - post_event_count = atoi(dbrow[index++]); - alarm_frame_count = atoi(dbrow[index++]); - section_length = atoi(dbrow[index++]); - frame_skip = atoi(dbrow[index++]); - motion_frame_skip = atoi(dbrow[index++]); - analysis_fps = dbrow[index] ? strtod(dbrow[index], NULL) : 0; index++; - analysis_update_delay = strtoul(dbrow[index++], NULL, 0); - capture_delay = (dbrow[index]&&atof(dbrow[index])>0.0)?int(DT_PREC_3/atof(dbrow[index])):0; index++; - alarm_capture_delay = (dbrow[index]&&atof(dbrow[index])>0.0)?int(DT_PREC_3/atof(dbrow[index])):0; index++; - fps_report_interval = atoi(dbrow[index++]); - ref_blend_perc = atoi(dbrow[index++]); - alarm_ref_blend_perc = atoi(dbrow[index++]); - track_motion = atoi(dbrow[index++]); - - - if ( dbrow[index][0] == '#' ) - signal_check_colour = strtol(dbrow[index]+1,0,16); - else - signal_check_colour = strtol(dbrow[index],0,16); - index++; + std::string sql = load_monitor_sql + stringtf(" WHERE Id=%d", id); + zmDbRow *row = zmDbFetchOne(sql.c_str()); + if ( !row ) { + Error("Can't run query: %s", mysql_error(&dbconn)); + } else if ( MYSQL_ROW dbrow = row->mysql_row() ) { + Load(dbrow,1,purpose); shared_data->state = state = IDLE; shared_data->alarm_x = shared_data->alarm_y = -1; @@ -1650,30 +1906,25 @@ void Monitor::Reload() { shared_data->active = true; ready_count = image_count+warmup_count; - ReloadLinkedMonitors( p_linked_monitors ); - } - if ( mysql_errno( &dbconn ) ) { - Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); - } - mysql_free_result( result ); + delete row; + } // end if row ReloadZones(); -} +} // void Monitor::Reload() void Monitor::ReloadZones() { - Debug( 1, "Reloading zones for monitor %s", name ); + Debug(1, "Reloading zones for monitor %s", name); for( int i = 0; i < n_zones; i++ ) { delete zones[i]; } delete[] zones; zones = 0; - n_zones = Zone::Load( this, zones ); + n_zones = Zone::Load(this, zones); //DumpZoneImage(); } -void Monitor::ReloadLinkedMonitors( const char *p_linked_monitors ) { - Debug( 1, "Reloading linked monitors for monitor %s, '%s'", name, p_linked_monitors ); +void Monitor::ReloadLinkedMonitors(const char *p_linked_monitors) { + Debug(1, "Reloading linked monitors for monitor %s, '%s'", name, p_linked_monitors); if ( n_linked_monitors ) { for( int i = 0; i < n_linked_monitors; i++ ) { delete linked_monitors[i]; @@ -1760,1036 +2011,79 @@ void Monitor::ReloadLinkedMonitors( const char *p_linked_monitors ) { } } -#if ZM_HAS_V4L -int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose purpose ) { - std::string sql = "select Id, Name, ServerId, StorageId, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, SaveJPEGs, VideoWriter, EncoderParameters, OutputCodec, OutputContainer, RecordAudio, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour, Exif from Monitors where Function != 'None' and Type = 'Local'"; -; - if ( device[0] ) { - sql += " AND Device='"; - sql += device; - sql += "'"; - } - if ( staticConfig.SERVER_ID ) { - sql += stringtf( " AND ServerId=%d", staticConfig.SERVER_ID ); - } - Debug( 1, "Loading Local Monitors with %s", sql.c_str() ); +int Monitor::LoadMonitors(std::string sql, Monitor **&monitors, Purpose purpose) { - MYSQL_RES *result = zmDbFetch( sql.c_str() ); + Debug(1, "Loading Monitors with %s", sql.c_str()); + + MYSQL_RES *result = zmDbFetch(sql.c_str()); if ( !result ) { - Error( "Can't load local monitors: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); + Error("Can't load local monitors: %s", mysql_error(&dbconn)); + return 0; } - int n_monitors = mysql_num_rows( result ); + int n_monitors = mysql_num_rows(result); Debug( 1, "Got %d monitors", n_monitors ); delete[] monitors; monitors = new Monitor *[n_monitors]; - for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) { - int col = 0; - - int id = atoi(dbrow[col]); col++; - const char *name = dbrow[col]; col++; - unsigned int server_id = dbrow[col] ? atoi(dbrow[col]) : 0; col++; - unsigned int storage_id = atoi(dbrow[col]); col++; - int function = atoi(dbrow[col]); col++; - int enabled = atoi(dbrow[col]); col++; - const char *linked_monitors = dbrow[col]; col++; - - const char *device = dbrow[col]; col++; - int channel = atoi(dbrow[col]); col++; - int format = atoi(dbrow[col]); col++; - bool v4l_multi_buffer = config.v4l_multi_buffer; - if ( dbrow[col] ) { - if (*dbrow[col] == '0' ) { - v4l_multi_buffer = false; - } else if ( *dbrow[col] == '1' ) { - v4l_multi_buffer = true; - } - } - col++; - - int v4l_captures_per_frame = 0; - if ( dbrow[col] ) { - v4l_captures_per_frame = atoi(dbrow[col]); - } else { - v4l_captures_per_frame = config.captures_per_frame; - } - Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame ); - col++; - const char *method = dbrow[col] ? dbrow[col] : ""; col++; - - int width = atoi(dbrow[col]); col++; - int height = atoi(dbrow[col]); col++; - int colours = atoi(dbrow[col]); col++; - int palette = atoi(dbrow[col]); col++; - Orientation orientation = (Orientation)atoi(dbrow[col]); col++; - unsigned int deinterlacing = atoi(dbrow[col]); col++; - - int savejpegs = atoi(dbrow[col]); col++; - VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++; - std::string encoderparams = dbrow[col] ? dbrow[col] : ""; col++; - std::string output_codec = dbrow[col] ? dbrow[col] : ""; col++; - std::string output_container = dbrow[col] ? dbrow[col] : ""; col++; - bool record_audio = (*dbrow[col] != '0'); col++; - - int brightness = atoi(dbrow[col]); col++; - int contrast = atoi(dbrow[col]); col++; - int hue = atoi(dbrow[col]); col++; - int colour = atoi(dbrow[col]); col++; - - const char *event_prefix = dbrow[col] ? dbrow[col] : ""; col++; - const char *label_format = dbrow[col] ? dbrow[col] : ""; col++; - - int label_x = atoi(dbrow[col]); col++; - int label_y = atoi(dbrow[col]); col++; - int label_size = atoi(dbrow[col]); col++; - - int image_buffer_count = atoi(dbrow[col]); col++; - int warmup_count = atoi(dbrow[col]); col++; - int pre_event_count = atoi(dbrow[col]); col++; - int post_event_count = atoi(dbrow[col]); col++; - int stream_replay_buffer = atoi(dbrow[col]); col++; - int alarm_frame_count = atoi(dbrow[col]); col++; - int section_length = atoi(dbrow[col]); col++; - int frame_skip = atoi(dbrow[col]); col++; - int motion_frame_skip = atoi(dbrow[col]); col++; - double analysis_fps = dbrow[col] ? strtod(dbrow[col], NULL) : 0; col++; - unsigned int analysis_update_delay = strtoul(dbrow[col++], NULL, 0); - int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; - int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; - int fps_report_interval = atoi(dbrow[col]); col++; - int ref_blend_perc = atoi(dbrow[col]); col++; - int alarm_ref_blend_perc = atoi(dbrow[col]); col++; - int track_motion = atoi(dbrow[col]); col++; - - int signal_check_colour; - if ( dbrow[col][0] == '#' ) - signal_check_colour = strtol(dbrow[col]+1,0,16); - else - signal_check_colour = strtol(dbrow[col],0,16); - col++; - bool embed_exif = (*dbrow[col] != '0'); col++; - - int extras = (deinterlacing>>24)&0xff; - - Camera *camera = new LocalCamera( - id, - device, - channel, - format, - v4l_multi_buffer, - v4l_captures_per_frame, - method, - width, - height, - colours, - palette, - brightness, - contrast, - hue, - colour, - purpose==CAPTURE, - record_audio, - extras - ); - - monitors[i] = new Monitor( - id, - name, - server_id, - storage_id, - function, - enabled, - linked_monitors, - camera, - orientation, - deinterlacing, - savejpegs, - colours, - videowriter, - encoderparams, - output_codec, - output_container, - record_audio, - event_prefix, - label_format, - Coord( label_x, label_y ), - label_size, - image_buffer_count, - warmup_count, - pre_event_count, - post_event_count, - stream_replay_buffer, - alarm_frame_count, - section_length, - frame_skip, - motion_frame_skip, - analysis_fps, - analysis_update_delay, - capture_delay, - alarm_capture_delay, - fps_report_interval, - ref_blend_perc, - alarm_ref_blend_perc, - track_motion, - signal_check_colour, - embed_exif, - purpose, - 0, - 0 - ); - camera->setMonitor( monitors[i] ); - Zone **zones = 0; - int n_zones = Zone::Load( monitors[i], zones ); - monitors[i]->AddZones( n_zones, zones ); - monitors[i]->AddPrivacyBitmask( zones ); - Debug( 1, "Loaded monitor %d(%s), %d zones", id, name, n_zones ); + for( int i=0; MYSQL_ROW dbrow = mysql_fetch_row(result); i++ ) { + monitors[i] = new Monitor(); + monitors[i]->Load(dbrow); + // need to load zones and set Purpose, 1, purpose); } - if ( mysql_errno( &dbconn ) ) { - Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); + if ( mysql_errno(&dbconn) ) { + Error("Can't fetch row: %s", mysql_error(&dbconn)); + return 0; } - // Yadda yadda - mysql_free_result( result ); + mysql_free_result(result); - return( n_monitors ); + return n_monitors; +} + +#if ZM_HAS_V4L +int Monitor::LoadLocalMonitors(const char *device, Monitor **&monitors, Purpose purpose) { + + std::string sql = load_monitor_sql + " WHERE Function != 'None' AND Type = 'Local'"; + + if ( device[0] ) + sql += " AND Device='" + std::string(device) + "'"; + if ( staticConfig.SERVER_ID ) + sql += stringtf(" AND ServerId=%d", staticConfig.SERVER_ID); + return LoadMonitors(sql, monitors, purpose); } #endif // ZM_HAS_V4L -int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const char *port, const char *path, Monitor **&monitors, Purpose purpose ) { - std::string sql = "select Id, Name, ServerId, StorageId, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, RTSPDescribe, SaveJPEGs, VideoWriter, EncoderParameters, OutputCodec, OutputContainer, RecordAudio, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Remote'"; - if ( staticConfig.SERVER_ID ) { - sql += stringtf( " AND ServerId=%d", staticConfig.SERVER_ID ); - } +int Monitor::LoadRemoteMonitors(const char *protocol, const char *host, const char *port, const char *path, Monitor **&monitors, Purpose purpose) { + std::string sql = load_monitor_sql + " WHERE Function != 'None' AND Type = 'Remote'"; + if ( staticConfig.SERVER_ID ) + sql += stringtf(" AND ServerId=%d", staticConfig.SERVER_ID); - if ( protocol ) { - sql += stringtf(" AND Protocol = '%s' and Host = '%s' and Port = '%s' and Path = '%s'", protocol, host, port, path ); - } - - Debug( 1, "Loading Remote Monitors with %s", sql.c_str() ); - MYSQL_RES *result = zmDbFetch( sql.c_str() ); - if ( !result ) { - Error( "Can't use query result: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); - } - int n_monitors = mysql_num_rows( result ); - Debug( 1, "Got %d monitors", n_monitors ); - delete[] monitors; - monitors = new Monitor *[n_monitors]; - for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) { - int col = 0; - - int id = atoi(dbrow[col]); col++; - std::string name = dbrow[col]; col++; - unsigned int server_id = dbrow[col] ? atoi(dbrow[col]) : 0; col++; - unsigned int storage_id = atoi(dbrow[col]); col++; - int function = atoi(dbrow[col]); col++; - int enabled = atoi(dbrow[col]); col++; - const char *linked_monitors = dbrow[col]; col++; - - std::string protocol = dbrow[col] ? dbrow[col] : ""; col++; - std::string method = dbrow[col] ? dbrow[col] : ""; col++; - std::string host = dbrow[col] ? dbrow[col] : ""; col++; - std::string port = dbrow[col] ? dbrow[col] : ""; col++; - std::string path = dbrow[col] ? dbrow[col] : ""; col++; - - int width = atoi(dbrow[col]); col++; - int height = atoi(dbrow[col]); col++; - int colours = atoi(dbrow[col]); col++; - /* int palette = atoi(dbrow[col]); */ col++; - Orientation orientation = (Orientation)atoi(dbrow[col]); col++; - unsigned int deinterlacing = atoi(dbrow[col]); col++; - bool rtsp_describe = (dbrow[col] && *dbrow[col] != '0'); col++; - int savejpegs = atoi(dbrow[col]); col++; - VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++; - std::string encoderparams = dbrow[col] ? dbrow[col] : ""; col++; - std::string output_codec = dbrow[col] ? dbrow[col] : ""; col++; - std::string output_container = dbrow[col] ? dbrow[col] : ""; col++; - bool record_audio = (*dbrow[col] != '0'); col++; - - int brightness = atoi(dbrow[col]); col++; - int contrast = atoi(dbrow[col]); col++; - int hue = atoi(dbrow[col]); col++; - int colour = atoi(dbrow[col]); col++; - - const char *event_prefix = dbrow[col] ? dbrow[col] : ""; col++; - const char *label_format = dbrow[col] ? dbrow[col] : ""; col++; - - int label_x = atoi(dbrow[col]); col++; - int label_y = atoi(dbrow[col]); col++; - int label_size = atoi(dbrow[col]); col++; - - int image_buffer_count = atoi(dbrow[col]); col++; - int warmup_count = atoi(dbrow[col]); col++; - int pre_event_count = atoi(dbrow[col]); col++; - int post_event_count = atoi(dbrow[col]); col++; - int stream_replay_buffer = atoi(dbrow[col]); col++; - int alarm_frame_count = atoi(dbrow[col]); col++; - int section_length = atoi(dbrow[col]); col++; - int frame_skip = atoi(dbrow[col]); col++; - int motion_frame_skip = atoi(dbrow[col]); col++; - double analysis_fps = dbrow[col] ? strtod(dbrow[col], NULL) : 0; col++; - unsigned int analysis_update_delay = strtoul(dbrow[col++], NULL, 0); - int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; - int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; - int fps_report_interval = atoi(dbrow[col]); col++; - int ref_blend_perc = atoi(dbrow[col]); col++; - int alarm_ref_blend_perc = atoi(dbrow[col]); col++; - int track_motion = atoi(dbrow[col]); col++; - bool embed_exif = (*dbrow[col] != '0'); col++; - - Camera *camera = 0; - if ( protocol == "http" ) { - camera = new RemoteCameraHttp( - id, - method, - host, // Host - port, // Port - path, // Path - width, - height, - colours, - brightness, - contrast, - hue, - colour, - purpose==CAPTURE, - record_audio - ); - } -#if HAVE_LIBAVFORMAT - else if ( protocol == "rtsp" ) { - camera = new RemoteCameraRtsp( - id, - method, - host, // Host - port, // Port - path, // Path - width, - height, - rtsp_describe, - colours, - brightness, - contrast, - hue, - colour, - purpose==CAPTURE, - record_audio - ); - } -#endif // HAVE_LIBAVFORMAT - else { - Fatal( "Unexpected remote camera protocol '%s'", protocol.c_str() ); - } - - monitors[i] = new Monitor( - id, - name.c_str(), - server_id, - storage_id, - function, - enabled, - linked_monitors, - camera, - orientation, - deinterlacing, - savejpegs, - colours, - videowriter, - encoderparams, - output_codec, - output_container, - record_audio, - event_prefix, - label_format, - Coord( label_x, label_y ), - label_size, - image_buffer_count, - warmup_count, - pre_event_count, - post_event_count, - stream_replay_buffer, - alarm_frame_count, - section_length, - frame_skip, - motion_frame_skip, - analysis_fps, - analysis_update_delay, - capture_delay, - alarm_capture_delay, - fps_report_interval, - ref_blend_perc, - alarm_ref_blend_perc, - track_motion, - RGB_WHITE, - embed_exif, - purpose, - 0, - 0 - ); - camera->setMonitor( monitors[i] ); - Zone **zones = 0; - int n_zones = Zone::Load( monitors[i], zones ); - monitors[i]->AddZones( n_zones, zones ); - monitors[i]->AddPrivacyBitmask( zones ); - Debug( 1, "Loaded monitor %d(%s), %d zones", id, name.c_str(), n_zones ); - } - if ( mysql_errno( &dbconn ) ) { - Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); - } - // Yadda yadda - mysql_free_result( result ); - - return( n_monitors ); + if ( protocol ) + sql += stringtf(" AND Protocol = '%s' and Host = '%s' and Port = '%s' and Path = '%s'", protocol, host, port, path); + return LoadMonitors(sql, monitors, purpose); } int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose purpose ) { - std::string sql = "select Id, Name, ServerId, StorageId, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, SaveJPEGs, VideoWriter, EncoderParameters, OutputCodec, OutputContainer, RecordAudio, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'File'"; - if ( file[0] ) { - sql += " AND Path='"; - sql += file; - sql += "'"; - } + std::string sql = load_monitor_sql + " WHERE Function != 'None' AND Type = 'File'"; + if ( file[0] ) + sql += " AND Path='" + std::string(file) + "'"; if ( staticConfig.SERVER_ID ) { sql += stringtf( " AND ServerId=%d", staticConfig.SERVER_ID ); } - Debug( 1, "Loading File Monitors with %s", sql.c_str() ); - MYSQL_RES *result = zmDbFetch( sql.c_str() ); - if ( !result ) { - Error( "Can't use query result: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); - } - int n_monitors = mysql_num_rows( result ); - Debug( 1, "Got %d monitors", n_monitors ); - delete[] monitors; - monitors = new Monitor *[n_monitors]; - for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) { - int col = 0; - - int id = atoi(dbrow[col]); col++; - const char *name = dbrow[col]; col++; - unsigned int server_id = dbrow[col] ? atoi(dbrow[col]) : 0; col++; - unsigned int storage_id = atoi(dbrow[col]); col++; - int function = atoi(dbrow[col]); col++; - int enabled = atoi(dbrow[col]); col++; - const char *linked_monitors = dbrow[col]; col++; - - const char *path = dbrow[col]; col++; - - int width = atoi(dbrow[col]); col++; - int height = atoi(dbrow[col]); col++; - int colours = atoi(dbrow[col]); col++; - /* int palette = atoi(dbrow[col]); */ col++; - Orientation orientation = (Orientation)atoi(dbrow[col]); col++; - unsigned int deinterlacing = atoi(dbrow[col]); col++; - - int savejpegs = atoi(dbrow[col]); col++; - VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++; - std::string encoderparams = dbrow[col]; col++; - std::string output_codec = dbrow[col]; col++; - std::string output_container = dbrow[col]; col++; - bool record_audio = (*dbrow[col] != '0'); col++; - - int brightness = atoi(dbrow[col]); col++; - int contrast = atoi(dbrow[col]); col++; - int hue = atoi(dbrow[col]); col++; - int colour = atoi(dbrow[col]); col++; - - const char *event_prefix = dbrow[col] ? dbrow[col] : ""; col++; - const char *label_format = dbrow[col] ? dbrow[col] : ""; col++; - - int label_x = atoi(dbrow[col]); col++; - int label_y = atoi(dbrow[col]); col++; - int label_size = atoi(dbrow[col]); col++; - - int image_buffer_count = atoi(dbrow[col]); col++; - int warmup_count = atoi(dbrow[col]); col++; - int pre_event_count = atoi(dbrow[col]); col++; - int post_event_count = atoi(dbrow[col]); col++; - int stream_replay_buffer = atoi(dbrow[col]); col++; - int alarm_frame_count = atoi(dbrow[col]); col++; - int section_length = atoi(dbrow[col]); col++; - int frame_skip = atoi(dbrow[col]); col++; - int motion_frame_skip = atoi(dbrow[col]); col++; - double analysis_fps = dbrow[col] ? strtod(dbrow[col], NULL) : 0; col++; - unsigned int analysis_update_delay = strtoul(dbrow[col++], NULL, 0); - int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; - int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; - int fps_report_interval = atoi(dbrow[col]); col++; - int ref_blend_perc = atoi(dbrow[col]); col++; - int alarm_ref_blend_perc = atoi(dbrow[col]); col++; - int track_motion = atoi(dbrow[col]); col++; - bool embed_exif = (*dbrow[col] != '0'); col++; - - Camera *camera = new FileCamera( - id, - path, // File - width, - height, - colours, - brightness, - contrast, - hue, - colour, - purpose==CAPTURE, - record_audio - ); - - monitors[i] = new Monitor( - id, - name, - server_id, - storage_id, - function, - enabled, - linked_monitors, - camera, - orientation, - deinterlacing, - savejpegs, - colours, - videowriter, - encoderparams, - output_codec, - output_container, - record_audio, - event_prefix, - label_format, - Coord( label_x, label_y ), - label_size, - image_buffer_count, - warmup_count, - pre_event_count, - post_event_count, - stream_replay_buffer, - alarm_frame_count, - section_length, - frame_skip, - motion_frame_skip, - analysis_fps, - analysis_update_delay, - capture_delay, - alarm_capture_delay, - fps_report_interval, - ref_blend_perc, - alarm_ref_blend_perc, - track_motion, - embed_exif, - RGB_WHITE, - purpose, - 0, - 0 - ); - camera->setMonitor( monitors[i] ); - Zone **zones = 0; - int n_zones = Zone::Load( monitors[i], zones ); - monitors[i]->AddZones( n_zones, zones ); - monitors[i]->AddPrivacyBitmask( zones ); - Debug( 1, "Loaded monitor %d(%s), %d zones", id, name, n_zones ); - } - if ( mysql_errno( &dbconn ) ) { - Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); - } - // Yadda yadda - mysql_free_result( result ); - - return( n_monitors ); + return LoadMonitors(sql, monitors, purpose); } #if HAVE_LIBAVFORMAT -int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose purpose ) { - std::string sql = "select Id, Name, ServerId, StorageId, Function+0, Enabled, LinkedMonitors, Path, Method, Options, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, SaveJPEGs, VideoWriter, EncoderParameters, OutputCodec, OutputContainer, RecordAudio, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif from Monitors where Function != 'None' and Type = 'Ffmpeg'"; - if ( file[0] ) { - sql += " AND Path = '"; - sql += file; - sql += "'"; - } +int Monitor::LoadFfmpegMonitors(const char *file, Monitor **&monitors, Purpose purpose) { + std::string sql = load_monitor_sql + " WHERE Function != 'None' AND Type = 'Ffmpeg'"; + if ( file[0] ) + sql += " AND Path = '" + std::string(file) + "'"; + if ( staticConfig.SERVER_ID ) { - sql += stringtf( " AND ServerId=%d", staticConfig.SERVER_ID ); + sql += stringtf(" AND ServerId=%d", staticConfig.SERVER_ID); } - Debug( 1, "Loading FFMPEG Monitors with %s", sql.c_str() ); - MYSQL_RES *result = zmDbFetch( sql.c_str() ); - if ( ! result ) { - Error( "Cannot load FfmpegMonitors" ); - exit( mysql_errno( &dbconn ) ); - } - - int n_monitors = mysql_num_rows( result ); - Debug( 1, "Got %d monitors", n_monitors ); - delete[] monitors; - monitors = new Monitor *[n_monitors]; - for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) { - int col = 0; - - int id = atoi(dbrow[col]); col++; - const char *name = dbrow[col]; col++; - unsigned int server_id = dbrow[col] ? atoi(dbrow[col]) : 0; col++; - unsigned int storage_id = atoi(dbrow[col]); col++; - int function = atoi(dbrow[col]); col++; - int enabled = atoi(dbrow[col]); col++; - const char *linked_monitors = dbrow[col] ? dbrow[col] : ""; col++; - - const char *path = dbrow[col]; col++; - const char *method = dbrow[col] ? dbrow[col] : ""; col++; - const char *options = dbrow[col] ? dbrow[col] : ""; col++; - - int width = atoi(dbrow[col]); col++; - int height = atoi(dbrow[col]); col++; - int colours = atoi(dbrow[col]); col++; - /* int palette = atoi(dbrow[col]); */ col++; - Orientation orientation = (Orientation)atoi(dbrow[col]); col++; - unsigned int deinterlacing = atoi(dbrow[col]); col++; - - int savejpegs = atoi(dbrow[col]); col++; - VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++; - std::string encoderparams = dbrow[col] ? dbrow[col] : ""; col++; - std::string output_codec = dbrow[col] ? dbrow[col] : ""; col++; - std::string output_container = dbrow[col] ? dbrow[col] : ""; col++; - bool record_audio = (*dbrow[col] != '0'); col++; - - int brightness = atoi(dbrow[col]); col++; - int contrast = atoi(dbrow[col]); col++; - int hue = atoi(dbrow[col]); col++; - int colour = atoi(dbrow[col]); col++; - - const char *event_prefix = dbrow[col] ? dbrow[col] : ""; col++; - const char *label_format = dbrow[col] ? dbrow[col] : ""; col++; - - int label_x = atoi(dbrow[col]); col++; - int label_y = atoi(dbrow[col]); col++; - int label_size = atoi(dbrow[col]); col++; - - int image_buffer_count = atoi(dbrow[col]); col++; - int warmup_count = atoi(dbrow[col]); col++; - int pre_event_count = atoi(dbrow[col]); col++; - int post_event_count = atoi(dbrow[col]); col++; - int stream_replay_buffer = atoi(dbrow[col]); col++; - int alarm_frame_count = atoi(dbrow[col]); col++; - int section_length = atoi(dbrow[col]); col++; - int frame_skip = atoi(dbrow[col]); col++; - int motion_frame_skip = atoi(dbrow[col]); col++; - - double analysis_fps = dbrow[col] ? strtod(dbrow[col], NULL) : 0; col++; - unsigned int analysis_update_delay = strtoul(dbrow[col++], NULL, 0); - double capture_fps = dbrow[col] ? atof(dbrow[col]) : 0;col++; - int capture_delay = capture_fps >0.0 ?int(DT_PREC_3/capture_fps):0; - double alarm_capture_fps = dbrow[col] ? atof(dbrow[col]) : 0; col++; - int alarm_capture_delay = alarm_capture_fps > 0.0 ?int(DT_PREC_3/alarm_capture_fps):0; - - int fps_report_interval = atoi(dbrow[col]); col++; - int ref_blend_perc = atoi(dbrow[col]); col++; - int alarm_ref_blend_perc = atoi(dbrow[col]); col++; - int track_motion = atoi(dbrow[col]); col++; - bool embed_exif = (*dbrow[col] != '0'); col++; - - Camera *camera = new FfmpegCamera( - id, - path, // File - method, - options, - width, - height, - colours, - brightness, - contrast, - hue, - colour, - purpose==CAPTURE, - record_audio - ); - - monitors[i] = new Monitor( - id, - name, - server_id, - storage_id, - function, - enabled, - linked_monitors, - camera, - orientation, - deinterlacing, - savejpegs, - colours, - videowriter, - encoderparams, - output_codec, - output_container, - record_audio, - event_prefix, - label_format, - Coord( label_x, label_y ), - label_size, - image_buffer_count, - warmup_count, - pre_event_count, - post_event_count, - stream_replay_buffer, - alarm_frame_count, - section_length, - frame_skip, - motion_frame_skip, - analysis_fps, - analysis_update_delay, - capture_delay, - alarm_capture_delay, - fps_report_interval, - ref_blend_perc, - alarm_ref_blend_perc, - track_motion, - embed_exif, - RGB_WHITE, - purpose, - 0, - 0 - ); - - camera->setMonitor( monitors[i] ); - Zone **zones = 0; - int n_zones = Zone::Load( monitors[i], zones ); - monitors[i]->AddZones( n_zones, zones ); - monitors[i]->AddPrivacyBitmask( zones ); - Debug( 1, "Loaded monitor %d(%s), %d zones", id, name, n_zones ); - } - if ( mysql_errno( &dbconn ) ) { - Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); - } - // Yadda yadda - mysql_free_result( result ); - - return( n_monitors ); + return LoadMonitors(sql, monitors, purpose); } #endif // HAVE_LIBAVFORMAT -Monitor *Monitor::Load( unsigned int p_id, bool load_zones, Purpose purpose ) { - std::string sql = stringtf( "select Id, Name, ServerId, StorageId, Type, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Protocol, Method, Host, Port, Path, Options, User, Pass, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, RTSPDescribe, SaveJPEGs, VideoWriter, EncoderParameters, OutputCodec, OutputContainer, RecordAudio, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour, Exif from Monitors where Id = %d", p_id ); - - zmDbRow dbrow; - if ( ! dbrow.fetch( sql.c_str() ) ) { - Error( "Can't use query result: %s", mysql_error( &dbconn ) ); - exit( mysql_errno( &dbconn ) ); - } - Monitor *monitor = 0; - unsigned int col = 0; - - unsigned int id = atoi(dbrow[col]); col++; - std::string name = dbrow[col]; col++; - unsigned int server_id = dbrow[col] ? atoi(dbrow[col]) : 0; col++; - unsigned int storage_id = dbrow[col] ? atoi(dbrow[col]) : 0; col++; - std::string type = dbrow[col]; col++; - int function = atoi(dbrow[col]); col++; - int enabled = atoi(dbrow[col]); col++; - std::string linked_monitors = dbrow[col] ? dbrow[col] : ""; col++; - - std::string device = dbrow[col] ? dbrow[col] : ""; col++; - int channel = atoi(dbrow[col]); col++; - int format = atoi(dbrow[col]); col++; - - bool v4l_multi_buffer = config.v4l_multi_buffer; - if ( dbrow[col] ) { - if (*dbrow[col] == '0' ) { - v4l_multi_buffer = false; - } else if ( *dbrow[col] == '1' ) { - v4l_multi_buffer = true; - } - } - col++; - - int v4l_captures_per_frame = 0; - if ( dbrow[col] ) { - v4l_captures_per_frame = atoi(dbrow[col]); - } else { - v4l_captures_per_frame = config.captures_per_frame; - } - Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame ); - col++; - - std::string protocol = dbrow[col] ? dbrow[col] : ""; col++; - std::string method = dbrow[col] ? dbrow[col] : ""; col++; - std::string host = dbrow[col] ? dbrow[col] : ""; col++; - std::string port = dbrow[col] ? dbrow[col] : ""; col++; - std::string path = dbrow[col] ? dbrow[col] : ""; col++; - std::string options = dbrow[col] ? dbrow[col] : ""; col++; - std::string user = dbrow[col] ? dbrow[col] : ""; col++; - std::string pass = dbrow[col] ? dbrow[col] : ""; col++; - - int width = atoi(dbrow[col]); col++; - int height = atoi(dbrow[col]); col++; - int colours = atoi(dbrow[col]); col++; - int palette = atoi(dbrow[col]); col++; - Orientation orientation = (Orientation)atoi(dbrow[col]); col++; - unsigned int deinterlacing = atoi(dbrow[col]); col++; - bool rtsp_describe = (dbrow[col] && *dbrow[col] != '0'); col++; - int savejpegs = atoi(dbrow[col]); col++; - VideoWriter videowriter = (VideoWriter)atoi(dbrow[col]); col++; - std::string encoderparams = dbrow[col] ? dbrow[col] : ""; col++; - std::string output_codec = dbrow[col] ? dbrow[col] : ""; col++; - std::string output_container = dbrow[col] ? dbrow[col] : ""; col++; - bool record_audio = (*dbrow[col] != '0'); col++; - - int brightness = atoi(dbrow[col]); col++; - int contrast = atoi(dbrow[col]); col++; - int hue = atoi(dbrow[col]); col++; - int colour = atoi(dbrow[col]); col++; - - const char * event_prefix = dbrow[col] ? dbrow[col] : ""; col++; - const char * label_format = dbrow[col] ? dbrow[col] : ""; col++; - - int label_x = atoi(dbrow[col]); col++; - int label_y = atoi(dbrow[col]); col++; - int label_size = atoi(dbrow[col]); col++; - - int image_buffer_count = atoi(dbrow[col]); col++; - int warmup_count = atoi(dbrow[col]); col++; - int pre_event_count = atoi(dbrow[col]); col++; - int post_event_count = atoi(dbrow[col]); col++; - int stream_replay_buffer = atoi(dbrow[col]); col++; - int alarm_frame_count = atoi(dbrow[col]); col++; - int section_length = atoi(dbrow[col]); col++; - int frame_skip = atoi(dbrow[col]); col++; - int motion_frame_skip = atoi(dbrow[col]); col++; - double analysis_fps = dbrow[col] ? strtod(dbrow[col], NULL) : 0; col++; - unsigned int analysis_update_delay = strtoul(dbrow[col++], NULL, 0); - int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; - int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; - int fps_report_interval = atoi(dbrow[col]); col++; - int ref_blend_perc = atoi(dbrow[col]); col++; - int alarm_ref_blend_perc = atoi(dbrow[col]); col++; - int track_motion = atoi(dbrow[col]); col++; - - int signal_check_colour; - if ( dbrow[col][0] == '#' ) - signal_check_colour = strtol(dbrow[col]+1,0,16); - else - signal_check_colour = strtol(dbrow[col],0,16); - col++; - bool embed_exif = (*dbrow[col] != '0'); col++; - - int extras = (deinterlacing>>24)&0xff; - - Camera *camera = 0; - if ( type == "Local" ) { -#if ZM_HAS_V4L - camera = new LocalCamera( - id, - device.c_str(), - channel, - format, - v4l_multi_buffer, - v4l_captures_per_frame, - method, - width, - height, - colours, - palette, - brightness, - contrast, - hue, - colour, - purpose==CAPTURE, - record_audio, - extras - ); -#else // ZM_HAS_V4L - Fatal( "You must have video4linux libraries and headers installed to use local analog or USB cameras for monitor %d", id ); -#endif // ZM_HAS_V4L - } else if ( type == "NVSocket" ) { - camera = new RemoteCameraNVSocket( - id, - host.c_str(), - port.c_str(), - path.c_str(), - width, - height, - colours, - brightness, - contrast, - hue, - colour, - purpose==CAPTURE, - record_audio - ); - } else if ( type == "Remote" ) { - if ( protocol == "http" ) { - camera = new RemoteCameraHttp( - id, - method.c_str(), - host.c_str(), - port.c_str(), - path.c_str(), - width, - height, - colours, - brightness, - contrast, - hue, - colour, - purpose==CAPTURE, - record_audio - ); - } else if ( protocol == "rtsp" ) { -#if HAVE_LIBAVFORMAT - camera = new RemoteCameraRtsp( - id, - method.c_str(), - host.c_str(), - port.c_str(), - path.c_str(), - width, - height, - rtsp_describe, - colours, - brightness, - contrast, - hue, - colour, - purpose==CAPTURE, - record_audio - ); -#else // HAVE_LIBAVFORMAT - Fatal( "You must have ffmpeg libraries installed to use remote camera protocol '%s' for monitor %d", protocol.c_str(), id ); -#endif // HAVE_LIBAVFORMAT - } else { - Fatal( "Unexpected remote camera protocol '%s' for monitor %d", protocol.c_str(), id ); - } - } else if ( type == "File" ) { - camera = new FileCamera( - id, - path.c_str(), - width, - height, - colours, - brightness, - contrast, - hue, - colour, - purpose==CAPTURE, - record_audio - ); - } else if ( type == "Ffmpeg" ) { -#if HAVE_LIBAVFORMAT - camera = new FfmpegCamera( - id, - path.c_str(), - method, - options, - width, - height, - colours, - brightness, - contrast, - hue, - colour, - purpose==CAPTURE, - record_audio - ); -#else // HAVE_LIBAVFORMAT - Fatal( "You must have ffmpeg libraries installed to use ffmpeg cameras for monitor %d", id ); -#endif // HAVE_LIBAVFORMAT - } else if (type == "Libvlc") { -#if HAVE_LIBVLC - camera = new LibvlcCamera( - id, - path.c_str(), - method, - options, - width, - height, - colours, - brightness, - contrast, - hue, - colour, - purpose==CAPTURE, - record_audio - ); -#else // HAVE_LIBVLC - Fatal( "You must have vlc libraries installed to use vlc cameras for monitor %d", id ); -#endif // HAVE_LIBVLC - } else if ( type == "cURL" ) { -#if HAVE_LIBCURL - camera = new cURLCamera( - id, - path.c_str(), - user.c_str(), - pass.c_str(), - width, - height, - colours, - brightness, - contrast, - hue, - colour, - purpose==CAPTURE, - record_audio - ); -#else // HAVE_LIBCURL - Fatal( "You must have libcurl installed to use ffmpeg cameras for monitor %d", id ); -#endif // HAVE_LIBCURL - } else { - Fatal( "Bogus monitor type '%s' for monitor %d", type.c_str(), id ); - } - monitor = new Monitor( - id, - name.c_str(), - server_id, - storage_id, - function, - enabled, - linked_monitors.c_str(), - camera, - orientation, - deinterlacing, - savejpegs, - colours, - videowriter, - encoderparams, - output_codec, - output_container, - record_audio, - event_prefix, - label_format, - Coord( label_x, label_y ), - label_size, - image_buffer_count, - warmup_count, - pre_event_count, - post_event_count, - stream_replay_buffer, - alarm_frame_count, - section_length, - frame_skip, - motion_frame_skip, - analysis_fps, - analysis_update_delay, - capture_delay, - alarm_capture_delay, - fps_report_interval, - ref_blend_perc, - alarm_ref_blend_perc, - track_motion, - signal_check_colour, - embed_exif, - purpose, - 0, - 0 - - ); - - camera->setMonitor( monitor ); - - int n_zones = 0; - if ( load_zones ) { - Zone **zones = 0; - n_zones = Zone::Load( monitor, zones ); - monitor->AddZones( n_zones, zones ); - monitor->AddPrivacyBitmask( zones ); - } - Debug( 1, "Loaded monitor %d(%s), %d zones", id, name.c_str(), n_zones ); - return( monitor ); -} /* Returns 0 on success, even if no new images are available (transient error) * Returns -1 on failure. @@ -2813,7 +2107,9 @@ int Monitor::Capture() { } ZMPacket *packet = &image_buffer[index]; + Debug(2,"before lock"); packet->lock(); + Debug(2,"before reset"); packet->reset(); Image* capture_image = packet->image; int captureResult = 0; @@ -2821,20 +2117,23 @@ int Monitor::Capture() { if ( deinterlacing_value == 4 ) { if ( FirstCapture != 1 ) { /* Copy the next image into the shared memory */ - capture_image->CopyBuffer(*(next_buffer.image)); + capture_image->CopyBuffer(*(next_buffer.image)); } /* Capture a new next image */ captureResult = camera->Capture(*packet); gettimeofday( packet->timestamp, NULL ); if ( FirstCapture ) { + packet->unlock(); FirstCapture = 0; return 0; } } else { + Debug(2,"Before capture"); captureResult = camera->Capture(*packet); gettimeofday( packet->timestamp, NULL ); if ( captureResult < 0 ) { + Debug(2,"failed capture"); // Unable to capture image for temporary reason // Fake a signal loss image Rgb signalcolor; @@ -2842,11 +2141,18 @@ int Monitor::Capture() { signalcolor = rgb_convert(signal_check_colour, ZM_SUBPIX_ORDER_BGR); capture_image->Fill(signalcolor); shared_data->signal = false; + shared_data->last_write_index = index; + shared_data->last_write_time = image_buffer[index].timestamp->tv_sec; + image_count++; packet->unlock(); + // What about timestamping it? + // Don't want to do analysis on it, but we won't due to signal return -1; } else if ( captureResult > 0 ) { // Analysis thread will take care of consuming and emptying the packets. + Debug(2, "Have packet (%d) != videostream_id:(%d) q.vpktcount(%d) event?(%d) ", + packet->packet.stream_index, video_stream_id, packetqueue->video_packet_count, ( event ? 1 : 0 ) ); if ( packet->packet.stream_index != video_stream_id ) { Debug(2, "Have audio packet (%d) != videostream_id:(%d) q.vpktcount(%d) event?(%d) ", @@ -2855,14 +2161,14 @@ int Monitor::Capture() { mutex.lock(); if ( packetqueue->video_packet_count || event ) { // Need to copy it into another ZMPacket. - ZMPacket *audio_packet = new ZMPacket( *packet ); + ZMPacket *audio_packet = new ZMPacket(*packet); #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) audio_packet->codec_type = camera->get_AudioStream()->codecpar->codec_type; #else audio_packet->codec_type = camera->get_AudioStream()->codec->codec_type; #endif Debug(2, "Queueing packet"); - packetqueue->queuePacket( audio_packet ); + packetqueue->queuePacket(audio_packet); } // Don't update last_write_index because that is used for live streaming //shared_data->last_write_time = image_buffer[index].timestamp->tv_sec; @@ -2878,13 +2184,14 @@ int Monitor::Capture() { packet->codec_type = camera->get_VideoStream()->codec->codec_type; #endif - if ( packet->packet.size && ! packet->in_frame ) { + if ( packet->packet.size && !packet->in_frame ) { //Debug(2,"About to decode"); - if ( packet->decode( camera->get_VideoCodecContext() ) ) { + if ( packet->decode(camera->get_VideoCodecContext()) ) { //Debug(2,"Getimage"); packet->get_image(); } // Have an av_packet, + Debug(2,"Before mutex lock"); mutex.lock(); if ( packetqueue->video_packet_count || packet->keyframe || event ) { Debug(2, "Have video packet for index (%d)", index ); @@ -2897,7 +2204,7 @@ int Monitor::Capture() { mutex.lock(); // Non-avpackets are all keyframes. Debug(2, "Queueing decoded video packet"); - packetqueue->queuePacket( packet ); + packetqueue->queuePacket(packet); mutex.unlock(); } @@ -2959,8 +2266,8 @@ int Monitor::Capture() { capture_fps = new_capture_fps; last_fps_time = now; static char sql[ZM_SQL_SML_BUFSIZ]; - snprintf(sql, sizeof(sql), "INSERT INTO Monitor_Status (MonitorId,CaptureFPS) VALUES (%d, %.2lf) ON DUPLICATE KEY UPDATE CaptureFPS = %.2lf", id, capture_fps, capture_fps); db_mutex.lock(); + snprintf(sql, sizeof(sql), "INSERT INTO Monitor_Status (MonitorId,CaptureFPS) VALUES (%d, %.2lf) ON DUPLICATE KEY UPDATE CaptureFPS = %.2lf", id, capture_fps, capture_fps); if ( mysql_query(&dbconn, sql) ) { Error("Can't run query: %s", mysql_error(&dbconn)); } @@ -3037,12 +2344,22 @@ bool Monitor::closeEvent() { if ( function == RECORD || function == MOCORD ) { gettimeofday( &(event->EndTime()), NULL ); } - delete event; + if ( event_delete_thread ) { + event_delete_thread->join(); + delete event_delete_thread; + event_delete_thread = NULL; + } + event_delete_thread = new std::thread([](Event *event) { + Event * e = event; + event = NULL; + delete e; + e = NULL; + }, event ); video_store_data->recording = (struct timeval){0}; - event = 0; - return( true ); + event = NULL; + return true; } - return( false ); + return false; } unsigned int Monitor::DetectMotion( const Image &comp_image, Event::StringSet &zoneSet ) { @@ -3113,7 +2430,7 @@ unsigned int Monitor::DetectMotion( const Image &comp_image, Event::StringSet &z } else { zone->ClearAlarm(); } - } + } } } @@ -3198,7 +2515,7 @@ unsigned int Monitor::DetectMotion( const Image &comp_image, Event::StringSet &z // This is a small and innocent hack to prevent scores of 0 being returned in alarm state return( score?score:alarm ); -} +} bool Monitor::DumpSettings( char *output, bool verbose ) { output[0] = 0; @@ -3233,25 +2550,25 @@ bool Monitor::DumpSettings( char *output, bool verbose ) { sprintf( output+strlen(output), "Palette : %d\n", ((LocalCamera *)camera)->Palette() ); } #endif // ZM_HAS_V4L - sprintf( output+strlen(output), "Colours : %d\n", camera->Colours() ); - sprintf( output+strlen(output), "Subpixel Order : %d\n", camera->SubpixelOrder() ); - sprintf( output+strlen(output), "Event Prefix : %s\n", event_prefix ); - sprintf( output+strlen(output), "Label Format : %s\n", label_format ); - sprintf( output+strlen(output), "Label Coord : %d,%d\n", label_coord.X(), label_coord.Y() ); - sprintf( output+strlen(output), "Label Size : %d\n", label_size ); - sprintf( output+strlen(output), "Image Buffer Count : %d\n", image_buffer_count ); - sprintf( output+strlen(output), "Warmup Count : %d\n", warmup_count ); - sprintf( output+strlen(output), "Pre Event Count : %d\n", pre_event_count ); - sprintf( output+strlen(output), "Post Event Count : %d\n", post_event_count ); - sprintf( output+strlen(output), "Stream Replay Buffer : %d\n", stream_replay_buffer ); - sprintf( output+strlen(output), "Alarm Frame Count : %d\n", alarm_frame_count ); - sprintf( output+strlen(output), "Section Length : %d\n", section_length ); - sprintf( output+strlen(output), "Maximum FPS : %.2f\n", capture_delay?(double)DT_PREC_3/capture_delay:0.0 ); - sprintf( output+strlen(output), "Alarm Maximum FPS : %.2f\n", alarm_capture_delay?(double)DT_PREC_3/alarm_capture_delay:0.0 ); - sprintf( output+strlen(output), "Reference Blend %%ge : %d\n", ref_blend_perc ); - sprintf( output+strlen(output), "Alarm Reference Blend %%ge : %d\n", alarm_ref_blend_perc ); - sprintf( output+strlen(output), "Track Motion : %d\n", track_motion ); - sprintf( output+strlen(output), "Function: %d - %s\n", function, + sprintf(output+strlen(output), "Colours : %d\n", camera->Colours() ); + sprintf(output+strlen(output), "Subpixel Order : %d\n", camera->SubpixelOrder() ); + sprintf(output+strlen(output), "Event Prefix : %s\n", event_prefix ); + sprintf(output+strlen(output), "Label Format : %s\n", label_format ); + sprintf(output+strlen(output), "Label Coord : %d,%d\n", label_coord.X(), label_coord.Y() ); + sprintf(output+strlen(output), "Label Size : %d\n", label_size ); + sprintf(output+strlen(output), "Image Buffer Count : %d\n", image_buffer_count ); + sprintf(output+strlen(output), "Warmup Count : %d\n", warmup_count ); + sprintf(output+strlen(output), "Pre Event Count : %d\n", pre_event_count ); + sprintf(output+strlen(output), "Post Event Count : %d\n", post_event_count ); + sprintf(output+strlen(output), "Stream Replay Buffer : %d\n", stream_replay_buffer ); + sprintf(output+strlen(output), "Alarm Frame Count : %d\n", alarm_frame_count ); + sprintf(output+strlen(output), "Section Length : %d\n", section_length); + sprintf(output+strlen(output), "Maximum FPS : %.2f\n", capture_delay?(double)DT_PREC_3/capture_delay:0.0); + sprintf(output+strlen(output), "Alarm Maximum FPS : %.2f\n", alarm_capture_delay?(double)DT_PREC_3/alarm_capture_delay:0.0); + sprintf(output+strlen(output), "Reference Blend %%ge : %d\n", ref_blend_perc); + sprintf(output+strlen(output), "Alarm Reference Blend %%ge : %d\n", alarm_ref_blend_perc); + sprintf(output+strlen(output), "Track Motion : %d\n", track_motion); + sprintf(output+strlen(output), "Function: %d - %s\n", function, function==NONE?"None":( function==MONITOR?"Monitor Only":( function==MODECT?"Motion Detection":( @@ -3259,23 +2576,23 @@ bool Monitor::DumpSettings( char *output, bool verbose ) { function==MOCORD?"Continuous Record with Motion Detection":( function==NODECT?"Externally Triggered only, no Motion Detection":"Unknown" )))))); - sprintf( output+strlen(output), "Zones : %d\n", n_zones ); + sprintf(output+strlen(output), "Zones : %d\n", n_zones ); for ( int i = 0; i < n_zones; i++ ) { - zones[i]->DumpSettings( output+strlen(output), verbose ); + zones[i]->DumpSettings(output+strlen(output), verbose); } - return( true ); -} // bool Monitor::DumpSettings( char *output, bool verbose ) + return true; +} // bool Monitor::DumpSettings(char *output, bool verbose) -unsigned int Monitor::Colours() const { return( camera->Colours() ); } -unsigned int Monitor::SubpixelOrder() const { return( camera->SubpixelOrder() ); } +unsigned int Monitor::Colours() const { return camera->Colours(); } +unsigned int Monitor::SubpixelOrder() const { return camera->SubpixelOrder(); } int Monitor::PrimeCapture() { int ret = camera->PrimeCapture(); if ( ret == 0 ) { video_stream_id = camera->get_VideoStreamId(); - packetqueue = new zm_packetqueue( image_buffer_count, video_stream_id ); + packetqueue = new zm_packetqueue(image_buffer_count, video_stream_id); } - Debug(2, "Video stream id is (%d), minimum_packets to keep in buffer(%d)", video_stream_id, pre_event_buffer_count ); + Debug(2, "Video stream id is (%d), minimum_packets to keep in buffer(%d)", video_stream_id, pre_event_buffer_count); return ret; } int Monitor::PreCapture() { @@ -3301,8 +2618,9 @@ void Monitor::get_ref_image() { return; int last_write_index = shared_data->last_write_index ; - Warning( "Waiting for capture daemon unlock" ); + Warning("Waiting for capture daemon unlock"); image_buffer[last_write_index].mutex.lock(); - ref_image.Assign( width, height, camera->Colours(), camera->SubpixelOrder(), image_buffer[last_write_index].image->Buffer(), camera->ImageSize()); + ref_image.Assign(width, height, camera->Colours(), camera->SubpixelOrder(), image_buffer[last_write_index].image->Buffer(), camera->ImageSize()); image_buffer[last_write_index].mutex.unlock(); } + diff --git a/src/zm_monitor.h b/src/zm_monitor.h index d35d8e30d..c3e20d1a4 100644 --- a/src/zm_monitor.h +++ b/src/zm_monitor.h @@ -1,27 +1,28 @@ // // ZoneMinder Monitor Class Interfaces, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_MONITOR_H #define ZM_MONITOR_H #include #include +#include #include "zm.h" #include "zm_coord.h" @@ -70,7 +71,17 @@ public: NODECT } Function; - typedef enum { + typedef enum { + LOCAL, + REMOTE, + FILE, + FFMPEG, + LIBVLC, + CURL, + NVSOCKET, + } CameraType; + + typedef enum { ROTATE_0=1, ROTATE_90, ROTATE_180, @@ -103,7 +114,7 @@ protected: /* sizeof(SharedData) expected to be 344 bytes on 32bit and 64bit */ typedef struct { uint32_t size; /* +0 */ - uint32_t last_write_index; /* +4 */ + uint32_t last_write_index; /* +4 */ uint32_t last_read_index; /* +8 */ uint32_t state; /* +12 */ uint32_t last_event_id; /* +16 */ @@ -121,10 +132,10 @@ protected: uint32_t imagesize; /* +52 */ uint32_t epadding1; /* +56 */ uint32_t epadding2; /* +60 */ - /* + /* ** This keeps 32bit time_t and 64bit time_t identical and compatible as long as time is before 2038. ** Shared memory layout should be identical for both 32bit and 64bit and is multiples of 16. - */ + */ union { /* +64 */ time_t startup_time; /* When the zmc process started. zmwatch uses this to see how long the process has been running without getting any images */ uint64_t extrapad1; @@ -139,6 +150,8 @@ protected: }; uint8_t control_state[256]; /* +88 */ + char alarm_cause[256]; + } SharedData; typedef enum { TRIGGER_CANCEL, TRIGGER_ON, TRIGGER_OFF } TriggerState; @@ -158,7 +171,7 @@ protected: //sizeOf(VideoStoreData) expected to be 4104 bytes on 32bit and 64bit typedef struct { uint32_t size; - uint32_t current_event; + uint64_t current_event; char event_file[4096]; timeval recording; // used as both bool and a pointer to the timestamp when recording should begin } VideoStoreData; @@ -188,27 +201,18 @@ protected: volatile TriggerData *trigger_data; volatile VideoStoreData *video_store_data; - int last_state; - int last_event_id; + uint64_t last_event_id; public: MonitorLink( int p_id, const char *p_name ); ~MonitorLink(); - inline int Id() const { - return( id ); - } - inline const char *Name() const { - return( name ); - } + inline int Id() const { return id; } + inline const char *Name() const { return name; } - inline bool isConnected() const { - return( connected ); - } - inline time_t getLastConnectTime() const { - return( last_connect_time ); - } + inline bool isConnected() const { return connected; } + inline time_t getLastConnectTime() const { return last_connect_time; } bool connect(); bool disconnect(); @@ -221,11 +225,29 @@ protected: protected: // These are read from the DB and thereafter remain unchanged unsigned int id; - char name[64]; + char name[64]; unsigned int server_id; // Id of the Server object unsigned int storage_id; // Id of the Storage Object, which currently will just provide a path, but in future may do more. + CameraType type; Function function; // What the monitor is doing bool enabled; // Whether the monitor is enabled or asleep + + std::string protocol; + std::string method; + std::string options; + std::string host; + std::string port; + std::string user; + std::string pass; + std::string path; + + char device[64]; + int palette; + int channel; + int format; + + unsigned int camera_width; + unsigned int camera_height; unsigned int width; // Normally the same as the camera, but not if partly rotated unsigned int height; // Normally the same as the camera, but not if partly rotated bool v4l_multi_buffer; @@ -234,8 +256,9 @@ protected: unsigned int deinterlacing; unsigned int deinterlacing_value; bool videoRecording; + bool rtsp_describe; - int savejpegspref; + int savejpegs; int colours; VideoWriter videowriter; std::string encoderparams; @@ -245,10 +268,13 @@ protected: _AVPIXELFORMAT imagePixFormat; unsigned int subpixelorder; bool record_audio; // Whether to store the audio that we receive + + int brightness; // The statically saved brightness of the camera int contrast; // The statically saved contrast of the camera int hue; // The statically saved hue of the camera int colour; // The statically saved colour of the camera + char event_prefix[64]; // The prefix applied to event names as they are created char label_format[64]; // The format of the timestamp on the images Coord label_coord; // The coordinates of the timestamp on the images @@ -272,7 +298,7 @@ protected: int fps_report_interval; // How many images should be captured/processed between reporting the current FPS int ref_blend_perc; // Percentage of new image going into reference image. int alarm_ref_blend_perc; // Percentage of new image going into reference image during alarm. - bool track_motion; // Whether this monitor tries to track detected motion + bool track_motion; // Whether this monitor tries to track detected motion Rgb signal_check_colour; // The colour that the camera will emit when no video signal detected bool embed_exif; // Whether to embed Exif data into each image frame or not @@ -292,7 +318,7 @@ protected: int first_alarm_count; int last_alarm_count; bool last_signal; - int last_section_mod; + int last_section_mod; int buffer_count; int prealarm_count; State state; @@ -318,8 +344,8 @@ protected: TriggerData *trigger_data; VideoStoreData *video_store_data; - struct timeval *shared_timestamps; - unsigned char *shared_images; + struct timeval *shared_timestamps; + unsigned char *shared_images; ZMPacket *image_buffer; ZMPacket next_buffer; /* Used by four field deinterlacing */ @@ -335,16 +361,18 @@ protected: Image **images; const unsigned char *privacy_bitmask; + std::thread *event_delete_thread; // Used to close events, but continue processing. int n_linked_monitors; MonitorLink **linked_monitors; public: - explicit Monitor( int p_id ); + explicit Monitor(); + explicit Monitor(int p_id); // OurCheckAlarms seems to be unused. Check it on zm_monitor.cpp for more info. //bool OurCheckAlarms( Zone *zone, const Image *pImage ); - Monitor( + Monitor( int p_id, const char *p_name, unsigned int p_server_id, @@ -398,37 +426,31 @@ public: inline int ShmValid() const { return( shared_data->valid ); } + Camera *getCamera(); - inline int Id() const { - return( id ); - } - inline const char *Name() const { - return( name ); - } + inline int Id() const { return id; } + inline const char *Name() const { return name; } inline Storage *getStorage() { if ( ! storage ) { - storage = new Storage( storage_id ); + storage = new Storage(storage_id); } - return( storage ); + return storage; } inline Function GetFunction() const { - return( function ); - } - inline Camera *getCamera() { - return camera; + return function; } inline bool Enabled() { if ( function <= MONITOR ) - return( false ); - return( enabled ); + return false; + return enabled; } inline const char *EventPrefix() const { - return( event_prefix ); + return event_prefix; } inline bool Ready() { if ( function <= MONITOR ) { Error("Should not be calling Ready if the function doesn't include motion detection"); - return( false ); + return false; } if ( image_count >= ready_count ) { return true; @@ -438,57 +460,59 @@ public: } inline bool Active() { if ( function <= MONITOR ) - return( false ); + return false; return( enabled && shared_data->active ); } inline bool Exif() { - return( embed_exif ); + return embed_exif; } inline bool RecordAudio() { return record_audio; } + + /* + inline Purpose Purpose() { return purpose }; + inline Purpose Purpose( Purpose p ) { purpose = p; }; + */ + Orientation getOrientation() const; unsigned int Width() const { return width; } unsigned int Height() const { return height; } unsigned int Colours() const; unsigned int SubpixelOrder() const; - - int GetOptSaveJPEGs() const { return( savejpegspref ); } - VideoWriter GetOptVideoWriter() const { return( videowriter ); } - const std::vector* GetOptEncoderParams() const { return( &encoderparamsvec ); } - const std::string &GetEncoderOptions() const { return( encoderparams ); } + + int GetOptSaveJPEGs() const { return savejpegs; } + VideoWriter GetOptVideoWriter() const { return videowriter; } + const std::vector* GetOptEncoderParams() const { return &encoderparamsvec; } + const std::string &GetEncoderOptions() const { return encoderparams; } const std::string &OutputCodec() const { return output_codec; } const std::string &OutputContainer() const { return output_container; } - uint32_t GetVideoWriterEventId() const { return video_store_data->current_event; } - void SetVideoWriterEventId( uint32_t p_event_id ) { video_store_data->current_event = p_event_id; } - + uint64_t GetVideoWriterEventId() const { return video_store_data->current_event; } + void SetVideoWriterEventId( uint64_t p_event_id ) { video_store_data->current_event = p_event_id; } + unsigned int GetPreEventCount() const { return pre_event_count; }; State GetState() const; int GetImage( int index=-1, int scale=100 ); - ZMPacket *getSnapshot( int index=-1 ); - struct timeval GetTimestamp( int index=-1 ); + ZMPacket *getSnapshot( int index=-1 ) const; + struct timeval GetTimestamp( int index=-1 ) const; void UpdateAdaptiveSkip(); useconds_t GetAnalysisRate(); - unsigned int GetAnalysisUpdateDelay() const { return( analysis_update_delay ); } - int GetCaptureDelay() const { return( capture_delay ); } - int GetAlarmCaptureDelay() const { return( alarm_capture_delay ); } + unsigned int GetAnalysisUpdateDelay() const { return analysis_update_delay; } + int GetCaptureDelay() const { return capture_delay; } + int GetAlarmCaptureDelay() const { return alarm_capture_delay; } unsigned int GetLastReadIndex() const; unsigned int GetLastWriteIndex() const; - uint32_t GetLastEventId() const; + uint64_t GetLastEventId() const; double GetFPS() const; void UpdateAnalysisFPS(); void ForceAlarmOn( int force_score, const char *force_case, const char *force_text="" ); void ForceAlarmOff(); void CancelForced(); - TriggerState GetTriggerState() const { return( (TriggerState)(trigger_data?trigger_data->trigger_state:TRIGGER_CANCEL )); } - inline time_t getStartupTime() const { - return( shared_data->startup_time ); - } - inline void setStartupTime( time_t p_time ) { - shared_data->startup_time = p_time; - } + TriggerState GetTriggerState() const { return (TriggerState)(trigger_data?trigger_data->trigger_state:TRIGGER_CANCEL ); } + inline time_t getStartupTime() const { return shared_data->startup_time; } + inline void setStartupTime( time_t p_time ) { shared_data->startup_time = p_time; } void get_ref_image(); void actionReload(); @@ -525,15 +549,17 @@ public: bool DumpSettings( char *output, bool verbose ); void DumpZoneImage( const char *zone_string=0 ); + static int LoadMonitors(std::string sql, Monitor **&monitors, Purpose purpose); // Returns # of Monitors loaded, 0 on failure. #if ZM_HAS_V4L - static int LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose purpose ); + static int LoadLocalMonitors(const char *device, Monitor **&monitors, Purpose purpose); #endif // ZM_HAS_V4L - static int LoadRemoteMonitors( const char *protocol, const char *host, const char*port, const char*path, Monitor **&monitors, Purpose purpose ); - static int LoadFileMonitors( const char *file, Monitor **&monitors, Purpose purpose ); + static int LoadRemoteMonitors(const char *protocol, const char *host, const char*port, const char*path, Monitor **&monitors, Purpose purpose); + static int LoadFileMonitors(const char *file, Monitor **&monitors, Purpose purpose); #if HAVE_LIBAVFORMAT - static int LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose purpose ); + static int LoadFfmpegMonitors(const char *file, Monitor **&monitors, Purpose purpose); #endif // HAVE_LIBAVFORMAT - static Monitor *Load( unsigned int id, bool load_zones, Purpose purpose ); + static Monitor *Load(unsigned int id, bool load_zones, Purpose purpose); + void Load(MYSQL_ROW dbrow, bool load_zones, Purpose purpose); //void writeStreamImage( Image *image, struct timeval *timestamp, int scale, int mag, int x, int y ); //void StreamImages( int scale=100, int maxfps=10, time_t ttl=0, int msq_id=0 ); //void StreamImagesRaw( int scale=100, int maxfps=10, time_t ttl=0 ); diff --git a/src/zm_monitorstream.cpp b/src/zm_monitorstream.cpp index ae1c2743f..8965f4e4a 100644 --- a/src/zm_monitorstream.cpp +++ b/src/zm_monitorstream.cpp @@ -27,28 +27,28 @@ #include #include -bool MonitorStream::checkSwapPath( const char *path, bool create_path ) { +bool MonitorStream::checkSwapPath(const char *path, bool create_path) { struct stat stat_buf; - if ( stat( path, &stat_buf ) < 0 ) { + if ( stat(path, &stat_buf) < 0 ) { if ( create_path && errno == ENOENT ) { - Debug( 3, "Swap path '%s' missing, creating", path ); - if ( mkdir( path, 0755 ) ) { - Error( "Can't mkdir %s: %s", path, strerror(errno)); - return( false ); + Debug(3, "Swap path '%s' missing, creating", path); + if ( mkdir(path, 0755) ) { + Error("Can't mkdir %s: %s", path, strerror(errno)); + return false; } - if ( stat( path, &stat_buf ) < 0 ) { - Error( "Can't stat '%s': %s", path, strerror(errno) ); - return( false ); + if ( stat(path, &stat_buf) < 0 ) { + Error("Can't stat '%s': %s", path, strerror(errno)); + return false; } } else { - Error( "Can't stat '%s': %s", path, strerror(errno) ); - return( false ); + Error("Can't stat '%s': %s", path, strerror(errno)); + return false; } } if ( !S_ISDIR(stat_buf.st_mode) ) { - Error( "Swap image path '%s' is not a directory", path ); - return( false ); + Error("Swap image path '%s' is not a directory", path); + return false; } uid_t uid = getuid(); @@ -67,73 +67,51 @@ bool MonitorStream::checkSwapPath( const char *path, bool create_path ) { } if ( (stat_buf.st_mode & mask) != mask ) { - Error( "Insufficient permissions on swap image path '%s'", path ); - return( false ); + Error("Insufficient permissions on swap image path '%s'", path); + return false; } - return( true ); + return true; } // end bool MonitorStream::checkSwapPath( const char *path, bool create_path ) -void MonitorStream::processCommand( const CmdMsg *msg ) { +void MonitorStream::processCommand(const CmdMsg *msg) { Debug( 2, "Got message, type %d, msg %d", msg->msg_type, msg->msg_data[0] ); // Check for incoming command switch( (MsgCommand)msg->msg_data[0] ) { case CMD_PAUSE : - { - Debug( 1, "Got PAUSE command" ); - - // Set paused flag + Debug(1, "Got PAUSE command"); paused = true; - // Set delayed flag delayed = true; - last_frame_sent = TV_2_FLOAT( now ); + last_frame_sent = TV_2_FLOAT(now); break; - } case CMD_PLAY : - { - Debug( 1, "Got PLAY command" ); + Debug(1, "Got PLAY command"); if ( paused ) { - // Clear paused flag paused = false; - // Set delayed_play flag delayed = true; } replay_rate = ZM_RATE_BASE; break; - } case CMD_VARPLAY : - { - Debug( 1, "Got VARPLAY command" ); + Debug(1, "Got VARPLAY command"); if ( paused ) { - // Clear paused flag paused = false; - // Set delayed_play flag delayed = true; } replay_rate = ntohs(((unsigned char)msg->msg_data[2]<<8)|(unsigned char)msg->msg_data[1])-32768; break; - } case CMD_STOP : - { - Debug( 1, "Got STOP command" ); - - // Clear paused flag + Debug(1, "Got STOP command"); paused = false; - // Clear delayed_play flag delayed = false; break; - } case CMD_FASTFWD : - { - Debug( 1, "Got FAST FWD command" ); + Debug(1, "Got FAST FWD command"); if ( paused ) { - // Clear paused flag paused = false; - // Set delayed_play flag delayed = true; } // Set play rate - switch ( replay_rate ) - { + switch ( replay_rate ) { case 2 * ZM_RATE_BASE : replay_rate = 5 * ZM_RATE_BASE; break; @@ -152,40 +130,24 @@ void MonitorStream::processCommand( const CmdMsg *msg ) { break; } break; - } case CMD_SLOWFWD : - { Debug( 1, "Got SLOW FWD command" ); - // Set paused flag paused = true; - // Set delayed flag delayed = true; - // Set play rate replay_rate = ZM_RATE_BASE; - // Set step step = 1; break; - } case CMD_SLOWREV : - { Debug( 1, "Got SLOW REV command" ); - // Set paused flag paused = true; - // Set delayed flag delayed = true; - // Set play rate replay_rate = ZM_RATE_BASE; - // Set step step = -1; break; - } case CMD_FASTREV : - { Debug( 1, "Got FAST REV command" ); if ( paused ) { - // Clear paused flag paused = false; - // Set delayed_play flag delayed = true; } // Set play rate @@ -208,9 +170,7 @@ void MonitorStream::processCommand( const CmdMsg *msg ) { break; } break; - } case CMD_ZOOMIN : - { x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; Debug( 1, "Got ZOOM IN command, to %d,%d", x, y ); @@ -233,9 +193,7 @@ void MonitorStream::processCommand( const CmdMsg *msg ) { break; } break; - } case CMD_ZOOMOUT : - { Debug( 1, "Got ZOOM OUT command" ); switch ( zoom ) { case 500: @@ -256,36 +214,25 @@ void MonitorStream::processCommand( const CmdMsg *msg ) { break; } break; - } case CMD_PAN : - { x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; - Debug( 1, "Got PAN command, to %d,%d", x, y ); + Debug(1, "Got PAN command, to %d,%d", x, y); break; - } case CMD_SCALE : - { scale = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; - Debug( 1, "Got SCALE command, to %d", scale ); + Debug(1, "Got SCALE command, to %d", scale); break; - } case CMD_QUIT : - { - Info ("User initiated exit - CMD_QUIT"); + Info("User initiated exit - CMD_QUIT"); break; - } case CMD_QUERY : - { - Debug( 1, "Got QUERY command, sending STATUS" ); + Debug(1, "Got QUERY command, sending STATUS"); break; - } default : - { - Error( "Got unexpected command %d", msg->msg_data[0] ); + Error("Got unexpected command %d", msg->msg_data[0]); break; - } - } + } // end switch command struct { int id; @@ -316,7 +263,7 @@ void MonitorStream::processCommand( const CmdMsg *msg ) { //status_data.enabled = monitor->shared_data->active; status_data.enabled = monitor->trigger_data->trigger_state!=Monitor::TRIGGER_OFF; status_data.forced = monitor->trigger_data->trigger_state==Monitor::TRIGGER_ON; - Debug( 2, "Buffer Level:%d, Delayed:%d, Paused:%d, Rate:%d, delay:%.3f, Zoom:%d, Enabled:%d Forced:%d", + Debug(2, "Buffer Level:%d, Delayed:%d, Paused:%d, Rate:%d, delay:%.3f, Zoom:%d, Enabled:%d Forced:%d", status_data.buffer_level, status_data.delayed, status_data.paused, @@ -329,16 +276,16 @@ void MonitorStream::processCommand( const CmdMsg *msg ) { DataMsg status_msg; status_msg.msg_type = MSG_DATA_WATCH; - memcpy( &status_msg.msg_data, &status_data, sizeof(status_data) ); + memcpy(&status_msg.msg_data, &status_data, sizeof(status_data)); int nbytes = 0; - if ( (nbytes = sendto( sd, &status_msg, sizeof(status_msg), MSG_DONTWAIT, (sockaddr *)&rem_addr, sizeof(rem_addr) )) < 0 ) { + if ( (nbytes = sendto(sd, &status_msg, sizeof(status_msg), MSG_DONTWAIT, (sockaddr *)&rem_addr, sizeof(rem_addr))) < 0 ) { //if ( errno != EAGAIN ) { Error( "Can't sendto on sd %d: %s", sd, strerror(errno) ); //exit( -1 ); } } -Debug(2, "NUmber of bytes sent to (%s): (%d)", rem_addr.sun_path, nbytes ); + Debug(2, "Number of bytes sent to (%s): (%d)", rem_addr.sun_path, nbytes); // quit after sending a status, if this was a quit request if ( (MsgCommand)msg->msg_data[0]==CMD_QUIT ) { @@ -346,11 +293,11 @@ Debug(2, "NUmber of bytes sent to (%s): (%d)", rem_addr.sun_path, nbytes ); exit(0); } - Debug(2,"Updating framrate"); - updateFrameRate( monitor->GetFPS() ); -} // end void MonitorStream::processCommand( const CmdMsg *msg ) + Debug(2,"Updating framerate"); + updateFrameRate(monitor->GetFPS()); +} // end void MonitorStream::processCommand(const CmdMsg *msg) -bool MonitorStream::sendFrame( const char *filepath, struct timeval *timestamp ) { +bool MonitorStream::sendFrame(const char *filepath, struct timeval *timestamp) { bool send_raw = ((scale>=ZM_SCALE_BASE)&&(zoom==ZM_SCALE_BASE)); if ( @@ -361,71 +308,70 @@ bool MonitorStream::sendFrame( const char *filepath, struct timeval *timestamp ) send_raw = false; if ( !send_raw ) { - Image temp_image( filepath ); + Image temp_image(filepath); - return( sendFrame( &temp_image, timestamp ) ); + return sendFrame(&temp_image, timestamp); } else { int img_buffer_size = 0; static unsigned char img_buffer[ZM_MAX_IMAGE_SIZE]; FILE *fdj = NULL; - if ( (fdj = fopen( filepath, "r" )) ) { - img_buffer_size = fread( img_buffer, 1, sizeof(img_buffer), fdj ); - fclose( fdj ); + if ( (fdj = fopen(filepath, "r")) ) { + img_buffer_size = fread(img_buffer, 1, sizeof(img_buffer), fdj); + fclose(fdj); } else { - Error( "Can't open %s: %s", filepath, strerror(errno) ); - return( false ); + Error("Can't open %s: %s", filepath, strerror(errno)); + return false; } // Calculate how long it takes to actually send the frame struct timeval frameStartTime; - gettimeofday( &frameStartTime, NULL ); + gettimeofday(&frameStartTime, NULL); - fprintf( stdout, "--ZoneMinderFrame\r\n" ); - fprintf( stdout, "Content-Length: %d\r\n", img_buffer_size ); - fprintf( stdout, "Content-Type: image/jpeg\r\n\r\n" ); - if ( fwrite( img_buffer, img_buffer_size, 1, stdout ) != 1 ) { + fputs("--ZoneMinderFrame\r\nContent-Type: image/jpeg\r\n\r\n", stdout ); + fprintf(stdout, "Content-Length: %d\r\n", img_buffer_size); + if ( fwrite(img_buffer, img_buffer_size, 1, stdout) != 1 ) { if ( ! zm_terminate ) - Error( "Unable to send stream frame: %s", strerror(errno) ); - return( false ); + Error("Unable to send stream frame: %s", strerror(errno)); + return false; } - fprintf( stdout, "\r\n\r\n" ); - fflush( stdout ); + fputs("\r\n\r\n", stdout); + fflush(stdout); struct timeval frameEndTime; - gettimeofday( &frameEndTime, NULL ); + gettimeofday(&frameEndTime, NULL); - int frameSendTime = tvDiffMsec( frameStartTime, frameEndTime ); + int frameSendTime = tvDiffMsec(frameStartTime, frameEndTime); if ( frameSendTime > 1000/maxfps ) { maxfps /= 2; - Info( "Frame send time %d msec too slow, throttling maxfps to %.2f", frameSendTime, maxfps ); + Info("Frame send time %d msec too slow, throttling maxfps to %.2f", frameSendTime, maxfps); } - last_frame_sent = TV_2_FLOAT( now ); + last_frame_sent = TV_2_FLOAT(now); - return( true ); + return true; } - return( false ); -} + return false; +} // end bool MonitorStream::sendFrame(const char *filepath, struct timeval *timestamp) -bool MonitorStream::sendFrame( Image *image, struct timeval *timestamp ) { - Image *send_image = prepareImage( image ); +bool MonitorStream::sendFrame(Image *image, struct timeval *timestamp) { + Image *send_image = prepareImage(image); if ( !config.timestamp_on_capture && timestamp ) - monitor->TimestampImage( send_image, timestamp ); + monitor->TimestampImage(send_image, timestamp); #if HAVE_LIBAVCODEC if ( type == STREAM_MPEG ) { if ( !vid_stream ) { - vid_stream = new VideoStream( "pipe:", format, bitrate, effective_fps, send_image->Colours(), send_image->SubpixelOrder(), send_image->Width(), send_image->Height() ); - fprintf( stdout, "Content-type: %s\r\n\r\n", vid_stream->MimeType() ); + vid_stream = new VideoStream("pipe:", format, bitrate, effective_fps, send_image->Colours(), send_image->SubpixelOrder(), send_image->Width(), send_image->Height()); + fprintf(stdout, "Content-type: %s\r\n\r\n", vid_stream->MimeType()); vid_stream->OpenStream(); } static struct timeval base_time; struct DeltaTimeval delta_time; if ( !frame_count ) base_time = *timestamp; - DELTA_TIMEVAL( delta_time, *timestamp, base_time, DT_PREC_3 ); - /* double pts = */ vid_stream->EncodeFrame( send_image->Buffer(), send_image->Size(), config.mpeg_timed_frames, delta_time.delta ); + DELTA_TIMEVAL(delta_time, *timestamp, base_time, DT_PREC_3); + /* double pts = */ vid_stream->EncodeFrame(send_image->Buffer(), send_image->Size(), config.mpeg_timed_frames, delta_time.delta); } else #endif // HAVE_LIBAVCODEC { @@ -436,36 +382,38 @@ bool MonitorStream::sendFrame( Image *image, struct timeval *timestamp ) { // Calculate how long it takes to actually send the frame struct timeval frameStartTime; - gettimeofday( &frameStartTime, NULL ); + gettimeofday(&frameStartTime, NULL); - fprintf( stdout, "--ZoneMinderFrame\r\n" ); + fputs("--ZoneMinderFrame\r\n", stdout); switch( type ) { case STREAM_JPEG : - send_image->EncodeJpeg( img_buffer, &img_buffer_size ); - fprintf( stdout, "Content-Type: image/jpeg\r\n" ); + send_image->EncodeJpeg(img_buffer, &img_buffer_size); + fputs("Content-Type: image/jpeg\r\n", stdout); break; case STREAM_RAW : - fprintf( stdout, "Content-Type: image/x-rgb\r\n" ); + fputs("Content-Type: image/x-rgb\r\n", stdout); img_buffer = (uint8_t*)send_image->Buffer(); img_buffer_size = send_image->Size(); break; case STREAM_ZIP : - fprintf( stdout, "Content-Type: image/x-rgbz\r\n" ); + fputs("Content-Type: image/x-rgbz\r\n",stdout); unsigned long zip_buffer_size; - send_image->Zip( img_buffer, &zip_buffer_size ); + send_image->Zip(img_buffer, &zip_buffer_size); img_buffer_size = zip_buffer_size; break; default : - Fatal( "Unexpected frame type %d", type ); - break; + Error("Unexpected frame type %d", type); + return false; } - fprintf( stdout, "Content-Length: %d\r\n\r\n", img_buffer_size ); - if ( fwrite( img_buffer, img_buffer_size, 1, stdout ) != 1 ) { - if ( !zm_terminate ) - Error( "Unable to send stream frame: %s", strerror(errno) ); - return( false ); + fprintf(stdout, "Content-Length: %d\r\n\r\n", img_buffer_size); + if ( fwrite(img_buffer, img_buffer_size, 1, stdout) != 1 ) { + if ( !zm_terminate ){ + // If the pipe was closed, we will get signalled SIGPIPE to exit, which will set zm_terminate + Error("Unable to send stream frame: %s", strerror(errno)); + } + return false; } - fprintf( stdout, "\r\n\r\n" ); + fputs("\r\n\r\n",stdout); fflush( stdout ); struct timeval frameEndTime; @@ -484,27 +432,27 @@ bool MonitorStream::sendFrame( Image *image, struct timeval *timestamp ) { void MonitorStream::runStream() { if ( type == STREAM_SINGLE ) { // Not yet migrated over to stream class - SingleImage( scale ); + SingleImage(scale); return; } openComms(); - if ( ! checkInitialised() ) { + if ( !checkInitialised() ) { Error("Not initialized"); return; } - updateFrameRate( monitor->GetFPS() ); + updateFrameRate(monitor->GetFPS()); if ( type == STREAM_JPEG ) - fprintf( stdout, "Content-Type: multipart/x-mixed-replace;boundary=ZoneMinderFrame\r\n\r\n" ); + fputs("Content-Type: multipart/x-mixed-replace;boundary=ZoneMinderFrame\r\n\r\n", stdout); // point to end which is theoretically not a valid value because all indexes are % image_buffer_count unsigned int last_read_index = monitor->image_buffer_count; time_t stream_start_time; - time( &stream_start_time ); + time(&stream_start_time); frame_count = 0; @@ -513,48 +461,47 @@ void MonitorStream::runStream() { temp_read_index = temp_image_buffer_count; temp_write_index = temp_image_buffer_count; - char *swap_path = 0; + std::string swap_path; bool buffered_playback = false; + // Last image and timestamp when paused, will be resent occasionally to prevent timeout + Image *paused_image = NULL; + struct timeval paused_timestamp; + // 15 is the max length for the swap path suffix, /zmswap-whatever, assuming max 6 digits for monitor id const int max_swap_len_suffix = 15; int swap_path_length = staticConfig.PATH_SWAP.length() + 1; // +1 for NULL terminator - int subfolder1_length = snprintf(NULL, 0, "/zmswap-m%d", monitor->Id() ) + 1; - int subfolder2_length = snprintf(NULL, 0, "/zmswap-q%06d", connkey ) + 1; + int subfolder1_length = snprintf(NULL, 0, "/zmswap-m%d", monitor->Id()) + 1; + int subfolder2_length = snprintf(NULL, 0, "/zmswap-q%06d", connkey) + 1; int total_swap_path_length = swap_path_length + subfolder1_length + subfolder2_length; - if ( connkey && playback_buffer > 0 ) { + if ( connkey && ( playback_buffer > 0 ) ) { if ( total_swap_path_length + max_swap_len_suffix > PATH_MAX ) { - Error( "Swap Path is too long. %d > %d ", total_swap_path_length+max_swap_len_suffix, PATH_MAX ); + Error("Swap Path is too long. %d > %d ", total_swap_path_length+max_swap_len_suffix, PATH_MAX); } else { - swap_path = (char *)malloc( total_swap_path_length+max_swap_len_suffix ); - strncpy( swap_path, staticConfig.PATH_SWAP.c_str(), swap_path_length ); + swap_path = staticConfig.PATH_SWAP; - Debug( 3, "Checking swap path folder: %s", swap_path ); - if ( checkSwapPath( swap_path, false ) ) { - // Append the subfolder name /zmswap-m{monitor-id} to the end of swap_path - int ndx = swap_path_length - 1; // Array index of the NULL terminator - snprintf( &(swap_path[ndx]), subfolder1_length, "/zmswap-m%d", monitor->Id() ); + Debug( 3, "Checking swap path folder: %s", swap_path.c_str() ); + if ( checkSwapPath(swap_path.c_str(), false) ) { + swap_path += stringtf("/zmswap-m%d", monitor->Id()); - Debug( 4, "Checking swap path subfolder: %s", swap_path ); - if ( checkSwapPath( swap_path, true ) ) { - // Append the subfolder name /zmswap-q{connection key} to the end of swap_path - ndx = swap_path_length+subfolder1_length - 2; // Array index of the NULL terminator - snprintf( &(swap_path[ndx]), subfolder2_length, "/zmswap-q%06d", connkey ); + Debug(4, "Checking swap path subfolder: %s", swap_path.c_str()); + if ( checkSwapPath(swap_path.c_str(), true) ) { + swap_path += stringtf("/zmswap-q%06d", connkey); - Debug( 4, "Checking swap path subfolder: %s", swap_path ); - if ( checkSwapPath( swap_path, true ) ) { + Debug(4, "Checking swap path subfolder: %s", swap_path.c_str()); + if ( checkSwapPath(swap_path.c_str(), true) ) { buffered_playback = true; } } } if ( !buffered_playback ) { - Error( "Unable to validate swap image path, disabling buffered playback" ); + Error("Unable to validate swap image path, disabling buffered playback"); } else { - Debug( 2, "Assigning temporary buffer" ); + Debug(2, "Assigning temporary buffer"); temp_image_buffer = new SwapImage[temp_image_buffer_count]; memset( temp_image_buffer, 0, sizeof(*temp_image_buffer)*temp_image_buffer_count ); Debug( 2, "Assigned temporary buffer" ); @@ -567,19 +514,20 @@ void MonitorStream::runStream() { float max_secs_since_last_sent_frame = 10.0; //should be > keep alive amount (5 secs) while ( !zm_terminate ) { bool got_command = false; - if ( feof( stdout ) || ferror( stdout ) || !monitor->ShmValid() ) { - if ( feof( stdout ) ) { - Debug(2,"feof stdout"); - } else if ( ferror( stdout ) ) { - Debug(2,"ferror stdout"); - } else if ( !monitor->ShmValid() ) { - Debug(2,"monitor not valid.... maybe we should wait until it comes back."); - } + if ( feof(stdout) ) { + Debug(2,"feof stdout"); + break; + } else if ( ferror(stdout) ) { + Debug(2,"ferror stdout"); + break; + } else if ( !monitor->ShmValid() ) { + Debug(2,"monitor not valid.... maybe we should wait until it comes back."); break; } - gettimeofday( &now, NULL ); + gettimeofday(&now, NULL); + bool was_paused = paused; if ( connkey ) { while(checkCommandQueue()) { Debug(2, "Have checking command Queue for connkey: %d", connkey ); @@ -587,7 +535,19 @@ Debug(2, "Have checking command Queue for connkey: %d", connkey ); } } - //bool frame_sent = false; + if ( paused ) { + if ( !was_paused ) { + int index = monitor->shared_data->last_write_index % monitor->image_buffer_count; + Debug(1,"Saving paused image from index %d",index); + paused_image = new Image( *monitor->image_buffer[index].image ); + paused_timestamp = *(monitor->image_buffer[index].timestamp); + } + } else if ( paused_image ) { + Debug(1,"Clearing paused_image"); + delete paused_image; + paused_image = NULL; + } + if ( buffered_playback && delayed ) { if ( temp_read_index == temp_write_index ) { // Go back to live viewing @@ -599,14 +559,14 @@ Debug(2, "Have checking command Queue for connkey: %d", connkey ); replay_rate = ZM_RATE_BASE; } else { if ( !paused ) { - int temp_index = MOD_ADD( temp_read_index, 0, temp_image_buffer_count ); + int temp_index = MOD_ADD(temp_read_index, 0, temp_image_buffer_count); //Debug( 3, "tri: %d, ti: %d", temp_read_index, temp_index ); SwapImage *swap_image = &temp_image_buffer[temp_index]; if ( !swap_image->valid ) { paused = true; delayed = true; - temp_read_index = MOD_ADD( temp_read_index, (replay_rate>=0?-1:1), temp_image_buffer_count ); + temp_read_index = MOD_ADD(temp_read_index, (replay_rate>=0?-1:1), temp_image_buffer_count); } else { //Debug( 3, "siT: %f, lfT: %f", TV_2_FLOAT( swap_image->timestamp ), TV_2_FLOAT( last_frame_timestamp ) ); double expected_delta_time = ((TV_2_FLOAT( swap_image->timestamp ) - TV_2_FLOAT( last_frame_timestamp )) * ZM_RATE_BASE)/replay_rate; @@ -619,12 +579,12 @@ Debug(2, "Have checking command Queue for connkey: %d", connkey ); if ( temp_index%frame_mod == 0 ) { Debug( 2, "Sending delayed frame %d", temp_index ); // Send the next frame - if ( ! sendFrame( temp_image_buffer[temp_index].file_name, &temp_image_buffer[temp_index].timestamp ) ) + if ( ! sendFrame(temp_image_buffer[temp_index].file_name, &temp_image_buffer[temp_index].timestamp) ) zm_terminate = true; - memcpy( &last_frame_timestamp, &(swap_image->timestamp), sizeof(last_frame_timestamp) ); + memcpy(&last_frame_timestamp, &(swap_image->timestamp), sizeof(last_frame_timestamp)); //frame_sent = true; } - temp_read_index = MOD_ADD( temp_read_index, (replay_rate>0?1:-1), temp_image_buffer_count ); + temp_read_index = MOD_ADD(temp_read_index, (replay_rate>0?1:-1), temp_image_buffer_count); } } } else if ( step != 0 ) { @@ -639,7 +599,8 @@ Debug(2, "Have checking command Queue for connkey: %d", connkey ); //frame_sent = true; step = 0; } else { - int temp_index = MOD_ADD( temp_read_index, 0, temp_image_buffer_count ); + //paused? + int temp_index = MOD_ADD(temp_read_index, 0, temp_image_buffer_count); double actual_delta_time = TV_2_FLOAT( now ) - last_frame_sent; if ( got_command || actual_delta_time > 5 ) { @@ -650,8 +611,9 @@ Debug(2, "Have checking command Queue for connkey: %d", connkey ); zm_terminate = true; //frame_sent = true; } - } - } + } // end if (!paused) or step or paused + } // end if have exceeded buffer or not + if ( temp_read_index == temp_write_index ) { // Go back to live viewing Warning( "Rewound over write index, resuming live play" ); @@ -662,10 +624,12 @@ Debug(2, "Have checking command Queue for connkey: %d", connkey ); replay_rate = ZM_RATE_BASE; } } // end if ( buffered_playback && delayed ) + if ( last_read_index != monitor->shared_data->last_write_index ) { + // have a new image to send int index = monitor->shared_data->last_write_index % monitor->image_buffer_count; // % shouldn't be neccessary last_read_index = monitor->shared_data->last_write_index; - Debug( 3, "index: %d: frame_mod: %d frame count: %d", index, frame_mod, frame_count ); + Debug( 2, "index: %d: frame_mod: %d frame count: %d paused(%d) delayed(%d)", index, frame_mod, frame_count, paused, delayed ); if ( (frame_mod == 1) || ((frame_count%frame_mod) == 0) ) { if ( !paused && !delayed ) { // Send the next frame @@ -674,24 +638,38 @@ Debug(2, "Have checking command Queue for connkey: %d", connkey ); Image *image = snap->image;// This works because connect rebuilds the image_buffer links struct timeval *timestamp = snap->timestamp; - if ( !sendFrame( image, timestamp ) ) { + if ( !sendFrame(snap->image, snap->timestamp) ) { Debug(2, "sendFrame failed, quiting."); zm_terminate = true; } + // Perhaps we should use NOW instead. last_frame_timestamp = *timestamp; //frame_sent = true; temp_read_index = temp_write_index; + } else { + double actual_delta_time = TV_2_FLOAT(now) - last_frame_sent; + if ( actual_delta_time > 5 ) { + if ( paused_image ) { + // Send keepalive + Debug(2, "Sending keepalive frame "); + // Send the next frame + if ( !sendFrame(paused_image, &paused_timestamp) ) + zm_terminate = true; + } else { + Debug(2, "Would have sent keepalive frame, but had no paused_image "); + } + } } } // end if should send frame - if ( buffered_playback ) { + if ( buffered_playback && !paused ) { if ( monitor->shared_data->valid ) { if ( monitor->shared_timestamps[index].tv_sec ) { int temp_index = temp_write_index%temp_image_buffer_count; - Debug( 2, "Storing frame %d", temp_index ); + Debug(2, "Storing frame %d", temp_index); if ( !temp_image_buffer[temp_index].valid ) { - snprintf( temp_image_buffer[temp_index].file_name, sizeof(temp_image_buffer[0].file_name), "%s/zmswap-i%05d.jpg", swap_path, temp_index ); + snprintf( temp_image_buffer[temp_index].file_name, sizeof(temp_image_buffer[0].file_name), "%s/zmswap-i%05d.jpg", swap_path.c_str(), temp_index ); temp_image_buffer[temp_index].valid = true; } temp_image_buffer[temp_index].timestamp = monitor->shared_timestamps[index]; @@ -700,9 +678,7 @@ Debug(2, "Have checking command Queue for connkey: %d", connkey ); if ( temp_write_index == temp_read_index ) { // Go back to live viewing Warning( "Exceeded temporary buffer, resuming live play" ); - // Clear paused flag paused = false; - // Clear delayed_play flag delayed = false; replay_rate = ZM_RATE_BASE; } @@ -720,7 +696,7 @@ Debug(2, "Have checking command Queue for connkey: %d", connkey ); unsigned long sleep_time = (unsigned long)((1000000 * ZM_RATE_BASE)/((base_fps?base_fps:1)*abs(replay_rate*2))); Debug(4, "Sleeping for (%d)", sleep_time); - usleep( sleep_time ); + usleep(sleep_time); if ( ttl ) { if ( (now.tv_sec - stream_start_time) > ttl ) { Debug(2, "now(%d) - start(%d) > ttl(%d) break", now.tv_sec, stream_start_time, ttl); @@ -731,50 +707,49 @@ Debug(2, "Have checking command Queue for connkey: %d", connkey ); // If we didn't capture above, because frame_mod was bad? Then last_frame_sent will not have a value. last_frame_sent = now.tv_sec; Warning( "no last_frame_sent. Shouldn't happen. frame_mod was (%d) frame_count (%d) ", frame_mod, frame_count ); - } else if ( (TV_2_FLOAT( now ) - last_frame_sent) > max_secs_since_last_sent_frame ) { + } else if ( (!paused) && ( (TV_2_FLOAT( now ) - last_frame_sent) > max_secs_since_last_sent_frame ) ) { Error( "Terminating, last frame sent time %f secs more than maximum of %f", TV_2_FLOAT( now ) - last_frame_sent, max_secs_since_last_sent_frame ); break; } } // end while if ( buffered_playback ) { - Debug( 1, "Cleaning swap files from %s", swap_path ); + Debug(1, "Cleaning swap files from %s", swap_path.c_str()); struct stat stat_buf; - if ( stat( swap_path, &stat_buf ) < 0 ) { + if ( stat(swap_path.c_str(), &stat_buf) < 0 ) { if ( errno != ENOENT ) { - Error( "Can't stat '%s': %s", swap_path, strerror(errno) ); + Error("Can't stat '%s': %s", swap_path.c_str(), strerror(errno)); } } else if ( !S_ISDIR(stat_buf.st_mode) ) { - Error( "Swap image path '%s' is not a directory", swap_path ); + Error("Swap image path '%s' is not a directory", swap_path.c_str()); } else { char glob_pattern[PATH_MAX] = ""; - snprintf( glob_pattern, sizeof(glob_pattern), "%s/*.*", swap_path ); + snprintf(glob_pattern, sizeof(glob_pattern), "%s/*.*", swap_path.c_str()); glob_t pglob; - int glob_status = glob( glob_pattern, 0, 0, &pglob ); + int glob_status = glob(glob_pattern, 0, 0, &pglob); if ( glob_status != 0 ) { if ( glob_status < 0 ) { - Error( "Can't glob '%s': %s", glob_pattern, strerror(errno) ); + Error("Can't glob '%s': %s", glob_pattern, strerror(errno)); } else { - Debug( 1, "Can't glob '%s': %d", glob_pattern, glob_status ); + Debug(1, "Can't glob '%s': %d", glob_pattern, glob_status); } } else { for ( unsigned int i = 0; i < pglob.gl_pathc; i++ ) { - if ( unlink( pglob.gl_pathv[i] ) < 0 ) { - Error( "Can't unlink '%s': %s", pglob.gl_pathv[i], strerror(errno) ); + if ( unlink(pglob.gl_pathv[i]) < 0 ) { + Error("Can't unlink '%s': %s", pglob.gl_pathv[i], strerror(errno)); } } } globfree( &pglob ); - if ( rmdir( swap_path ) < 0 ) { - Error( "Can't rmdir '%s': %s", swap_path, strerror(errno) ); + if ( rmdir(swap_path.c_str()) < 0 ) { + Error( "Can't rmdir '%s': %s", swap_path.c_str(), strerror(errno) ); } } // end if checking for swap_path } // end if buffered_playback - if ( swap_path ) free( swap_path ); closeComms(); -} +} // end MonitorStream::runStream void MonitorStream::SingleImage( int scale ) { int img_buffer_size = 0; diff --git a/src/zm_monitorstream.h b/src/zm_monitorstream.h index 95f538765..f3351d3b7 100644 --- a/src/zm_monitorstream.h +++ b/src/zm_monitorstream.h @@ -58,7 +58,9 @@ class MonitorStream : public StreamBase { void SingleImageZip( int scale=100 ); public: - MonitorStream() : ttl(0), playback_buffer(0), delayed(false), frame_count(0) { + MonitorStream() : + temp_image_buffer(NULL), temp_image_buffer_count(0), temp_read_index(0), temp_write_index(0), + ttl(0), playback_buffer(0), delayed(false), frame_count(0) { } void setStreamBuffer( int p_playback_buffer ) { playback_buffer = p_playback_buffer; diff --git a/src/zm_mpeg.cpp b/src/zm_mpeg.cpp index 1a09893c7..d8a26242f 100644 --- a/src/zm_mpeg.cpp +++ b/src/zm_mpeg.cpp @@ -293,7 +293,7 @@ const char *VideoStream::MimeType( ) const { return mime_type; } -void VideoStream::OpenStream( ) { +bool VideoStream::OpenStream( ) { int ret; /* now that all the parameters are set, we can open the @@ -308,7 +308,8 @@ void VideoStream::OpenStream( ) { if ( (ret = avcodec_open2(codec_context, codec, 0)) < 0 ) #endif { - Fatal( "Could not open codec. Error code %d \"%s\"", ret, av_err2str(ret) ); + Error("Could not open codec. Error code %d \"%s\"", ret, av_err2str(ret)); + return false; } Debug( 1, "Opened codec" ); @@ -316,22 +317,24 @@ void VideoStream::OpenStream( ) { /* allocate the encoded raw picture */ opicture = zm_av_frame_alloc( ); if ( !opicture ) { - Panic( "Could not allocate opicture" ); + Error("Could not allocate opicture"); + return false; } opicture->width = codec_context->width; opicture->height = codec_context->height; opicture->format = codec_context->pix_fmt; #if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0) - int size = av_image_get_buffer_size( codec_context->pix_fmt, codec_context->width, codec_context->height, 1 ); + int size = av_image_get_buffer_size(codec_context->pix_fmt, codec_context->width, codec_context->height, 1); #else - int size = avpicture_get_size( codec_context->pix_fmt, codec_context->width, codec_context->height ); + int size = avpicture_get_size(codec_context->pix_fmt, codec_context->width, codec_context->height); #endif - uint8_t *opicture_buf = (uint8_t *)av_malloc( size ); + uint8_t *opicture_buf = (uint8_t *)av_malloc(size); if ( !opicture_buf ) { av_frame_free( &opicture ); - Panic( "Could not allocate opicture_buf" ); + Error( "Could not allocate opicture_buf" ); + return false; } #if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0) av_image_fill_arrays(opicture->data, opicture->linesize, @@ -352,7 +355,8 @@ void VideoStream::OpenStream( ) { tmp_opicture = avcodec_alloc_frame( ); #endif if ( !tmp_opicture ) { - Panic( "Could not allocate tmp_opicture" ); + Error( "Could not allocate tmp_opicture" ); + return false; } #if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0) int size = av_image_get_buffer_size( pf, codec_context->width, codec_context->height,1 ); @@ -362,7 +366,8 @@ void VideoStream::OpenStream( ) { uint8_t *tmp_opicture_buf = (uint8_t *)av_malloc( size ); if ( !tmp_opicture_buf ) { av_frame_free( &tmp_opicture ); - Panic( "Could not allocate tmp_opicture_buf" ); + Error( "Could not allocate tmp_opicture_buf" ); + return false; } #if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0) av_image_fill_arrays(tmp_opicture->data, @@ -385,12 +390,14 @@ void VideoStream::OpenStream( ) { ret = url_fopen( &ofc->pb, filename, AVIO_FLAG_WRITE ); #endif if ( ret < 0 ) { - Fatal( "Could not open '%s'", filename ); + Error("Could not open '%s'", filename); + return false; } - Debug( 1, "Opened output \"%s\"", filename ); + Debug(1, "Opened output \"%s\"", filename); } else { - Fatal( "of->flags & AVFMT_NOFILE" ); + Error( "of->flags & AVFMT_NOFILE" ); + return false; } video_outbuf = NULL; @@ -417,14 +424,16 @@ void VideoStream::OpenStream( ) { #endif #if !LIBAVFORMAT_VERSION_CHECK(53, 2, 0, 4, 0) - ret = av_write_header( ofc ); + ret = av_write_header(ofc); #else - ret = avformat_write_header(ofc, NULL); + ret = avformat_write_header(ofc, NULL); #endif - if ( ret < 0 ) { - Fatal( "?_write_header failed with error %d \"%s\"", ret, av_err2str( ret ) ); - } + if ( ret < 0 ) { + Error("?_write_header failed with error %d \"%s\"", ret, av_err2str(ret)); + return false; + } + return true; } VideoStream::VideoStream( const char *in_filename, const char *in_format, int bitrate, double frame_rate, int colours, int subpixelorder, int width, int height ) : @@ -550,19 +559,20 @@ VideoStream::~VideoStream( ) { } double VideoStream::EncodeFrame( const uint8_t *buffer, int buffer_size, bool _add_timestamp, unsigned int _timestamp ) { - if ( pthread_mutex_lock( buffer_copy_lock ) != 0 ) { + if ( pthread_mutex_lock(buffer_copy_lock) != 0 ) { Fatal( "EncodeFrame: pthread_mutex_lock failed." ); } if (buffer_copy_size < buffer_size) { if ( buffer_copy ) { - av_free( buffer_copy ); + av_free(buffer_copy); } // Allocate a buffer to store source images for the streaming thread to encode. - buffer_copy = (uint8_t *)av_malloc( buffer_size ); + buffer_copy = (uint8_t *)av_malloc(buffer_size); if ( !buffer_copy ) { - Panic( "Could not allocate buffer_copy" ); + Error( "Could not allocate buffer_copy" ); + pthread_mutex_unlock(buffer_copy_lock); return 0; } buffer_copy_size = buffer_size; @@ -573,7 +583,7 @@ double VideoStream::EncodeFrame( const uint8_t *buffer, int buffer_size, bool _a buffer_copy_used = buffer_size; memcpy(buffer_copy, buffer, buffer_size); - if ( pthread_mutex_unlock( buffer_copy_lock ) != 0 ) { + if ( pthread_mutex_unlock(buffer_copy_lock) != 0 ) { Fatal( "EncodeFrame: pthread_mutex_unlock failed." ); } diff --git a/src/zm_mpeg.h b/src/zm_mpeg.h index fbc3eed4d..6e75f8743 100644 --- a/src/zm_mpeg.h +++ b/src/zm_mpeg.h @@ -1,21 +1,21 @@ /* * ZoneMinder MPEG Interface, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ +*/ #ifndef ZM_MPEG_H #define ZM_MPEG_H @@ -51,7 +51,7 @@ protected: uint8_t *video_outbuf; int video_outbuf_size; double last_pts; - + pthread_t streaming_thread; bool do_streaming; bool add_timestamp; @@ -78,7 +78,7 @@ public: VideoStream( const char *filename, const char *format, int bitrate, double frame_rate, int colours, int subpixelorder, int width, int height ); ~VideoStream(); const char *MimeType() const; - void OpenStream(); + bool OpenStream(); double EncodeFrame( const uint8_t *buffer, int buffer_size, bool add_timestamp=false, unsigned int timestamp=0 ); }; diff --git a/src/zm_packet.cpp b/src/zm_packet.cpp index 3674144b1..b203b83d8 100644 --- a/src/zm_packet.cpp +++ b/src/zm_packet.cpp @@ -191,8 +191,8 @@ Image *ZMPacket::set_image( Image *i ) { return image; } -AVPacket *ZMPacket::set_packet( AVPacket *p ) { - if ( zm_av_packet_ref( &packet, p ) < 0 ) { +AVPacket *ZMPacket::set_packet(AVPacket *p) { + if ( zm_av_packet_ref(&packet, p) < 0 ) { Error("error refing packet"); } dumpPacket(&packet, "zmpacket:"); diff --git a/src/zm_stream.cpp b/src/zm_stream.cpp index 1a0e74560..f911f2c78 100644 --- a/src/zm_stream.cpp +++ b/src/zm_stream.cpp @@ -39,48 +39,49 @@ StreamBase::~StreamBase() { closeComms(); } -bool StreamBase::loadMonitor( int monitor_id ) { - if ( !(monitor = Monitor::Load( monitor_id, false, Monitor::QUERY )) ) { - Fatal( "Unable to load monitor id %d for streaming", monitor_id ); - return( false ); +bool StreamBase::loadMonitor(int monitor_id) { + if ( !(monitor = Monitor::Load(monitor_id, false, Monitor::QUERY)) ) { + Error("Unable to load monitor id %d for streaming", monitor_id); + return false; } if ( ! monitor->connect() ) { - Fatal( "Unable to connect to monitor id %d for streaming", monitor_id ); - return( false ); + Error("Unable to connect to monitor id %d for streaming", monitor_id); + return false; } - - return( true ); + + return true; } bool StreamBase::checkInitialised() { if ( !monitor ) { Fatal( "Cannot stream, not initialised" ); - return( false ); + return false; } - return( true ); + return true; } -void StreamBase::updateFrameRate( double fps ) { +void StreamBase::updateFrameRate(double fps) { base_fps = fps; effective_fps = (base_fps*abs(replay_rate))/ZM_RATE_BASE; frame_mod = 1; - Debug( 3, "FPS:%.2f, MXFPS:%.2f, BFPS:%.2f, EFPS:%.2f, FM:%d", fps, maxfps, base_fps, effective_fps, frame_mod ); + Debug(3, "FPS:%.2f, MXFPS:%.2f, BFPS:%.2f, EFPS:%.2f, FM:%d", fps, maxfps, base_fps, effective_fps, frame_mod); // Min frame repeat? while( effective_fps > maxfps ) { effective_fps /= 2.0; frame_mod *= 2; - Debug( 3, "aEFPS:%.2f, aFM:%d", effective_fps, frame_mod ); + Debug(3, "EffectiveFPS:%.2f, FrameMod:%d", effective_fps, frame_mod); } } bool StreamBase::checkCommandQueue() { if ( sd >= 0 ) { CmdMsg msg; - memset( &msg, 0, sizeof(msg) ); - int nbytes = recvfrom( sd, &msg, sizeof(msg), MSG_DONTWAIT, 0, 0 ); + memset(&msg, 0, sizeof(msg)); + int nbytes = recvfrom(sd, &msg, sizeof(msg), MSG_DONTWAIT, 0, 0); if ( nbytes < 0 ) { if ( errno != EAGAIN ) { - Fatal( "recvfrom(), errno = %d, error = %s", errno, strerror(errno) ); + Error("recvfrom(), errno = %d, error = %s", errno, strerror(errno)); + return false; } } //else if ( (nbytes != sizeof(msg)) ) @@ -88,14 +89,14 @@ bool StreamBase::checkCommandQueue() { //Error( "Partial message received, expected %d bytes, got %d", sizeof(msg), nbytes ); //} else { -Debug(2, "Message length is (%d)", nbytes ); - processCommand( &msg ); - return( true ); + Debug(2, "Message length is (%d)", nbytes); + processCommand(&msg); + return true; } } else { - Error("sd is < 0"); + Warning("No sd in checkCommandQueue, comms not open?"); } - return( false ); + return false; } Image *StreamBase::prepareImage( Image *image ) { @@ -152,18 +153,18 @@ Image *StreamBase::prepareImage( Image *image ) { if ( mag != ZM_SCALE_BASE ) { if ( act_mag != ZM_SCALE_BASE ) { - Debug( 3, "Magnifying by %d", mag ); + Debug(3, "Magnifying by %d", mag); if ( !image_copied ) { static Image copy_image; - copy_image.Assign( *image ); + copy_image.Assign(*image); image = ©_image; image_copied = true; } - image->Scale( mag ); + image->Scale(mag); } } - Debug( 3, "Real image width = %d, height = %d", image->Width(), image->Height() ); + Debug(3, "Real image width = %d, height = %d", image->Width(), image->Height()); if ( disp_image_width < virt_image_width || disp_image_height < virt_image_height ) { static Box last_crop; @@ -222,23 +223,23 @@ Image *StreamBase::prepareImage( Image *image ) { last_x = x; last_y = y; - return( image ); + return image; } bool StreamBase::sendTextFrame( const char *frame_text ) { - Debug( 2, "Sending text frame '%s'", frame_text ); + Debug(2, "Sending text frame '%s'", frame_text); - Image image( monitor->Width(), monitor->Height(), monitor->Colours(), monitor->SubpixelOrder() ); - image.Annotate( frame_text, image.centreCoord( frame_text ) ); + Image image(monitor->Width(), monitor->Height(), monitor->Colours(), monitor->SubpixelOrder()); + image.Annotate(frame_text, image.centreCoord(frame_text)); if ( scale != 100 ) { - image.Scale( scale ); + image.Scale(scale); } #if HAVE_LIBAVCODEC if ( type == STREAM_MPEG ) { if ( !vid_stream ) { - vid_stream = new VideoStream( "pipe:", format, bitrate, effective_fps, image.Colours(), image.SubpixelOrder(), image.Width(), image.Height() ); - fprintf( stdout, "Content-type: %s\r\n\r\n", vid_stream->MimeType() ); + vid_stream = new VideoStream("pipe:", format, bitrate, effective_fps, image.Colours(), image.SubpixelOrder(), image.Width(), image.Height()); + fprintf(stdout, "Content-type: %s\r\n\r\n", vid_stream->MimeType()); vid_stream->OpenStream(); } /* double pts = */ vid_stream->EncodeFrame( image.Buffer(), image.Size() ); @@ -248,30 +249,29 @@ bool StreamBase::sendTextFrame( const char *frame_text ) { static unsigned char buffer[ZM_MAX_IMAGE_SIZE]; int n_bytes = 0; - image.EncodeJpeg( buffer, &n_bytes ); + image.EncodeJpeg(buffer, &n_bytes); - fprintf( stdout, "--ZoneMinderFrame\r\n" ); - fprintf( stdout, "Content-Length: %d\r\n", n_bytes ); - fprintf( stdout, "Content-Type: image/jpeg\r\n\r\n" ); - if ( fwrite( buffer, n_bytes, 1, stdout ) != 1 ) { - Error( "Unable to send stream text frame: %s", strerror(errno) ); - return( false ); + fputs("--ZoneMinderFrame\r\nContent-Type: image/jpeg\r\n\r\n", stdout); + fprintf(stdout, "Content-Length: %d\r\n", n_bytes); + if ( fwrite(buffer, n_bytes, 1, stdout) != 1 ) { + Error("Unable to send stream text frame: %s", strerror(errno)); + return false; } - fprintf( stdout, "\r\n\r\n" ); - fflush( stdout ); + fputs("\r\n\r\n",stdout); + fflush(stdout); } - last_frame_sent = TV_2_FLOAT( now ); - return( true ); + last_frame_sent = TV_2_FLOAT(now); + return true; } void StreamBase::openComms() { if ( connkey > 0 ) { - unsigned int length = snprintf( sock_path_lock, sizeof(sock_path_lock), "%s/zms-%06d.lock", staticConfig.PATH_SOCKS.c_str(), connkey); + unsigned int length = snprintf(sock_path_lock, sizeof(sock_path_lock), "%s/zms-%06d.lock", staticConfig.PATH_SOCKS.c_str(), connkey); if ( length >= sizeof(sock_path_lock) ) { Warning("Socket lock path was truncated."); } - Debug( 1, "Trying to open the lock on %s", sock_path_lock ); + Debug(1, "Trying to open the lock on %s", sock_path_lock); lock_fd = open(sock_path_lock, O_CREAT|O_WRONLY, S_IRUSR | S_IWUSR); if ( lock_fd <= 0 ) { @@ -285,46 +285,46 @@ void StreamBase::openComms() { Debug( 1, "We have obtained a lock on %s fd: %d", sock_path_lock, lock_fd); } - sd = socket( AF_UNIX, SOCK_DGRAM, 0 ); + sd = socket(AF_UNIX, SOCK_DGRAM, 0); if ( sd < 0 ) { - Fatal( "Can't create socket: %s", strerror(errno) ); + Fatal("Can't create socket: %s", strerror(errno)); } else { - Debug(1, "Have socket %d", sd ); + Debug(1, "Have socket %d", sd); } - length = snprintf( loc_sock_path, sizeof(loc_sock_path), "%s/zms-%06ds.sock", staticConfig.PATH_SOCKS.c_str(), connkey ); + length = snprintf(loc_sock_path, sizeof(loc_sock_path), "%s/zms-%06ds.sock", staticConfig.PATH_SOCKS.c_str(), connkey); if ( length >= sizeof(loc_sock_path) ) { Warning("Socket path was truncated."); length = sizeof(loc_sock_path)-1; } // Unlink before bind, in case it already exists - unlink( loc_sock_path ); + unlink(loc_sock_path); if ( sizeof(loc_addr.sun_path) < length ) { - Error("Not enough space %d in loc_addr.sun_path for socket file %s", sizeof(loc_addr.sun_path), loc_sock_path ); + Error("Not enough space %d in loc_addr.sun_path for socket file %s", sizeof(loc_addr.sun_path), loc_sock_path); } - strncpy( loc_addr.sun_path, loc_sock_path, sizeof(loc_addr.sun_path) ); + strncpy(loc_addr.sun_path, loc_sock_path, sizeof(loc_addr.sun_path)); loc_addr.sun_family = AF_UNIX; - Debug(3, "Binding to %s", loc_sock_path ); - if ( bind( sd, (struct sockaddr *)&loc_addr, strlen(loc_addr.sun_path)+sizeof(loc_addr.sun_family)+1 ) < 0 ) { - Fatal( "Can't bind: %s", strerror(errno) ); + Debug(3, "Binding to %s", loc_sock_path); + if ( bind(sd, (struct sockaddr *)&loc_addr, strlen(loc_addr.sun_path)+sizeof(loc_addr.sun_family)+1) < 0 ) { + Fatal("Can't bind: %s", strerror(errno)); } - snprintf( rem_sock_path, sizeof(rem_sock_path), "%s/zms-%06dw.sock", staticConfig.PATH_SOCKS.c_str(), connkey ); - strncpy( rem_addr.sun_path, rem_sock_path, sizeof(rem_addr.sun_path)-1 ); + snprintf(rem_sock_path, sizeof(rem_sock_path), "%s/zms-%06dw.sock", staticConfig.PATH_SOCKS.c_str(), connkey); + strncpy(rem_addr.sun_path, rem_sock_path, sizeof(rem_addr.sun_path)-1); rem_addr.sun_family = AF_UNIX; } // end if connKey > 0 - Debug(2, "comms open" ); + Debug(2, "comms open"); } // end void StreamBase::openComms() void StreamBase::closeComms() { if ( connkey > 0 ) { if ( sd >= 0 ) { - close( sd ); + close(sd); sd = -1; } if ( loc_sock_path[0] ) { - unlink( loc_sock_path ); + unlink(loc_sock_path); } if ( lock_fd > 0 ) { close(lock_fd); //close it rather than unlock it incase it got deleted. @@ -332,4 +332,4 @@ void StreamBase::closeComms() { //unlink(sock_path_lock); } } -} +} // end void StreamBase::closeComms diff --git a/src/zm_swscale.cpp b/src/zm_swscale.cpp index 86b1b1a1a..ae3a9662d 100644 --- a/src/zm_swscale.cpp +++ b/src/zm_swscale.cpp @@ -27,14 +27,18 @@ SWScale::SWScale() : gotdefaults(false), swscale_ctx(NULL), input_avframe(NULL), output_avframe(NULL) { Debug(4,"SWScale object created"); +} + +bool SWScale::init() { /* Allocate AVFrame for the input */ #if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101) input_avframe = av_frame_alloc(); #else input_avframe = avcodec_alloc_frame(); #endif - if(input_avframe == NULL) { - Fatal("Failed allocating AVFrame for the input"); + if ( input_avframe == NULL ) { + Error("Failed allocating AVFrame for the input"); + return false; } /* Allocate AVFrame for the output */ @@ -43,21 +47,23 @@ SWScale::SWScale() : gotdefaults(false), swscale_ctx(NULL), input_avframe(NULL), #else output_avframe = avcodec_alloc_frame(); #endif - if(output_avframe == NULL) { - Fatal("Failed allocating AVFrame for the output"); + if ( output_avframe == NULL ) { + Error("Failed allocating AVFrame for the output"); + return false; } + return true; } SWScale::~SWScale() { /* Free up everything */ - av_frame_free( &input_avframe ); - //input_avframe = NULL; + if ( input_avframe ) + av_frame_free(&input_avframe); - av_frame_free( &output_avframe ); - //output_avframe = NULL; + if ( output_avframe ) + av_frame_free(&output_avframe); - if(swscale_ctx) { + if ( swscale_ctx ) { sws_freeContext(swscale_ctx); swscale_ctx = NULL; } diff --git a/src/zm_swscale.h b/src/zm_swscale.h index f8749b463..4b4226ddb 100644 --- a/src/zm_swscale.h +++ b/src/zm_swscale.h @@ -10,6 +10,7 @@ class SWScale { public: SWScale(); ~SWScale(); + bool init(); int SetDefaults(enum _AVPIXELFORMAT in_pf, enum _AVPIXELFORMAT out_pf, unsigned int width, unsigned int height); int ConvertDefaults(const Image* img, uint8_t* out_buffer, const size_t out_buffer_size); int ConvertDefaults(const uint8_t* in_buffer, const size_t in_buffer_size, uint8_t* out_buffer, const size_t out_buffer_size); diff --git a/src/zm_thread.cpp b/src/zm_thread.cpp index f42ee5041..2ffadaa01 100644 --- a/src/zm_thread.cpp +++ b/src/zm_thread.cpp @@ -30,10 +30,10 @@ struct timespec getTimeout( int secs ) { struct timespec timeout; struct timeval temp_timeout; - gettimeofday( &temp_timeout, 0 ); + gettimeofday(&temp_timeout, 0); timeout.tv_sec = temp_timeout.tv_sec + secs; timeout.tv_nsec = temp_timeout.tv_usec*1000; - return( timeout ); + return timeout; } struct timespec getTimeout( double secs ) { @@ -46,23 +46,23 @@ struct timespec getTimeout( double secs ) { timeout.tv_sec += 1; timeout.tv_nsec -= 1000000000; } - return( timeout ); + return timeout; } Mutex::Mutex() { - if ( pthread_mutex_init( &mMutex, NULL ) < 0 ) - Fatal( "Unable to create pthread mutex: %s", strerror(errno) ); + if ( pthread_mutex_init(&mMutex, NULL) < 0 ) + Error("Unable to create pthread mutex: %s", strerror(errno)); } Mutex::~Mutex() { if ( locked() ) - Warning( "Destroying mutex when locked" ); - if ( pthread_mutex_destroy( &mMutex ) < 0 ) - Fatal( "Unable to destroy pthread mutex: %s", strerror(errno) ); + Warning("Destroying mutex when locked"); + if ( pthread_mutex_destroy(&mMutex) < 0 ) + Error("Unable to destroy pthread mutex: %s", strerror(errno)); } void Mutex::lock() { - if ( pthread_mutex_lock( &mMutex ) < 0 ) + if ( pthread_mutex_lock(&mMutex) < 0 ) throw ThreadException( stringtf( "Unable to lock pthread mutex: %s", strerror(errno) ) ); //Debug(3, "Lock"); } @@ -101,7 +101,7 @@ Condition::Condition( Mutex &mutex ) : mMutex( mutex ) { Condition::~Condition() { if ( pthread_cond_destroy( &mCondition ) < 0 ) - Fatal( "Unable to destroy pthread condition: %s", strerror(errno) ); + Error("Unable to destroy pthread condition: %s", strerror(errno)); } void Condition::wait() { diff --git a/src/zm_thread.h b/src/zm_thread.h index 199d1f764..66df9fd8e 100644 --- a/src/zm_thread.h +++ b/src/zm_thread.h @@ -54,7 +54,7 @@ private: pthread_t pid() { return( pthread_self() ); } #endif public: - explicit ThreadException( const std::string &message ) : Exception( stringtf( "(%d) "+message, (long int)pid() ) ) { + explicit ThreadException( const std::string &message ) : Exception( stringtf("(%d) ", (long int)pid())+message ) { } }; @@ -97,61 +97,53 @@ private: ScopedMutex( const ScopedMutex & ); }; -class Condition -{ +class Condition { private: Mutex &mMutex; pthread_cond_t mCondition; public: - Condition( Mutex &mutex ); + explicit Condition(Mutex &mutex); ~Condition(); void wait(); - bool wait( int secs ); - bool wait( double secs ); + bool wait(int secs); + bool wait(double secs); void signal(); void broadcast(); }; -class Semaphore : public Condition -{ +class Semaphore : public Condition { private: Mutex mMutex; public: - Semaphore() : Condition( mMutex ) - { + Semaphore() : Condition(mMutex) { } - void wait() - { + void wait() { mMutex.lock(); Condition::wait(); mMutex.unlock(); } - bool wait( int secs ) - { + bool wait(int secs) { mMutex.lock(); - bool result = Condition::wait( secs ); + bool result = Condition::wait(secs); mMutex.unlock(); - return( result ); + return result; } - bool wait( double secs ) - { + bool wait(double secs) { mMutex.lock(); - bool result = Condition::wait( secs ); + bool result = Condition::wait(secs); mMutex.unlock(); - return( result ); + return result; } - void signal() - { + void signal() { mMutex.lock(); Condition::signal(); mMutex.unlock(); } - void broadcast() - { + void broadcast() { mMutex.lock(); Condition::broadcast(); mMutex.unlock(); @@ -169,7 +161,7 @@ public: __attribute__((used)) ThreadData() : mValue(0), mCondition( mMutex ) { mChanged = false; } - __attribute__((used)) ThreadData( T value ) : mValue( value ), mCondition( mMutex ) { + explicit __attribute__((used)) ThreadData( T value ) : mValue( value ), mCondition( mMutex ) { mChanged = false; } //~ThreadData() {} @@ -200,8 +192,7 @@ public: __attribute__((used)) void updateValueBroadcast( const T value ); }; -class Thread -{ +class Thread { public: typedef void *(*ThreadFunc)( void * ); @@ -224,8 +215,7 @@ protected: virtual ~Thread(); #ifndef SOLARIS - pid_t id() const - { + pid_t id() const { pid_t tid; #ifdef __FreeBSD__ long lwpid; @@ -239,16 +229,14 @@ protected: tid=syscall(SYS_gettid); #endif #endif -return tid; + return tid; } #else - pthread_t id() const - { - return( pthread_self() ); + pthread_t id() const { + return pthread_self(); } #endif - void exit( int p_status = 0 ) - { + void exit( int p_status = 0 ) { //INFO( "Exiting" ); pthread_exit( (void *)&p_status ); } @@ -260,12 +248,11 @@ public: void start(); void join(); void kill( int signal ); - bool isThread() - { + bool isThread() { return( mPid > -1 && pthread_equal( pthread_self(), mThread ) ); } - bool isStarted() const { return( mStarted ); } - bool isRunning() const { return( mRunning ); } + bool isStarted() const { return mStarted; } + bool isRunning() const { return mRunning; } }; #endif // ZM_THREAD_H diff --git a/src/zm_time.h b/src/zm_time.h index de9d2a22f..a9af32777 100644 --- a/src/zm_time.h +++ b/src/zm_time.h @@ -77,8 +77,6 @@ struct DeltaTimeval #define MSEC_PER_SEC 1000 extern struct timeval tv; -typedef typeof(tv.tv_sec) ast_time_t; -typedef typeof(tv.tv_usec) ast_suseconds_t; inline int tvDiffUsec( struct timeval first, struct timeval last ) { diff --git a/src/zm_timer.h b/src/zm_timer.h index 221aec222..da3b95783 100644 --- a/src/zm_timer.h +++ b/src/zm_timer.h @@ -53,8 +53,7 @@ private: pthread_t pid() { return( pthread_self() ); } #endif public: - TimerException( const std::string &message ) : Exception( stringtf( "(%d) "+message, (long int)pid() ) ) - { + explicit TimerException( const std::string &message ) : Exception( stringtf("(%d) ", (long int)pid())+message ) { } }; diff --git a/src/zm_user.h b/src/zm_user.h index 2c932dd74..37bf45736 100644 --- a/src/zm_user.h +++ b/src/zm_user.h @@ -59,7 +59,7 @@ public: ~User(); User( User &u ) { Copy(u); } void Copy( const User &u ); - User operator=(const User &u) { + User& operator=(const User &u) { Copy(u); return *this; } diff --git a/src/zm_utils.cpp b/src/zm_utils.cpp index 43873b37b..8518f8cd7 100644 --- a/src/zm_utils.cpp +++ b/src/zm_utils.cpp @@ -49,7 +49,7 @@ std::string trimSet(std::string str, std::string trimset) { return str.substr( startpos, endpos-startpos+1 ); } -std::string trimSpaces(std::string str) { +std::string trimSpaces(const std::string &str) { return trimSet(str, " \t"); } diff --git a/src/zm_utils.h b/src/zm_utils.h index a10c89f48..8352edecb 100644 --- a/src/zm_utils.h +++ b/src/zm_utils.h @@ -28,12 +28,12 @@ typedef std::vector StringVector; -std::string trimSpaces(std::string str); +std::string trimSpaces(const std::string &str); std::string trimSet(std::string str, std::string trimset); std::string replaceAll(std::string str, std::string from, std::string to); const std::string stringtf( const char *format, ... ); -const std::string stringtf( const std::string format, ... ); +const std::string stringtf( const std::string &format, ... ); bool startsWith( const std::string &haystack, const std::string &needle ); StringVector split( const std::string &string, const std::string &chars, int limit=0 ); diff --git a/src/zm_video.cpp b/src/zm_video.cpp index 369819098..e44f4ce74 100644 --- a/src/zm_video.cpp +++ b/src/zm_video.cpp @@ -97,6 +97,11 @@ X264MP4Writer::X264MP4Writer( } codec_pf = AV_PIX_FMT_YUV420P; + if ( ! swscaleobj.init() ) { + Error("Failed init swscaleobj"); + return; + } + swscaleobj.SetDefaults(zm_pf, codec_pf, width, height); /* Calculate the image sizes. We will need this for parameter checking */ @@ -211,6 +216,7 @@ int X264MP4Writer::Open() { int X264MP4Writer::Close() { /* Flush all pending frames */ for ( int i = (x264_encoder_delayed_frames(x264enc) + 1); i > 0; i-- ) { +Debug(1,"Encoding delayed frame"); x264encodeloop(true); } @@ -220,6 +226,7 @@ int X264MP4Writer::Close() { /* Close MP4 handle */ MP4Close(mp4h); + Debug(1,"Optimising"); /* Required for proper HTTP streaming */ MP4Optimize((path + ".incomplete").c_str(), path.c_str()); @@ -228,7 +235,7 @@ int X264MP4Writer::Close() { bOpen = false; - Debug(7, "Video closed. Total frames: %d", frame_count); + Debug(1, "Video closed. Total frames: %d", frame_count); return 0; } @@ -413,7 +420,7 @@ void X264MP4Writer::x264encodeloop(bool bFlush) { } if ( frame_size > 0 || bFlush ) { - Debug(8, "x264 Frame: %d PTS: %d DTS: %d Size: %d\n", + Debug(1, "x264 Frame: %d PTS: %d DTS: %d Size: %d\n", frame_count, x264picout.i_pts, x264picout.i_dts, frame_size); /* Handle the previous frame */ @@ -490,7 +497,7 @@ void X264MP4Writer::x264encodeloop(bool bFlush) { } } else if ( frame_size == 0 ) { - Debug(7, "x264 encode returned zero. Delayed frames: %d", + Debug(1, "x264 encode returned zero. Delayed frames: %d", x264_encoder_delayed_frames(x264enc)); } else { Error("x264 encode failed: %d", frame_size); diff --git a/src/zm_videostore.cpp b/src/zm_videostore.cpp index 7eb434141..dfd6255c7 100644 --- a/src/zm_videostore.cpp +++ b/src/zm_videostore.cpp @@ -391,8 +391,7 @@ Debug(2,"Using mjpeg"); if ( audio_in_ctx->codec_id != AV_CODEC_ID_AAC ) { static char error_buffer[256]; - avcodec_string(error_buffer, sizeof(error_buffer), audio_in_ctx, - 0); + avcodec_string(error_buffer, sizeof(error_buffer), audio_in_ctx, 0); Debug(2, "Got something other than AAC (%s)", error_buffer); if ( !setup_resampler() ) { @@ -641,13 +640,12 @@ VideoStore::~VideoStore() { // allocation/de-allocation constantly, or whether we can just re-use it. // Just do a file open/close/writeheader/etc. // What if we were only doing audio recording? - if ( video_out_stream ) { #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) // We allocate and copy in newer ffmpeg, so need to free it avcodec_free_context(&video_in_ctx); #endif - video_in_ctx=NULL; + video_in_ctx = NULL; avcodec_close(video_out_ctx); #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) @@ -658,13 +656,13 @@ VideoStore::~VideoStore() { } if ( audio_out_stream ) { if ( audio_in_codec ) { - avcodec_close(audio_in_ctx); + avcodec_close(audio_in_ctx); #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) - // We allocate and copy in newer ffmpeg, so need to free it - avcodec_free_context(&audio_in_ctx); + // We allocate and copy in newer ffmpeg, so need to free it + avcodec_free_context(&audio_in_ctx); #endif - audio_in_ctx = NULL; - audio_in_codec = NULL; + audio_in_ctx = NULL; + audio_in_codec = NULL; } // end if audio_in_codec avcodec_close(audio_out_ctx); @@ -677,6 +675,10 @@ VideoStore::~VideoStore() { avresample_close(resample_ctx); avresample_free(&resample_ctx); } + if ( in_frame ) { + av_frame_free(&in_frame); + in_frame = NULL; + } if ( out_frame ) { av_frame_free(&out_frame); out_frame = NULL; @@ -701,7 +703,7 @@ VideoStore::~VideoStore() { /* free the stream */ avformat_free_context(oc); -} +} // VideoStore::~VideoStore() bool VideoStore::setup_resampler() { //I think this is unneccessary, we should be able to just pass in the decoder from the input. @@ -785,7 +787,7 @@ bool VideoStore::setup_resampler() { ret = avcodec_open2(audio_out_ctx, audio_out_codec, &opts); av_dict_free(&opts); if ( ret < 0 ) { - Fatal("could not open codec (%d) (%s)\n", ret, av_make_error_string(ret).c_str()); + Error("could not open codec (%d) (%s)\n", ret, av_make_error_string(ret).c_str()); audio_out_codec = NULL; audio_out_ctx = NULL; audio_out_stream = NULL; @@ -915,7 +917,6 @@ bool VideoStore::setup_resampler() { #endif } // end bool VideoStore::setup_resampler() - int VideoStore::writePacket( ZMPacket *ipkt ) { if ( ipkt->packet.stream_index == video_in_stream_index ) { return writeVideoFramePacket( ipkt ); diff --git a/src/zm_videostore.h b/src/zm_videostore.h index d2b14ae2e..bbdda6ae7 100644 --- a/src/zm_videostore.h +++ b/src/zm_videostore.h @@ -3,7 +3,6 @@ #include "zm_ffmpeg.h" extern "C" { - #ifdef HAVE_LIBAVRESAMPLE #include "libavresample/avresample.h" #endif @@ -53,7 +52,7 @@ int audio_in_stream_index; AVCodec *audio_out_codec; AVCodecContext *audio_out_ctx; #ifdef HAVE_LIBAVRESAMPLE -AVAudioResampleContext* resample_ctx; + AVAudioResampleContext* resample_ctx; #endif uint8_t *converted_in_samples; diff --git a/src/zma.cpp b/src/zma.cpp new file mode 100644 index 000000000..4bb8e25b4 --- /dev/null +++ b/src/zma.cpp @@ -0,0 +1,185 @@ +// +// ZoneMinder Analysis Daemon, $Date$, $Revision$ +// Copyright (C) 2001-2008 Philip Coombes +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// + +/* + +=head1 NAME + +zma - The ZoneMinder Analysis daemon + +=head1 SYNOPSIS + + zma -m + zma --monitor + zma -h + zma --help + zma -v + zma --version + +=head1 DESCRIPTION + +This is the component that goes through the captured frames and checks them +for motion which might generate an alarm or event. It generally keeps up with +the Capture daemon but if very busy may skip some frames to prevent it falling +behind. + +=head1 OPTIONS + + -m, --monitor_id - ID of the monitor to analyse + -h, --help - Display usage information + -v, --version - Print the installed version of ZoneMinder + +=cut + +*/ + +#include +#include + +#include "zm.h" +#include "zm_db.h" +#include "zm_signal.h" +#include "zm_monitor.h" + +void Usage() { + fprintf(stderr, "zma -m \n"); + fprintf(stderr, "Options:\n"); + fprintf(stderr, " -m, --monitor : Specify which monitor to use\n"); + fprintf(stderr, " -h, --help : This screen\n"); + fprintf(stderr, " -v, --version : Report the installed version of ZoneMinder\n"); + exit(0); +} + +int main( int argc, char *argv[] ) { + self = argv[0]; + + srand(getpid() * time(0)); + + int id = -1; + + static struct option long_options[] = { + {"monitor", 1, 0, 'm'}, + {"help", 0, 0, 'h'}, + {"version", 0, 0, 'v'}, + {0, 0, 0, 0} + }; + + while (1) { + int option_index = 0; + + int c = getopt_long (argc, argv, "m:h:v", long_options, &option_index); + if ( c == -1 ) { + break; + } + + switch (c) { + case 'm': + id = atoi(optarg); + break; + case 'h': + case '?': + Usage(); + break; + case 'v': + std::cout << ZM_VERSION << "\n"; + exit(0); + default: + //fprintf( stderr, "?? getopt returned character code 0%o ??\n", c ); + break; + } + } + + if (optind < argc) { + fprintf(stderr, "Extraneous options, "); + while (optind < argc) + printf("%s ", argv[optind++]); + printf("\n"); + Usage(); + } + + if ( id < 0 ) { + fprintf(stderr, "Bogus monitor %d\n", id); + Usage(); + exit(0); + } + + char log_id_string[16]; + snprintf(log_id_string, sizeof(log_id_string), "zma_m%d", id); + + zmLoadConfig(); + + logInit(log_id_string); + + hwcaps_detect(); + + Monitor *monitor = Monitor::Load(id, true, Monitor::ANALYSIS); + + if ( monitor ) { + Info("In mode %d/%d, warming up", monitor->GetFunction(), monitor->Enabled()); + + zmSetDefaultHupHandler(); + zmSetDefaultTermHandler(); + zmSetDefaultDieHandler(); + + sigset_t block_set; + sigemptyset(&block_set); + + useconds_t analysis_rate = monitor->GetAnalysisRate(); + unsigned int analysis_update_delay = monitor->GetAnalysisUpdateDelay(); + time_t last_analysis_update_time, cur_time; + monitor->UpdateAdaptiveSkip(); + last_analysis_update_time = time( 0 ); + + while( !zm_terminate ) { + // Process the next image + sigprocmask(SIG_BLOCK, &block_set, 0); + + // Some periodic updates are required for variable capturing framerate + if ( analysis_update_delay ) { + cur_time = time(0); + if ( (unsigned int)( cur_time - last_analysis_update_time ) > analysis_update_delay ) { + analysis_rate = monitor->GetAnalysisRate(); + monitor->UpdateAdaptiveSkip(); + last_analysis_update_time = cur_time; + } + } + + if ( !monitor->Analyse() ) { + usleep(monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE); + } else if ( analysis_rate ) { + usleep(analysis_rate); + } + + if ( zm_reload ) { + monitor->Reload(); + logTerm(); + logInit(log_id_string); + zm_reload = false; + } + sigprocmask(SIG_UNBLOCK, &block_set, 0); + } // end while ! zm_terminate + delete monitor; + } else { + fprintf(stderr, "Can't find monitor with id of %d\n", id); + } + Image::Deinitialise(); + logTerm(); + zmDbClose(); + return( 0 ); +} diff --git a/src/zmc.cpp b/src/zmc.cpp index 8feb5ddc2..46689f112 100644 --- a/src/zmc.cpp +++ b/src/zmc.cpp @@ -239,8 +239,8 @@ int main(int argc, char *argv[]) { time_t now = (time_t)time(NULL); monitors[i]->setStartupTime(now); - snprintf( sql, sizeof(sql), "REPLACE INTO Monitor_Status (MonitorId, Status) VALUES ('%d','Running')", monitors[i]->Id() ); - if ( mysql_query( &dbconn, sql ) ) { + snprintf(sql, sizeof(sql), "REPLACE INTO Monitor_Status (MonitorId, Status) VALUES ('%d','Running')", monitors[i]->Id()); + if ( mysql_query(&dbconn, sql) ) { Error( "Can't run query: %s", mysql_error( &dbconn ) ); } } @@ -251,9 +251,9 @@ int main(int argc, char *argv[]) { continue; } for ( int i = 0; i < n_monitors; i ++ ) { - snprintf( sql, sizeof(sql), "REPLACE INTO Monitor_Status (MonitorId, Status) VALUES ('%d','Connected')", monitors[i]->Id() ); - if ( mysql_query( &dbconn, sql ) ) { - Error( "Can't run query: %s", mysql_error( &dbconn ) ); + snprintf(sql, sizeof(sql), "REPLACE INTO Monitor_Status (MonitorId, Status) VALUES ('%d','Connected')", monitors[i]->Id()); + if ( mysql_query(&dbconn, sql) ) { + Error("Can't run query: %s", mysql_error(&dbconn)); } } @@ -325,6 +325,10 @@ int main(int argc, char *argv[]) { } // end foreach n_monitors //Debug(2,"unblocking"); sigprocmask(SIG_UNBLOCK, &block_set, 0); + if ( result < 0 ) { + // Failure, try reconnecting + break; + } if ( zm_reload ) { for ( int i = 0; i < n_monitors; i++ ) { monitors[i]->Reload(); @@ -332,10 +336,6 @@ int main(int argc, char *argv[]) { logTerm(); logInit( log_id_string ); zm_reload = false; - if ( result < 0 ) { - // Failure, try reconnecting - break; - } } // end if zm_reload } // end while ! zm_terminate and connected diff --git a/src/zms.cpp b/src/zms.cpp index 66b3dc683..aee752e25 100644 --- a/src/zms.cpp +++ b/src/zms.cpp @@ -58,7 +58,7 @@ int main( int argc, const char *argv[] ) { char format[32] = ""; int monitor_id = 0; time_t event_time = 0; - int event_id = 0; + unsigned long long event_id = 0; unsigned int frame_id = 1; unsigned int scale = 100; unsigned int rate = 100; @@ -174,7 +174,7 @@ int main( int argc, const char *argv[] ) { if ( monitor_id ) { snprintf(log_id_string, sizeof(log_id_string), "zms_m%d", monitor_id); } else { - snprintf(log_id_string, sizeof(log_id_string), "zms_e%d", event_id); + snprintf(log_id_string, sizeof(log_id_string), "zms_e%llu", event_id); } logInit( log_id_string ); @@ -283,10 +283,10 @@ int main( int argc, const char *argv[] ) { stream.setStreamMode( replay ); stream.setStreamQueue( connkey ); if ( monitor_id && event_time ) { - stream.setStreamStart( monitor_id, event_time ); + stream.setStreamStart(monitor_id, event_time); } else { Debug(3, "Setting stream start to frame (%d)", frame_id); - stream.setStreamStart( event_id, frame_id ); + stream.setStreamStart(event_id, frame_id); } if ( mode == ZMS_JPEG ) { stream.setStreamType( EventStream::STREAM_JPEG ); diff --git a/utils/packpack/nolintian.patch b/utils/packpack/nolintian.patch new file mode 100644 index 000000000..89b93a4c3 --- /dev/null +++ b/utils/packpack/nolintian.patch @@ -0,0 +1,22 @@ +From 634281a4204467b9a3c8a1a5febcc8dd9828e0f6 Mon Sep 17 00:00:00 2001 +From: Andy Bauer +Date: Thu, 22 Feb 2018 08:53:50 -0600 +Subject: [PATCH] don't run lintian checks to speed up build + +--- + pack/deb.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pack/deb.mk b/pack/deb.mk +index de4a0b7..bddf9df 100644 +--- a/packpack/pack/deb.mk ++++ b/packpack/pack/deb.mk +@@ -130,7 +130,7 @@ $(BUILDDIR)/$(DPKG_CHANGES): $(BUILDDIR)/$(PRODUCT)-$(VERSION)/debian \ + @echo "Building Debian packages" + @echo "-------------------------------------------------------------------" + cd $(BUILDDIR)/$(PRODUCT)-$(VERSION) && \ +- debuild --preserve-envvar CCACHE_DIR --prepend-path=/usr/lib/ccache \ ++ debuild --no-lintian --preserve-envvar CCACHE_DIR --prepend-path=/usr/lib/ccache \ + -Z$(TARBALL_COMPRESSOR) -uc -us $(SMPFLAGS) + rm -rf $(BUILDDIR)/$(PRODUCT)-$(VERSION)/ + @echo "------------------------------------------------------------------" diff --git a/utils/packpack/setarch.patch b/utils/packpack/setarch.patch new file mode 100644 index 000000000..4f196ec86 --- /dev/null +++ b/utils/packpack/setarch.patch @@ -0,0 +1,57 @@ +From 62a98b36fd62d328956503bc9427ae128bb811af Mon Sep 17 00:00:00 2001 +From: Andrew Bauer +Date: Mon, 26 Feb 2018 10:05:02 -0600 +Subject: [PATCH] fix 32bit rpm builds + +--- + pack/rpm.mk | 2 +- + packpack | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/packpack/pack/rpm.mk b/packpack/pack/rpm.mk +index c74e942..9a6b016 100644 +--- a/packpack/pack/rpm.mk ++++ b/packpack/pack/rpm.mk +@@ -124,7 +124,7 @@ package: $(BUILDDIR)/$(RPMSRC) + @echo "-------------------------------------------------------------------" + @echo "Building RPM packages" + @echo "-------------------------------------------------------------------" +- rpmbuild \ ++ setarch $(ARCH) rpmbuild \ + --define '_topdir $(BUILDDIR)' \ + --define '_sourcedir $(BUILDDIR)' \ + --define '_specdir $(BUILDDIR)' \ +diff --git a/packpack/packpack b/packpack/packpack +index 6f4c80f..c329399 100755 +--- a/packpack/packpack ++++ b/packpack/packpack +@@ -125,7 +125,7 @@ chmod a+x ${BUILDDIR}/userwrapper.sh + # + # Save defined configuration variables to ./env file + # +-env | grep -E "^PRODUCT=|^VERSION=|^RELEASE=|^ABBREV=|^TARBALL_|^CHANGELOG_|^CCACHE_|^PACKAGECLOUD_|^SMPFLAGS=|^OS=|^DIST=" \ ++env | grep -E "^PRODUCT=|^VERSION=|^RELEASE=|^ABBREV=|^TARBALL_|^CHANGELOG_|^CCACHE_|^PACKAGECLOUD_|^SMPFLAGS=|^OS=|^DIST=|^ARCH=" \ + > ${BUILDDIR}/env + + # +diff --git a/packpack/packpack b/packpack/packpack +index c329399..6ffaa9c 100755 +--- a/packpack/packpack ++++ b/packpack/packpack +@@ -19,11 +19,11 @@ DOCKER_REPO=${DOCKER_REPO:-packpack/packpack} + if [ -z "${ARCH}" ]; then + # Use uname -m instead of HOSTTYPE + case "$(uname -m)" in +- i*86) ARCH="i386" ;; +- arm*) ARCH="armhf" ;; +- x86_64) ARCH="x86_64"; ;; +- aarch64) ARCH="aarch64" ;; +- *) ARCH="${HOSTTYPE}" ;; ++ i*86) export ARCH="i386" ;; ++ arm*) export ARCH="armhf" ;; ++ x86_64) export ARCH="x86_64"; ;; ++ aarch64) export ARCH="aarch64" ;; ++ *) export ARCH="${HOSTTYPE}" ;; + esac + fi + diff --git a/utils/packpack/startpackpack.sh b/utils/packpack/startpackpack.sh index 4bf9e9ff6..3eb2ef20d 100755 --- a/utils/packpack/startpackpack.sh +++ b/utils/packpack/startpackpack.sh @@ -102,12 +102,27 @@ commonprep () { git clone https://github.com/packpack/packpack.git packpack fi + # Rpm builds are broken in latest packpack master. Temporarily roll back. + git -C packpack checkout 7cf23ee + # Patch packpack patch --dry-run --silent -f -p1 < utils/packpack/packpack-rpm.patch if [ $? -eq 0 ]; then patch -p1 < utils/packpack/packpack-rpm.patch fi + # Skip deb lintian checks to speed up the build + patch --dry-run --silent -f -p1 < utils/packpack/nolintian.patch + if [ $? -eq 0 ]; then + patch -p1 < utils/packpack/nolintian.patch + fi + + # fix 32bit rpm builds + patch --dry-run --silent -f -p1 < utils/packpack/setarch.patch + if [ $? -eq 0 ]; then + patch -p1 < utils/packpack/setarch.patch + fi + # The rpm specfile requires we download the tarball and manually move it into place # Might as well do this for Debian as well, rather than git submodule init CRUDVER="3.0.10" @@ -295,7 +310,7 @@ if [ "${TRAVIS_EVENT_TYPE}" == "cron" ] || [ "${TRAVIS}" != "true" ]; then execpackpack # Steps common to Debian based distros - elif [ "${OS}" == "debian" ] || [ "${OS}" == "ubuntu" ]; then + elif [ "${OS}" == "debian" ] || [ "${OS}" == "ubuntu" ] || [ "${OS}" == "raspbian" ]; then echo "Begin ${OS} ${DIST} build..." setdebpkgname diff --git a/version b/version index 83ee230bb..5ab7277d8 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.31.38 +1.31.41 diff --git a/web/ajax/stream.php b/web/ajax/stream.php index 57e138254..00ed7719d 100644 --- a/web/ajax/stream.php +++ b/web/ajax/stream.php @@ -10,11 +10,12 @@ if ( !($_REQUEST['connkey'] && $_REQUEST['command']) ) { ajaxError( "Unexpected received message type '$type'" ); } -$key = ftok(ZM_PATH_SOCKS.'/zms-'.sprintf("%06d",$_REQUEST['connkey']).'w.lock', 'Z'); +# The file that we point ftok to has to exist, and only exist if zms is running, so we are pointing it at the .sock +$key = ftok(ZM_PATH_SOCKS.'/zms-'.sprintf('%06d',$_REQUEST['connkey']).'s.sock', 'Z'); $semaphore = sem_get($key,1); if ( sem_acquire($semaphore,1) !== false ) { - if ( !($socket = @socket_create( AF_UNIX, SOCK_DGRAM, 0 )) ) { - ajaxError( 'socket_create() failed: '.socket_strerror(socket_last_error()) ); + if ( !($socket = @socket_create(AF_UNIX, SOCK_DGRAM, 0)) ) { + ajaxError('socket_create() failed: '.socket_strerror(socket_last_error())); } $localSocketFile = ZM_PATH_SOCKS.'/zms-'.sprintf('%06d',$_REQUEST['connkey']).'w.sock'; @@ -133,13 +134,11 @@ if ( sem_acquire($semaphore,1) !== false ) { $data['delay'] = round( $data['delay'], 2 ); $data['zoom'] = round( $data['zoom']/SCALE_BASE, 1 ); if ( ZM_OPT_USE_AUTH && ZM_AUTH_RELAY == 'hashed' ) { - session_start(); $time = time(); // Regenerate auth hash after half the lifetime of the hash if ( (!isset($_SESSION['AuthHashGeneratedAt'])) or ( $_SESSION['AuthHashGeneratedAt'] < $time - (ZM_AUTH_HASH_TTL * 1800) ) ) { - $data['auth'] = generateAuthHash( ZM_AUTH_HASH_IPS ); + $data['auth'] = generateAuthHash(ZM_AUTH_HASH_IPS); } - session_write_close(); } ajaxResponse( array( 'status'=>$data ) ); break; @@ -151,13 +150,11 @@ if ( sem_acquire($semaphore,1) !== false ) { $data['rate'] /= RATE_BASE; $data['zoom'] = round( $data['zoom']/SCALE_BASE, 1 ); if ( ZM_OPT_USE_AUTH && ZM_AUTH_RELAY == 'hashed' ) { - session_start(); $time = time(); // Regenerate auth hash after half the lifetime of the hash if ( (!isset($_SESSION['AuthHashGeneratedAt'])) or ( $_SESSION['AuthHashGeneratedAt'] < $time - (ZM_AUTH_HASH_TTL * 1800) ) ) { - $data['auth'] = generateAuthHash( ZM_AUTH_HASH_IPS ); + $data['auth'] = generateAuthHash(ZM_AUTH_HASH_IPS); } - session_write_close(); } ajaxResponse( array( 'status'=>$data ) ); break; diff --git a/web/api/app/Config/Schema/db_acl.php b/web/api/app/Config/Schema/db_acl.php index 91d93e084..7dfc7f7ef 100644 --- a/web/api/app/Config/Schema/db_acl.php +++ b/web/api/app/Config/Schema/db_acl.php @@ -4,32 +4,42 @@ * * Use it to configure database for ACL * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config.Schema * @since CakePHP(tm) v 0.2.9 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ -/* - * +/** * Using the Schema command line utility * cake schema run create DbAcl - * */ class DbAclSchema extends CakeSchema { +/** + * Before event. + * + * @param array $event The event data. + * @return bool Success + */ public function before($event = array()) { return true; } +/** + * After event. + * + * @param array $event The event data. + * @return void + */ public function after($event = array()) { } @@ -44,7 +54,11 @@ class DbAclSchema extends CakeSchema { 'alias' => array('type' => 'string', 'null' => true), 'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), 'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), - 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + 'indexes' => array( + 'PRIMARY' => array('column' => 'id', 'unique' => 1), + 'idx_acos_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0), + 'idx_acos_alias' => array('column' => 'alias', 'unique' => 0) + ) ); /** @@ -58,7 +72,11 @@ class DbAclSchema extends CakeSchema { 'alias' => array('type' => 'string', 'null' => true), 'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), 'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), - 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) + 'indexes' => array( + 'PRIMARY' => array('column' => 'id', 'unique' => 1), + 'idx_aros_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0), + 'idx_aros_alias' => array('column' => 'alias', 'unique' => 0) + ) ); /** @@ -73,7 +91,11 @@ class DbAclSchema extends CakeSchema { '_read' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2), '_update' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2), '_delete' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2), - 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1)) + 'indexes' => array( + 'PRIMARY' => array('column' => 'id', 'unique' => 1), + 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1), + 'idx_aco_id' => array('column' => 'aco_id', 'unique' => 0) + ) ); } diff --git a/web/api/app/Config/Schema/db_acl.sql b/web/api/app/Config/Schema/db_acl.sql index 274780e26..cbb0ccece 100644 --- a/web/api/app/Config/Schema/db_acl.sql +++ b/web/api/app/Config/Schema/db_acl.sql @@ -1,11 +1,11 @@ # $Id$ # -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) # # Licensed under The MIT License # For full copyright and license information, please see the LICENSE.txt # Redistributions of files must retain the above copyright notice. -# MIT License (http://www.opensource.org/licenses/mit-license.php) +# MIT License (https://opensource.org/licenses/mit-license.php) CREATE TABLE acos ( id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, @@ -38,4 +38,15 @@ CREATE TABLE aros ( lft INTEGER(10) DEFAULT NULL, rght INTEGER(10) DEFAULT NULL, PRIMARY KEY (id) -); \ No newline at end of file +); + +/* this indexes will improve acl perfomance */ +CREATE INDEX idx_acos_lft_rght ON `acos` (`lft`, `rght`); + +CREATE INDEX idx_acos_alias ON `acos` (`alias`); + +CREATE INDEX idx_aros_lft_rght ON `aros` (`lft`, `rght`); + +CREATE INDEX idx_aros_alias ON `aros` (`alias`); + +CREATE INDEX idx_aco_id ON `aros_acos` (`aco_id`); diff --git a/web/api/app/Config/Schema/i18n.php b/web/api/app/Config/Schema/i18n.php index febb2dbd5..63dc0db9f 100644 --- a/web/api/app/Config/Schema/i18n.php +++ b/web/api/app/Config/Schema/i18n.php @@ -4,22 +4,21 @@ * * Use it to configure database for i18n * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config.Schema * @since CakePHP(tm) v 0.2.9 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** - * * Using the Schema command line utility * * Use it to configure database for i18n @@ -28,15 +27,37 @@ */ class I18nSchema extends CakeSchema { +/** + * The name property + * + * @var string + */ public $name = 'i18n'; +/** + * Before callback. + * + * @param array $event Schema object properties + * @return bool Should process continue + */ public function before($event = array()) { return true; } +/** + * After callback. + * + * @param array $event Schema object properties + * @return void + */ public function after($event = array()) { } +/** + * The i18n table definition + * + * @var array + */ public $i18n = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'), 'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'), diff --git a/web/api/app/Config/Schema/i18n.sql b/web/api/app/Config/Schema/i18n.sql index 66a42bd19..a1a4e6893 100644 --- a/web/api/app/Config/Schema/i18n.sql +++ b/web/api/app/Config/Schema/i18n.sql @@ -1,11 +1,11 @@ # $Id$ # -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) # # Licensed under The MIT License # For full copyright and license information, please see the LICENSE.txt # Redistributions of files must retain the above copyright notice. -# MIT License (http://www.opensource.org/licenses/mit-license.php) +# MIT License (https://opensource.org/licenses/mit-license.php) CREATE TABLE i18n ( id int(10) NOT NULL auto_increment, diff --git a/web/api/app/Config/Schema/sessions.sql b/web/api/app/Config/Schema/sessions.sql index 76845bdc8..e19755622 100644 --- a/web/api/app/Config/Schema/sessions.sql +++ b/web/api/app/Config/Schema/sessions.sql @@ -1,13 +1,13 @@ # $Id$ # -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) # 1785 E. Sahara Avenue, Suite 490-204 # Las Vegas, Nevada 89104 # # Licensed under The MIT License # For full copyright and license information, please see the LICENSE.txt # Redistributions of files must retain the above copyright notice. -# MIT License (http://www.opensource.org/licenses/mit-license.php) +# MIT License (https://opensource.org/licenses/mit-license.php) CREATE TABLE cake_sessions ( id varchar(255) NOT NULL default '', diff --git a/web/api/app/Config/acl.ini.php b/web/api/app/Config/acl.ini.php index 9a4672132..5c890f50a 100644 --- a/web/api/app/Config/acl.ini.php +++ b/web/api/app/Config/acl.ini.php @@ -2,20 +2,20 @@ ;/** ; * ACL Configuration ; * -; * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) -; * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +; * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) +; * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) ; * ; * Licensed under The MIT License ; * Redistributions of files must retain the above copyright notice. ; * -; * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -; * @link http://cakephp.org CakePHP(tm) Project +; * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) +; * @link https://cakephp.org CakePHP(tm) Project ; * @package app.Config ; * @since CakePHP(tm) v 0.10.0.1076 -; * @license http://www.opensource.org/licenses/mit-license.php MIT License +; * @license https://opensource.org/licenses/mit-license.php MIT License ; */ -; acl.ini.php - Cake ACL Configuration +; acl.ini.php - CakePHP ACL Configuration ; --------------------------------------------------------------------- ; Use this file to specify user permissions. ; aco = access control object (something in your application) diff --git a/web/api/app/Config/acl.php b/web/api/app/Config/acl.php index a8d6e380b..cddb9f47e 100644 --- a/web/api/app/Config/acl.php +++ b/web/api/app/Config/acl.php @@ -4,18 +4,18 @@ * * Use it to configure access control of your CakePHP application. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 2.1 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** @@ -34,60 +34,72 @@ * will ask the configured ACL interface if access is granted. Under the assumptions 1. and 2. this will be * done via a call to Acl->check() with * - * array('User' => array('username' => 'jeff', 'group_id' => 4, ...)) + * ``` + * array('User' => array('username' => 'jeff', 'group_id' => 4, ...)) + * ``` * * as ARO and * - * '/controllers/invoices/delete' + * ``` + * '/controllers/invoices/delete' + * ``` * * as ACO. * * If the configured map looks like * - * $config['map'] = array( - * 'User' => 'User/username', - * 'Role' => 'User/group_id', - * ); + * ``` + * $config['map'] = array( + * 'User' => 'User/username', + * 'Role' => 'User/group_id', + * ); + * ``` * * then PhpAcl will lookup if we defined a role like User/jeff. If that role is not found, PhpAcl will try to * find a definition for Role/4. If the definition isn't found then a default role (Role/default) will be used to * check rules for the given ACO. The search can be expanded by defining aliases in the alias configuration. * E.g. if you want to use a more readable name than Role/4 in your definitions you can define an alias like * - * $config['alias'] = array( - * 'Role/4' => 'Role/editor', - * ); + * ``` + * $config['alias'] = array( + * 'Role/4' => 'Role/editor', + * ); + * ``` * * In the roles configuration you can define roles on the lhs and inherited roles on the rhs: * - * $config['roles'] = array( - * 'Role/admin' => null, - * 'Role/accountant' => null, - * 'Role/editor' => null, - * 'Role/manager' => 'Role/editor, Role/accountant', - * 'User/jeff' => 'Role/manager', - * ); + * ``` + * $config['roles'] = array( + * 'Role/admin' => null, + * 'Role/accountant' => null, + * 'Role/editor' => null, + * 'Role/manager' => 'Role/editor, Role/accountant', + * 'User/jeff' => 'Role/manager', + * ); + * ``` * * In this example manager inherits all rules from editor and accountant. Role/admin doesn't inherit from any role. * Lets define some rules: * - * $config['rules'] = array( - * 'allow' => array( - * '*' => 'Role/admin', - * 'controllers/users/(dashboard|profile)' => 'Role/default', - * 'controllers/invoices/*' => 'Role/accountant', - * 'controllers/articles/*' => 'Role/editor', - * 'controllers/users/*' => 'Role/manager', - * 'controllers/invoices/delete' => 'Role/manager', - * ), - * 'deny' => array( - * 'controllers/invoices/delete' => 'Role/accountant, User/jeff', - * 'controllers/articles/(delete|publish)' => 'Role/editor', - * ), - * ); + * ``` + * $config['rules'] = array( + * 'allow' => array( + * '*' => 'Role/admin', + * 'controllers/users/(dashboard|profile)' => 'Role/default', + * 'controllers/invoices/*' => 'Role/accountant', + * 'controllers/articles/*' => 'Role/editor', + * 'controllers/users/*' => 'Role/manager', + * 'controllers/invoices/delete' => 'Role/manager', + * ), + * 'deny' => array( + * 'controllers/invoices/delete' => 'Role/accountant, User/jeff', + * 'controllers/articles/(delete|publish)' => 'Role/editor', + * ), + * ); + * ``` * * Ok, so as jeff inherits from Role/manager he's matched every rule that references User/jeff, Role/manager, - * Role/editor, Role/accountant and Role/default. However, for jeff, rules for User/jeff are more specific than + * Role/editor, and Role/accountant. However, for jeff, rules for User/jeff are more specific than * rules for Role/manager, rules for Role/manager are more specific than rules for Role/editor and so on. * This is important when allow and deny rules match for a role. E.g. Role/accountant is allowed * controllers/invoices/* but at the same time controllers/invoices/delete is denied. But there is a more diff --git a/web/api/app/Config/bootstrap.php.in b/web/api/app/Config/bootstrap.php.in index 4e2d99c63..a94b58fc1 100644 --- a/web/api/app/Config/bootstrap.php.in +++ b/web/api/app/Config/bootstrap.php.in @@ -8,18 +8,18 @@ * You should also use this file to include any files that provide global functions/constants * that your application uses. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 0.10.8.2117 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ // Setup a 'default' cache configuration for use in the application. @@ -120,29 +120,17 @@ Configure::write('ZM_CONFIG_SUBDIR', '@ZM_CONFIG_SUBDIR@'); Configure::write('ZM_VERSION', '@VERSION@'); Configure::write('ZM_API_VERSION', '@API_VERSION@'); -# Process name, value pairs from the main config file first -$configvals = process_configfile(Configure::read('ZM_CONFIG')); +require_once("../../../includes/config.php"); +global $configvals; -# Search for user created config files. If one or more are found then -# update our config value array with those values -$configSubFolder = Configure::read('ZM_CONFIG_SUBDIR'); -if ( is_dir($configSubFolder) ) { - if ( is_readable($configSubFolder) ) { - foreach ( glob("$configSubFolder/*.conf") as $filename ) { - $configvals = array_replace($configvals, process_configfile($filename) ); - } - } else { - error_log( "WARNING: ZoneMinder configuration subfolder found but is not readable. Check folder permissions on $configSubFolder." ); - } -} - -# Now that our array our finalized, define each key => value -# pair in the array as a constant +# Now that our array our finalized, and the config has been defined. +# Add them to the cakephp Config foreach( $configvals as $key => $value) { - define( $key, $value ); - Configure::write( $key, $value ); + Configure::write($key, $value); } - +if ( 0 ) { + // No longer needed, but I want to keep the code for reference + // // For Human-readability, use ZM_SERVER_HOST or ZM_SERVER_NAME in zm.conf, and convert it here to a ZM_SERVER_ID if ( ! defined('ZM_SERVER_ID') ) { App::uses('ClassRegistry', 'Utility'); @@ -163,26 +151,4 @@ if ( ! defined('ZM_SERVER_ID') ) { } } } - -function process_configfile($configFile) { - if ( is_readable( $configFile ) ) { - $configvals = array(); - - $cfg = fopen( $configFile, 'r') or die('Could not open config file.'); - while ( !feof($cfg) ) { - $str = fgets( $cfg, 256 ); - if ( preg_match( '/^\s*$/', $str )) - continue; - elseif ( preg_match( '/^\s*#/', $str )) - continue; - elseif ( preg_match( '/^\s*([^=\s]+)\s*=\s*(.*?)\s*$/', $str, $matches )) - $configvals[$matches[1]] = $matches[2]; - } - fclose( $cfg ); - return( $configvals ); - } else { - error_log( "WARNING: ZoneMinder configuration file found but is not readable. Check file permissions on $configFile." ); - return( false ); - } } - diff --git a/web/api/app/Config/core.php.default b/web/api/app/Config/core.php.default index cffb43c77..39a51690c 100644 --- a/web/api/app/Config/core.php.default +++ b/web/api/app/Config/core.php.default @@ -31,7 +31,7 @@ * In production mode, flash messages redirect after a time interval. * In development mode, you need to click the flash message to continue. */ - Configure::write('debug', 0); + Configure::write('debug', 2); /** * Configure the Error handler used to handle errors for your application. By default diff --git a/web/api/app/Config/database.php.default b/web/api/app/Config/database.php.default index c06953ec7..a62f55321 100644 --- a/web/api/app/Config/database.php.default +++ b/web/api/app/Config/database.php.default @@ -2,18 +2,18 @@ /** * * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 0.2.9 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/web/api/app/Config/email.php.default b/web/api/app/Config/email.php.default index cee93c305..6dcfdd8f9 100644 --- a/web/api/app/Config/email.php.default +++ b/web/api/app/Config/email.php.default @@ -2,18 +2,18 @@ /** * * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 2.0.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/web/api/app/Config/routes.php b/web/api/app/Config/routes.php index 0f9343644..a684f241e 100644 --- a/web/api/app/Config/routes.php +++ b/web/api/app/Config/routes.php @@ -6,18 +6,18 @@ * Routes are very important mechanism that allows you to freely connect * different URLs to chosen controllers and their actions (functions). * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 0.2.9 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** @@ -35,7 +35,8 @@ /* Add new API to retrieve camera controls - for PTZ */ /* refer to https://github.com/ZoneMinder/ZoneMinder/issues/799#issuecomment-105233112 */ - Router::mapResources('controls'); + Router::mapResources('controls'); + Router::mapResources('groups'); Router::parseExtensions(); /** diff --git a/web/api/app/Console/Command/AppShell.php b/web/api/app/Console/Command/AppShell.php index 4ea0f2dd8..030ae49fd 100644 --- a/web/api/app/Console/Command/AppShell.php +++ b/web/api/app/Console/Command/AppShell.php @@ -2,17 +2,17 @@ /** * AppShell file * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('Shell', 'Console'); diff --git a/web/api/app/Console/cake b/web/api/app/Console/cake index 67454513d..fee8e35a3 100755 --- a/web/api/app/Console/cake +++ b/web/api/app/Console/cake @@ -3,18 +3,18 @@ # # Bake is a shell script for running CakePHP bake script # -# CakePHP(tm) : Rapid Development Framework (http://cakephp.org) -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +# CakePHP(tm) : Rapid Development Framework (https://cakephp.org) +# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) # # Licensed under The MIT License # For full copyright and license information, please see the LICENSE.txt # Redistributions of files must retain the above copyright notice. # -# @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -# @link http://cakephp.org CakePHP(tm) Project +# @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) +# @link https://cakephp.org CakePHP(tm) Project # @package app.Console # @since CakePHP(tm) v 1.2.0.5012 -# @license http://www.opensource.org/licenses/mit-license.php MIT License +# @license https://opensource.org/licenses/mit-license.php MIT License # ################################################################################ diff --git a/web/api/app/Console/cake.bat b/web/api/app/Console/cake.bat index c33bf22f8..fe1b6d4a5 100644 --- a/web/api/app/Console/cake.bat +++ b/web/api/app/Console/cake.bat @@ -2,17 +2,17 @@ :: :: Bake is a shell script for running CakePHP bake script :: -:: CakePHP(tm) : Rapid Development Framework (http://cakephp.org) -:: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +:: CakePHP(tm) : Rapid Development Framework (https://cakephp.org) +:: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) :: :: Licensed under The MIT License :: Redistributions of files must retain the above copyright notice. :: -:: @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -:: @link http://cakephp.org CakePHP(tm) Project +:: @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) +:: @link https://cakephp.org CakePHP(tm) Project :: @package app.Console :: @since CakePHP(tm) v 2.0 -:: @license http://www.opensource.org/licenses/mit-license.php MIT License +:: @license https://opensource.org/licenses/mit-license.php MIT License :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: diff --git a/web/api/app/Console/cake.php b/web/api/app/Console/cake.php index e6f748e1b..d4a6aeaf0 100644 --- a/web/api/app/Console/cake.php +++ b/web/api/app/Console/cake.php @@ -3,34 +3,45 @@ /** * Command-line code generation utility to automate programmer chores. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Console * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ -$ds = DIRECTORY_SEPARATOR; -$dispatcher = 'Cake' . $ds . 'Console' . $ds . 'ShellDispatcher.php'; +if (!defined('DS')) { + define('DS', DIRECTORY_SEPARATOR); +} + +$dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php'; if (function_exists('ini_set')) { $root = dirname(dirname(dirname(__FILE__))); + $appDir = basename(dirname(dirname(__FILE__))); + $install = $root . DS . 'lib'; + $composerInstall = $root . DS . $appDir . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib'; - // the following line differs from its sibling + // the following lines differ from its sibling // /lib/Cake/Console/Templates/skel/Console/cake.php - ini_set('include_path', $root . $ds . 'lib' . PATH_SEPARATOR . ini_get('include_path')); + if (file_exists($composerInstall . DS . $dispatcher)) { + $install = $composerInstall; + } + + ini_set('include_path', $install . PATH_SEPARATOR . ini_get('include_path')); + unset($root, $appDir, $install, $composerInstall); } if (!include $dispatcher) { trigger_error('Could not locate CakePHP core files.', E_USER_ERROR); } -unset($paths, $path, $dispatcher, $root, $ds); +unset($dispatcher); return ShellDispatcher::run($argv); diff --git a/web/api/app/Controller/AppController.php b/web/api/app/Controller/AppController.php index e9c84ab4f..7be1cd72a 100644 --- a/web/api/app/Controller/AppController.php +++ b/web/api/app/Controller/AppController.php @@ -46,7 +46,10 @@ class AppController extends Controller { 'category' => 'Crud.Category' ], 'listeners' => ['Api', 'ApiTransformation'] - ] + #], + #'DebugKit.Toolbar' => [ + # 'bootstrap' => true, 'routes' => true + ] ]; // Global beforeFilter function @@ -72,7 +75,9 @@ class AppController extends Controller { $config = $this->Config->find('first', $options); $zmOptAuth = $config['Config']['Value']; - if ( $zmOptAuth=='1' ) { + if ( $zmOptAuth == '1' ) { + require_once "../../../includes/auth.php"; + $this->loadModel('User'); if ( isset($_REQUEST['user']) and isset($_REQUEST['pass']) ) { $user = $this->User->find('first', array ('conditions' => array ( @@ -89,34 +94,23 @@ class AppController extends Controller { } if ( isset($_REQUEST['auth']) ) { - require_once "../../../includes/functions.php"; - - // Define some defines required by getAuthUser in functions.php - $defines = array('ZM_AUTH_HASH_IPS', 'ZM_AUTH_HASH_SECRET', 'ZM_AUTH_RELAY', 'ZM_OPT_USE_AUTH'); - $configQuery = array( - 'conditions' => array('OR' => array('Name' => $defines)), - 'fields' => array('Name', 'Value') - ); - $config = $this->Config->find('list', $configQuery); - - foreach ($defines as $define) { - define($define, $config[$define]); - } $user = getAuthUser($_REQUEST['auth']); if ( ! $user ) { throw new UnauthorizedException(__('User not found')); return; } else { - $this->Session->Write( 'user.Username', $user['Username'] ); - $this->Session->Write( 'user.Enabled', $user['Enabled'] ); + if ( ! $this->Session->Write('user.Username', $user['Username']) ) + $this->log("Error writing session var user.Username"); + if ( ! $this->Session->Write('user.Enabled', $user['Enabled']) ) + $this->log("Error writing session var user.Enabled"); } - } + } # end if REQUEST['auth'] - if( ! $this->Session->Read('user.Username') ) { + if ( ! $this->Session->read('user.Username') ) { throw new UnauthorizedException(__('Not Authenticated')); return; - } else if ( ! $this->Session->Read('user.Enabled') ) { + } else if ( ! $this->Session->read('user.Enabled') ) { throw new UnauthorizedException(__('User is not enabled')); return; } @@ -129,9 +123,8 @@ class AppController extends Controller { $this->Session->Write('controlPermission',$userMonitors['User']['Control']); $this->Session->Write('systemPermission',$userMonitors['User']['System']); $this->Session->Write('monitorPermission',$userMonitors['User']['Monitors']); - } - else // if auth is not on, you can do everything - { + } else { + // if auth is not on, you can do everything //$userMonitors = $this->User->find('first', $options); $this->Session->Write('allowedMonitors',''); $this->Session->Write('streamPermission','View'); diff --git a/web/api/app/Controller/GroupsController.php b/web/api/app/Controller/GroupsController.php index 525d500bf..7859f492e 100644 --- a/web/api/app/Controller/GroupsController.php +++ b/web/api/app/Controller/GroupsController.php @@ -4,15 +4,24 @@ App::uses('AppController', 'Controller'); * Groups Controller * * @property Group $Group + * @property PaginatorComponent $Paginator */ class GroupsController extends AppController { - /** * Components * * @var array */ - public $components = array('RequestHandler'); + public $components = array('Paginator', 'RequestHandler'); + + public function beforeFilter() { + parent::beforeFilter(); + $canView = $this->Session->Read('groupsPermission'); + if ( $canView == 'None' ) { + throw new UnauthorizedException(__('Insufficient Privileges')); + return; + } + } /** * index method @@ -55,6 +64,12 @@ class GroupsController extends AppController { */ public function add() { if ($this->request->is('post')) { + + if ($this->Session->Read('groupPermission') != 'Edit') { + throw new UnauthorizedException(__('Insufficient privileges')); + return; + } + $this->Group->create(); if ($this->Group->save($this->request->data)) { return $this->flash(__('The group has been saved.'), array('action' => 'index')); @@ -75,16 +90,26 @@ class GroupsController extends AppController { if (!$this->Group->exists($id)) { throw new NotFoundException(__('Invalid group')); } - if ($this->request->is(array('post', 'put'))) { + if ( $this->request->is(array('post', 'put'))) { + if ( $this->Session->Read('groupPermission') != 'Edit' ) { + throw new UnauthorizedException(__('Insufficient privileges')); + return; + } if ($this->Group->save($this->request->data)) { return $this->flash(__('The group has been saved.'), array('action' => 'index')); + } else { + $message = 'Error'; } } else { $options = array('conditions' => array('Group.' . $this->Group->primaryKey => $id)); $this->request->data = $this->Group->find('first', $options); } $monitors = $this->Group->Monitor->find('list'); - $this->set(compact('monitors')); + $this->set(array( + 'message' => $message, + 'monitors'=> $monitors, + '_serialize' => array('message',) + )); } /** @@ -100,9 +125,15 @@ class GroupsController extends AppController { throw new NotFoundException(__('Invalid group')); } $this->request->allowMethod('post', 'delete'); + if ( $this->Session->Read('groupPermission') != 'Edit' ) { + throw new UnauthorizedException(__('Insufficient privileges')); + return; + } + if ($this->Group->delete()) { return $this->flash(__('The group has been deleted.'), array('action' => 'index')); } else { return $this->flash(__('The group could not be deleted. Please, try again.'), array('action' => 'index')); } - }} + } // end function delete +} // end class GroupController diff --git a/web/api/app/Controller/HostController.php b/web/api/app/Controller/HostController.php index 4fdb48cba..ff6410e15 100644 --- a/web/api/app/Controller/HostController.php +++ b/web/api/app/Controller/HostController.php @@ -7,8 +7,7 @@ class HostController extends AppController { public function daemonCheck($daemon=false, $args=false) { $string = Configure::read('ZM_PATH_BIN')."/zmdc.pl check"; - if ( $daemon ) - { + if ( $daemon ) { $string .= " $daemon"; if ( $args ) $string .= " $args"; @@ -31,6 +30,13 @@ class HostController extends AppController { )); } + function getAuthHash() { + $this->set(array( + 'auth_hash'=> generateAuthHash( ZM_AUTH_HASH_IPS ), + '_serialize' => array('auth_hash') + ) ); + } + // If $mid is set, only return disk usage for that monitor // Else, return an array of total disk usage, and per-monitor // usage. @@ -99,15 +105,14 @@ class HostController extends AppController { )); } - function getTimeZone() - { - //http://php.net/manual/en/function.date-default-timezone-get.php - $tz = date_default_timezone_get(); - $this->set(array( - 'tz' => $tz, - '_serialize' => array('tz') - )); - } + function getTimeZone() { + //http://php.net/manual/en/function.date-default-timezone-get.php + $tz = date_default_timezone_get(); + $this->set(array( + 'tz' => $tz, + '_serialize' => array('tz') + )); + } function getVersion() { //throw new UnauthorizedException(__('API Disabled')); diff --git a/web/api/app/Controller/PagesController.php b/web/api/app/Controller/PagesController.php index 5073f2e1a..bf1dbefa6 100644 --- a/web/api/app/Controller/PagesController.php +++ b/web/api/app/Controller/PagesController.php @@ -4,18 +4,18 @@ * * This file will render views from views/pages/ * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Controller * @since CakePHP(tm) v 0.2.9 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppController', 'Controller'); @@ -26,7 +26,7 @@ App::uses('AppController', 'Controller'); * Override this controller by placing a copy in controllers directory of an application * * @package app.Controller - * @link http://book.cakephp.org/2.0/en/controllers/pages-controller.html + * @link https://book.cakephp.org/2.0/en/controllers/pages-controller.html */ class PagesController extends AppController { @@ -40,10 +40,10 @@ class PagesController extends AppController { /** * Displays a view * - * @param mixed What page to display - * @return void + * @return CakeResponse|null + * @throws ForbiddenException When a directory traversal attempt. * @throws NotFoundException When the view file could not be found - * or MissingViewException in debug mode. + * or MissingViewException in debug mode. */ public function display() { $path = func_get_args(); @@ -52,6 +52,9 @@ class PagesController extends AppController { if (!$count) { return $this->redirect('/'); } + if (in_array('..', $path, true) || in_array('.', $path, true)) { + throw new ForbiddenException(); + } $page = $subpage = $title_for_layout = null; if (!empty($path[0])) { diff --git a/web/api/app/Model/Group.php b/web/api/app/Model/Group.php index 595bc3b3a..e27460424 100644 --- a/web/api/app/Model/Group.php +++ b/web/api/app/Model/Group.php @@ -4,6 +4,7 @@ App::uses('AppModel', 'Model'); * Group Model * * @property Event $Event + * @property Zone $Zone */ class Group extends AppModel { @@ -21,6 +22,15 @@ class Group extends AppModel { */ public $primaryKey = 'Id'; +/** + * Display field + * + * @var string + */ + public $displayField = 'Name'; + + public $recursive = -1; + /** * Validation rules * @@ -29,7 +39,10 @@ class Group extends AppModel { public $validate = array( 'Name' => array( 'notEmpty' => array( - 'rule' => array('notEmpty'), + 'rule' => array('notEmpty'))), + 'Id' => array( + 'numeric' => array( + 'rule' => array('numeric'), //'message' => 'Your custom message here', //'allowEmpty' => false, //'required' => false, @@ -39,7 +52,6 @@ class Group extends AppModel { ), ); - public $recursive = -1; //The Associations below have been created with all possible keys, those that are not needed can be removed /** diff --git a/web/api/app/Model/Host.php b/web/api/app/Model/Host.php index 5c24c7531..481849db9 100644 --- a/web/api/app/Model/Host.php +++ b/web/api/app/Model/Host.php @@ -1,4 +1,3 @@ - $message)); +echo $xml->asXML(); diff --git a/web/api/app/View/Groups/xml/index.ctp b/web/api/app/View/Groups/xml/index.ctp new file mode 100644 index 000000000..8f45dfd14 --- /dev/null +++ b/web/api/app/View/Groups/xml/index.ctp @@ -0,0 +1,2 @@ +$xml = Xml::fromArray(array('response' => $groups)); +echo $xml->asXML(); diff --git a/web/api/app/View/Groups/xml/view.ctp b/web/api/app/View/Groups/xml/view.ctp new file mode 100644 index 000000000..b54cad5ca --- /dev/null +++ b/web/api/app/View/Groups/xml/view.ctp @@ -0,0 +1,2 @@ +$xml = Xml::fromArray(array('response' => $group)); +echo $xml->asXML(); diff --git a/web/api/app/View/Layouts/js/default.ctp b/web/api/app/View/Layouts/js/default.ctp index 7239b5dae..f694538e4 100644 --- a/web/api/app/View/Layouts/js/default.ctp +++ b/web/api/app/View/Layouts/js/default.ctp @@ -1,2 +1,2 @@ - +fetch('script'); ?> diff --git a/web/api/lib/Cake/Cache/Cache.php b/web/api/lib/Cake/Cache/Cache.php index a7a01d0a1..3db66c4f9 100644 --- a/web/api/lib/Cake/Cache/Cache.php +++ b/web/api/lib/Cake/Cache/Cache.php @@ -1,17 +1,17 @@ _groupPrefix)) { - $prefix = vsprintf($this->_groupPrefix, $this->groups()); + $prefix = md5(implode('_', $this->groups())); } $key = preg_replace('/[\s]+/', '_', strtolower(trim(str_replace(array(DS, '/', '.'), '_', strval($key))))); diff --git a/web/api/lib/Cake/Cache/Engine/ApcEngine.php b/web/api/lib/Cake/Cache/Engine/ApcEngine.php index da31651e3..329e87196 100644 --- a/web/api/lib/Cake/Cache/Engine/ApcEngine.php +++ b/web/api/lib/Cake/Cache/Engine/ApcEngine.php @@ -2,18 +2,18 @@ /** * APC storage engine for cache. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package Cake.Cache.Engine * @since CakePHP(tm) v 1.2.0.4933 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** @@ -31,6 +31,13 @@ class ApcEngine extends CacheEngine { */ protected $_compiledGroupNames = array(); +/** + * APC or APCu extension + * + * @var string + */ + protected $_apcExtension = 'apc'; + /** * Initialize the Cache Engine * @@ -47,6 +54,10 @@ class ApcEngine extends CacheEngine { } $settings += array('engine' => 'Apc'); parent::init($settings); + if (function_exists('apcu_dec')) { + $this->_apcExtension = 'apcu'; + return true; + } return function_exists('apc_dec'); } @@ -63,8 +74,9 @@ class ApcEngine extends CacheEngine { if ($duration) { $expires = time() + $duration; } - apc_store($key . '_expires', $expires, $duration); - return apc_store($key, $value, $duration); + $func = $this->_apcExtension . '_store'; + $func($key . '_expires', $expires, $duration); + return $func($key, $value, $duration); } /** @@ -75,11 +87,12 @@ class ApcEngine extends CacheEngine { */ public function read($key) { $time = time(); - $cachetime = (int)apc_fetch($key . '_expires'); + $func = $this->_apcExtension . '_fetch'; + $cachetime = (int)$func($key . '_expires'); if ($cachetime !== 0 && ($cachetime < $time || ($time + $this->settings['duration']) < $cachetime)) { return false; } - return apc_fetch($key); + return $func($key); } /** @@ -90,7 +103,8 @@ class ApcEngine extends CacheEngine { * @return New incremented value, false otherwise */ public function increment($key, $offset = 1) { - return apc_inc($key, $offset); + $func = $this->_apcExtension . '_inc'; + return $func($key, $offset); } /** @@ -101,7 +115,8 @@ class ApcEngine extends CacheEngine { * @return New decremented value, false otherwise */ public function decrement($key, $offset = 1) { - return apc_dec($key, $offset); + $func = $this->_apcExtension . '_dec'; + return $func($key, $offset); } /** @@ -111,7 +126,8 @@ class ApcEngine extends CacheEngine { * @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed */ public function delete($key) { - return apc_delete($key); + $func = $this->_apcExtension . '_delete'; + return $func($key); } /** @@ -125,19 +141,20 @@ class ApcEngine extends CacheEngine { if ($check) { return true; } + $func = $this->_apcExtension . '_delete'; if (class_exists('APCIterator', false)) { $iterator = new APCIterator( 'user', '/^' . preg_quote($this->settings['prefix'], '/') . '/', APC_ITER_NONE ); - apc_delete($iterator); + $func($iterator); return true; } - $cache = apc_cache_info('user'); + $cache = $this->_apcExtension === 'apc' ? apc_cache_info('user') : apcu_cache_info(); foreach ($cache['cache_list'] as $key) { if (strpos($key['info'], $this->settings['prefix']) === 0) { - apc_delete($key['info']); + $func($key['info']); } } return true; @@ -157,11 +174,13 @@ class ApcEngine extends CacheEngine { } } - $groups = apc_fetch($this->_compiledGroupNames); + $fetchFunc = $this->_apcExtension . '_fetch'; + $storeFunc = $this->_apcExtension . '_store'; + $groups = $fetchFunc($this->_compiledGroupNames); if (count($groups) !== count($this->settings['groups'])) { foreach ($this->_compiledGroupNames as $group) { if (!isset($groups[$group])) { - apc_store($group, 1); + $storeFunc($group, 1); $groups[$group] = 1; } } @@ -184,7 +203,8 @@ class ApcEngine extends CacheEngine { * @return bool success */ public function clearGroup($group) { - apc_inc($this->settings['prefix'] . $group, 1, $success); + $func = $this->_apcExtension . '_inc'; + $func($this->settings['prefix'] . $group, 1, $success); return $success; } @@ -203,7 +223,8 @@ class ApcEngine extends CacheEngine { if ($duration) { $expires = time() + $duration; } - apc_add($key . '_expires', $expires, $duration); - return apc_add($key, $value, $duration); + $func = $this->_apcExtension . '_add'; + $func($key . '_expires', $expires, $duration); + return $func($key, $value, $duration); } } diff --git a/web/api/lib/Cake/Cache/Engine/FileEngine.php b/web/api/lib/Cake/Cache/Engine/FileEngine.php index d650e60ee..9b8eae0a7 100644 --- a/web/api/lib/Cake/Cache/Engine/FileEngine.php +++ b/web/api/lib/Cake/Cache/Engine/FileEngine.php @@ -6,17 +6,17 @@ * * You can configure a FileEngine cache, using Cache::config() * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 1.2.0.4933 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** @@ -132,7 +132,7 @@ class FileEngine extends CacheEngine { } $expires = time() + $duration; - $contents = $expires . $lineBreak . $data . $lineBreak; + $contents = implode(array($expires, $lineBreak, $data, $lineBreak)); if ($this->settings['lock']) { $this->_File->flock(LOCK_EX); @@ -267,6 +267,10 @@ class FileEngine extends CacheEngine { } $dir = dir($path); + if ($dir === false) { + return; + } + while (($entry = $dir->read()) !== false) { if (substr($entry, 0, $prefixLength) !== $this->settings['prefix']) { continue; diff --git a/web/api/lib/Cake/Cache/Engine/MemcacheEngine.php b/web/api/lib/Cake/Cache/Engine/MemcacheEngine.php index eba2ec451..d70c1c56d 100644 --- a/web/api/lib/Cake/Cache/Engine/MemcacheEngine.php +++ b/web/api/lib/Cake/Cache/Engine/MemcacheEngine.php @@ -2,18 +2,18 @@ /** * Memcache storage engine for cache * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package Cake.Cache.Engine * @since CakePHP(tm) v 1.2.0.4933 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/web/api/lib/Cake/Cache/Engine/MemcachedEngine.php b/web/api/lib/Cake/Cache/Engine/MemcachedEngine.php index cc101a2bf..655eb5d1c 100644 --- a/web/api/lib/Cake/Cache/Engine/MemcachedEngine.php +++ b/web/api/lib/Cake/Cache/Engine/MemcachedEngine.php @@ -1,16 +1,16 @@ _Redis->get($key); - if (ctype_digit($value)) { - $value = (int)$value; + if (preg_match('/^[-]?\d+$/', $value)) { + return (int)$value; } if ($value !== false && is_string($value)) { - $value = unserialize($value); + return unserialize($value); } return $value; } diff --git a/web/api/lib/Cake/Cache/Engine/WincacheEngine.php b/web/api/lib/Cake/Cache/Engine/WincacheEngine.php index e5c9d7bd7..dc8348171 100644 --- a/web/api/lib/Cake/Cache/Engine/WincacheEngine.php +++ b/web/api/lib/Cake/Cache/Engine/WincacheEngine.php @@ -4,18 +4,18 @@ * * Supports wincache 1.1.0 and higher. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package Cake.Cache.Engine * @since CakePHP(tm) v 1.2.0.4933 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/web/api/lib/Cake/Cache/Engine/XcacheEngine.php b/web/api/lib/Cake/Cache/Engine/XcacheEngine.php index c46a7b9c5..2ce3324f1 100644 --- a/web/api/lib/Cake/Cache/Engine/XcacheEngine.php +++ b/web/api/lib/Cake/Cache/Engine/XcacheEngine.php @@ -2,18 +2,18 @@ /** * Xcache storage engine for cache. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package Cake.Cache.Engine * @since CakePHP(tm) v 1.2.0.4947 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/web/api/lib/Cake/Config/cacert.pem b/web/api/lib/Cake/Config/cacert.pem index 4ef2da5c9..b4109e40a 100644 --- a/web/api/lib/Cake/Config/cacert.pem +++ b/web/api/lib/Cake/Config/cacert.pem @@ -1,76 +1,25 @@ ## -## ca-bundle.crt -- Bundle of CA Root Certificates +## Bundle of CA Root Certificates ## -## Certificate data from Mozilla as of: Thu Oct 18 19:05:59 2012 +## Certificate data from Mozilla as of: Wed Jan 20 04:12:04 2016 +## +## The Equifax Secure CA was readded as there were replies to the issue +## that updated this certificate bundle. ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates -## file (certdata.txt). This file can be found in the mozilla source tree: -## http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1 +## file (certdata.txt). This file can be found in the mozilla source tree: +## http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt ## ## It contains the certificates in PEM format and therefore ## can be directly used with curl / libcurl / php_curl, or with ## an Apache+mod_ssl webserver for SSL client authentication. ## Just configure this file as the SSLCACertificateFile. ## - -# @(#) $RCSfile: certdata.txt,v $ $Revision: 1.86 $ $Date: 2012/10/18 16:26:52 $ - -GTE CyberTrust Global Root -========================== ------BEGIN CERTIFICATE----- -MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUg -Q29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNvbHV0aW9ucywgSW5jLjEjMCEG -A1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJvb3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEz -MjM1OTAwWjB1MQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQL -Ex5HVEUgQ3liZXJUcnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0 -IEdsb2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrHiM3dFw4u -sJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTSr41tiGeA5u2ylc9yMcql -HHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X404Wqk2kmhXBIgD8SFcd5tB8FLztimQID -AQABMA0GCSqGSIb3DQEBBAUAA4GBAG3rGwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMW -M4ETCJ57NE7fQMh017l93PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OF -NMQkpw0PlZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ ------END CERTIFICATE----- - -Thawte Server CA -================ ------BEGIN CERTIFICATE----- -MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT -DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs -dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UE -AxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5j -b20wHhcNOTYwODAxMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNV -BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29u -c3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcG -A1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0 -ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl -/Kj0R1HahbUgdJSGHg91yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg7 -1CcEJRCXL+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGjEzAR -MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG7oWDTSEwjsrZqG9J -GubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6eQNuozDJ0uW8NxuOzRAvZim+aKZuZ -GCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZqdq5snUb9kLy78fyGPmJvKP/iiMucEc= ------END CERTIFICATE----- - -Thawte Premium Server CA -======================== ------BEGIN CERTIFICATE----- -MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkExFTATBgNVBAgT -DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs -dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UE -AxMYVGhhd3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZl -ckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYT -AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU -VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2 -aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZ -cHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2 -aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIh -Udib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMRuHM/ -qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAm -SCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUIhfzJATj/Tb7yFkJD57taRvvBxhEf -8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JMpAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7t -UCemDaYj+bvLpgcUQg== ------END CERTIFICATE----- - +## Conversion done with mk-ca-bundle.pl version 1.25. +## SHA1: 0ab47e2f41518f8d223eab517cb799e5b071231e +## +# Equifax Secure CA ================= -----BEGIN CERTIFICATE----- @@ -91,118 +40,6 @@ BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95 70+sB3c4 -----END CERTIFICATE----- -Digital Signature Trust Co. Global CA 1 -======================================= ------BEGIN CERTIFICATE----- -MIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE -ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMTAeFw05ODEy -MTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs -IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUA -A4GLADCBhwKBgQCgbIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJE -NySZj9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlVSn5JTe2i -o74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo -BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0 -dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw -IoAPMTk5ODEyMTAxODEwMjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQY -MBaAFGp5fpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i+DAM -BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB -ACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lNQseSJqBcNJo4cvj9axY+IO6CizEq -kzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+gG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4 -RbyhkwS7hp86W0N6w4pl ------END CERTIFICATE----- - -Digital Signature Trust Co. Global CA 3 -======================================= ------BEGIN CERTIFICATE----- -MIIDKTCCApKgAwIBAgIENm7Tz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1gYgAlihw6ID ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority -======================================================= ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx -FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow -XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz -IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 -f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol -hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA -TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah -WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf -Tqj/ZA1k ------END CERTIFICATE----- - -Verisign Class 1 Public Primary Certification Authority - G2 -============================================================ ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEEzH6qqYPnHTkxD4PTqJkZIwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT -MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz -dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT -MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz -dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq0Lq+Fi24g9TK0g+8djHKlNgd -k4xWArzZbxpvUjZudVYKVdPfQ4chEWWKfo+9Id5rMj8bhDSVBZ1BNeuS65bdqlk/AVNtmU/t5eIq -WpDBucSmFc/IReumXY6cPvBkJHalzasab7bYe1FhbqZ/h8jit+U03EGI6glAvnOSPWvndQIDAQAB -MA0GCSqGSIb3DQEBBQUAA4GBAKlPww3HZ74sy9mozS11534Vnjty637rXC0Jh9ZrbWB85a7FkCMM -XErQr7Fd88e2CtvgFZMN3QO8x3aKtd1Pw5sTdbgBwObJW2uluIncrKTdcu1OofdPvAbT6shkdHvC -lUGcZXNY8ZCaPGqxmMnEh7zPRW1F4m4iP/68DzFc6PLZ ------END CERTIFICATE----- - -Verisign Class 2 Public Primary Certification Authority - G2 -============================================================ ------BEGIN CERTIFICATE----- -MIIDAzCCAmwCEQC5L2DMiJ+hekYJuFtwbIqvMA0GCSqGSIb3DQEBBQUAMIHBMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGljIFByaW1h -cnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNp -Z24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1 -c3QgTmV0d29yazAeFw05ODA1MTgwMDAwMDBaFw0yODA4MDEyMzU5NTlaMIHBMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGljIFByaW1h -cnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNp -Z24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1 -c3QgTmV0d29yazCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAp4gBIXQs5xoD8JjhlzwPIQjx -nNuX6Zr8wgQGE75fUsjMHiwSViy4AWkszJkfrbCWrnkE8hM5wXuYuggs6MKEEyyqaekJ9MepAqRC -wiNPStjwDqL7MWzJ5m+ZJwf15vRMeJ5t60aG+rmGyVTyssSv1EYcWskVMP8NbPUtDm3Of3cCAwEA -ATANBgkqhkiG9w0BAQUFAAOBgQByLvl/0fFx+8Se9sVeUYpAmLho+Jscg9jinb3/7aHmZuovCfTK -1+qlK5X2JGCGTUQug6XELaDTrnhpb3LabK4I8GOSN+a7xDAXrXfMSTWqz9iP0b63GJZHc2pUIjRk -LbYWm1lbtFFZOrMLFPQS32eg9K0yZF6xRnInjBJ7xUS0rg== ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority - G2 -============================================================ ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcEx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+heQC1u+mNr0HZDzTuIYEZoDJJKPTEjlbV -UjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8 -W9ViH0Pd ------END CERTIFICATE----- - -RSA Root Certificate 1 -====================== ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp -b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh -bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw -MjIzM1oXDTE5MDYyNjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 -d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMg -UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 -LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDjmFGWHOjVsQaBalfDcnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td -3zZxFJmP3MKS8edgkpfs2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89H -BFx1cQqYJJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliEZwgs -3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJn0WuPIqpsHEzXcjF -V9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/APhmcGcwTTYJBtYze4D1gCCAPRX5r -on+jjBXu ------END CERTIFICATE----- - -Verisign Class 1 Public Primary Certification Authority - G3 -============================================================ ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCLW3VWhFSFCwDPrzhIzrGkMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy -dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDEgUHVibGljIFByaW1hcnkg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAN2E1Lm0+afY8wR4nN493GwTFtl63SRRZsDHJlkNrAYIwpTRMx/wgzUfbhvI3qpuFU5UJ+/E -bRrsC+MO8ESlV8dAWB6jRx9x7GD2bZTIGDnt/kIYVt/kTEkQeE4BdjVjEjbdZrwBBDajVWjVojYJ -rKshJlQGrT/KFOCsyq0GHZXi+J3x4GD/wn91K0zM2v6HmSHquv4+VNfSWXjbPG7PoBMAGrgnoeS+ -Z5bKoMWznN3JdZ7rMJpfo83ZrngZPyPpXNspva1VyBtUjGP26KbqxzcSXKMpHgLZ2x87tNcPVkeB -FQRKr4Mn0cVYiMHd9qqnoxjaaKptEVHhv2Vrn5Z20T0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA -q2aN17O6x5q25lXQBfGfMY1aqtmqRiYPce2lrVNWYgFHKkTp/j90CxObufRNG7LRX7K20ohcs5/N -y9Sn2WCVhDr4wTcdYcrnsMXlkdpUpqwxga6X3s0IrLjAl4B/bnKk52kTlWUfxJM8/XmPBNQ+T+r3 -ns7NZ3xPZQL/kYVUc8f/NveGLezQXk//EZ9yBta4GvFMDSZl4kSAHsef493oCtrspSCAaWihT37h -a88HQfqDjrw43bAuEbFrskLMmrz5SCJ5ShkPshw+IHTZasO+8ih4E1Z5T21Q6huwtVexN2ZYI/Pc -D98Kh8TvhgXVOBRgmaNL3gaWcSzy27YfpO8/7g== ------END CERTIFICATE----- - -Verisign Class 2 Public Primary Certification Authority - G3 -============================================================ ------BEGIN CERTIFICATE----- -MIIEGTCCAwECEGFwy0mMX5hFKeewptlQW3owDQYJKoZIhvcNAQEFBQAwgcoxCzAJBgNVBAYTAlVT -MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29y -azE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ug -b25seTFFMEMGA1UEAxM8VmVyaVNpZ24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0 -aW9uIEF1dGhvcml0eSAtIEczMB4XDTk5MTAwMTAwMDAwMFoXDTM2MDcxNjIzNTk1OVowgcoxCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1 -c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9y -aXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNpZ24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBD -ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEArwoNwtUs22e5LeWUJ92lvuCwTY+zYVY81nzD9M0+hsuiiOLh2KRpxbXiv8GmR1BeRjmL1Za6 -tW8UvxDOJxOeBUebMXoT2B/Z0wI3i60sR/COgQanDTAM6/c8DyAd3HJG7qUCyFvDyVZpTMUYwZF7 -C9UTAJu878NIPkZgIIUq1ZC2zYugzDLdt/1AVbJQHFauzI13TccgTacxdu9okoqQHgiBVrKtaaNS -0MscxCM9H5n+TOgWY47GCI72MfbS+uV23bUckqNJzc0BzWjNqWm6o+sdDZykIKbBoMXRRkwXbdKs -Zj+WjOCE1Db/IlnF+RFgqF8EffIa9iVCYQ/ESrg+iQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQA0 -JhU8wI1NQ0kdvekhktdmnLfexbjQ5F1fdiLAJvmEOjr5jLX77GDx6M4EsMjdpwOPMPOY36TmpDHf -0xwLRtxyID+u7gU8pDM/CzmscHhzS5kr3zDCVLCoO1Wh/hYozUK9dG6A2ydEp85EXdQbkJgNHkKU -sQAsBNB0owIFImNjzYO1+8FtYmtpdf1dcEG59b98377BMnMiIYtYgXsVkXq642RIsH/7NiXaldDx -JBQX3RiAa0YjOVT1jmIJBB2UkKab5iXiQkWquJCtvgiPqQtCGJTPcjnhsUPgKM+351psE2tJs//j -GHyJizNdrDPXp/naOlXJWBD5qu9ats9LS98q ------END CERTIFICATE----- - Verisign Class 3 Public Primary Certification Authority - G3 ============================================================ -----BEGIN CERTIFICATE----- @@ -376,65 +108,14 @@ xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== -----END CERTIFICATE----- -Verisign Class 4 Public Primary Certification Authority - G3 -============================================================ ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy -dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS -tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM -8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW -Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX -Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA -j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt -mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm -fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd -RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG -UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== ------END CERTIFICATE----- - -Entrust.net Secure Server CA -============================ ------BEGIN CERTIFICATE----- -MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMCVVMxFDASBgNV -BAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5uZXQvQ1BTIGluY29ycC4gYnkg -cmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRl -ZDE6MDgGA1UEAxMxRW50cnVzdC5uZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhv -cml0eTAeFw05OTA1MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIG -A1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBi -eSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDV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N95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9 -n9cd2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= ------END CERTIFICATE----- - Entrust.net Premium 2048 Secure Server CA ========================================= -----BEGIN CERTIFICATE----- -MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u +MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx -NzUwNTFaFw0xOTEyMjQxODIwNTFaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 +NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A @@ -442,14 +123,13 @@ MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL Gp18EzoOH1u3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098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf +zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT +J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e +nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= -----END CERTIFICATE----- Baltimore CyberTrust Root @@ -473,60 +153,6 @@ Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp -----END CERTIFICATE----- -Equifax Secure Global eBusiness CA -================================== ------BEGIN CERTIFICATE----- -MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT -RXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBTZWN1cmUgR2xvYmFsIGVCdXNp -bmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIwMDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMx -HDAaBgNVBAoTE0VxdWlmYXggU2VjdXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEds -b2JhbCBlQnVzaW5lc3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRV -PEnCUdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc58O/gGzN -qfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/o5brhTMhHD4ePmBudpxn -hcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAHMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j -BBgwFoAUvqigdHJQa0S3ySPY+6j/s1draGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hs -MA0GCSqGSIb3DQEBBAUAA4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okEN -I7SS+RkAZ70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv8qIY -NMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV ------END CERTIFICATE----- - -Equifax Secure eBusiness CA 1 -============================= ------BEGIN CERTIFICATE----- -MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT -RXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENB -LTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQwMDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UE -ChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNz -IENBLTEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ -1MRoRvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBuWqDZQu4a -IZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKwEnv+j6YDAgMBAAGjZjBk -MBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFEp4MlIR21kW -Nl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRKeDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQF -AAOBgQB1W6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v92CB6p4J2MAwGA1UdEwQFMAMB -Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAAyGgq3oThr1 -jokn4jVYPSm0B482UJW/bsGe68SQsoWou7dC4A8HOd/7npCy0cE+U58DRLB+S/Rv5Hwf5+Kx5Lia -78O9zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUm -V+GRMOrN ------END CERTIFICATE----- - AddTrust Low-Value Services Root ================================ -----BEGIN CERTIFICATE----- @@ -772,84 +398,6 @@ gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS -----END CERTIFICATE----- -UTN-USER First-Network Applications -=================================== ------BEGIN CERTIFICATE----- -MIIEZDCCA0ygAwIBAgIQRL4Mi1AAJLQR0zYwS8AzdzANBgkqhkiG9w0BAQUFADCBozELMAkGA1UE -BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl -IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzAp -BgNVBAMTIlVUTi1VU0VSRmlyc3QtTmV0d29yayBBcHBsaWNhdGlvbnMwHhcNOTkwNzA5MTg0ODM5 -WhcNMTkwNzA5MTg1NzQ5WjCBozELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5T -YWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho -dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzApBgNVBAMTIlVUTi1VU0VSRmlyc3QtTmV0d29yayBB -cHBsaWNhdGlvbnMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCz+5Gh5DZVhawGNFug -mliy+LUPBXeDrjKxdpJo7CNKyXY/45y2N3kDuatpjQclthln5LAbGHNhSuh+zdMvZOOmfAz6F4Cj -DUeJT1FxL+78P/m4FoCHiZMlIJpDgmkkdihZNaEdwH+DBmQWICzTSaSFtMBhf1EI+GgVkYDLpdXu -Ozr0hAReYFmnjDRy7rh4xdE7EkpvfmUnuaRVxblvQ6TFHSyZwFKkeEwVs0CYCGtDxgGwenv1axwi -P8vv/6jQOkt2FZ7S0cYu49tXGzKiuG/ohqY/cKvlcJKrRB5AUPuco2LkbG6gyN7igEL66S/ozjIE -j3yNtxyjNTwV3Z7DrpelAgMBAAGjgZEwgY4wCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8w -HQYDVR0OBBYEFPqGydvguul49Uuo1hXf8NPhahQ8ME8GA1UdHwRIMEYwRKBCoECGPmh0dHA6Ly9j -cmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LU5ldHdvcmtBcHBsaWNhdGlvbnMuY3JsMA0G -CSqGSIb3DQEBBQUAA4IBAQCk8yXM0dSRgyLQzDKrm5ZONJFUICU0YV8qAhXhi6r/fWRRzwr/vH3Y -IWp4yy9Rb/hCHTO967V7lMPDqaAt39EpHx3+jz+7qEUqf9FuVSTiuwL7MT++6LzsQCv4AdRWOOTK -RIK1YSAhZ2X28AvnNPilwpyjXEAfhZOVBt5P1CeptqX8Fs1zMT+4ZSfP1FMa8Kxun08FDAOBp4Qp -xFq9ZFdyrTvPNximmMatBrTcCKME1SmklpoSZ0qMYEWd8SOasACcaLWYUNPvji6SZbFIPiG+FTAq -DbUMo2s/rn9X9R+WfN9v3YIwLGUbQErNaLly7HF27FSOH4UMAWr6pjisH8SE ------END CERTIFICATE----- - -America Online Root Certification Authority 1 -============================================= ------BEGIN CERTIFICATE----- -MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQG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ZQPXLjeSWdm4grECDdpbgyn43g -Kd8hdIaC2y+CMMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds -sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7 ------END CERTIFICATE----- - -America Online Root Certification Authority 2 -============================================= ------BEGIN CERTIFICATE----- -MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT -QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp -Y2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkG -A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg -T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQAD -ggIPADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC206B89en -fHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFciKtZHgVdEglZTvYYUAQv8 -f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2JxhP7JsowtS013wMPgwr38oE18aO6lhO -qKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JN -RvCAOVIyD+OEsnpD8l7eXz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0 -gBe4lL8BPeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67Xnfn -6KVuY8INXWHQjNJsWiEOyiijzirplcdIz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MRUvAawRY8mkaKO/qk= ------END CERTIFICATE----- - Visa eCommerce Root =================== -----BEGIN CERTIFICATE----- @@ -1084,26 +632,6 @@ s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ FL39vmwLAw== -----END CERTIFICATE----- -Sonera Class 1 Root CA -====================== ------BEGIN CERTIFICATE----- -MIIDIDCCAgigAwIBAgIBJDANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG -U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MxIENBMB4XDTAxMDQwNjEwNDkxM1oXDTIxMDQw -NjEwNDkxM1owOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh -IENsYXNzMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALWJHytPZwp5/8Ue+H88 -7dF+2rDNbS82rDTG29lkFwhjMDMiikzujrsPDUJVyZ0upe/3p4zDq7mXy47vPxVnqIJyY1MPQYx9 -EJUkoVqlBvqSV536pQHydekfvFYmUk54GWVYVQNYwBSujHxVX3BbdyMGNpfzJLWaRpXk3w0LBUXl -0fIdgrvGE+D+qnr9aTCU89JFhfzyMlsy3uhsXR/LpCJ0sICOXZT3BgBLqdReLjVQCfOAl/QMF645 -2F/NM8EcyonCIvdFEu1eEpOdY6uCLrnrQkFEy0oaAIINnvmLVz5MxxftLItyM19yejhW1ebZrgUa -HXVFsculJRwSVzb9IjcCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQIR+IMi/ZT -iFIwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQCLGrLJXWG04bkruVPRsoWdd44W7hE9 -28Jj2VuXZfsSZ9gqXLar5V7DtxYvyOirHYr9qxp81V9jz9yw3Xe5qObSIjiHBxTZ/75Wtf0HDjxV -yhbMp6Z3N/vbXB9OWQaHowND9Rart4S9Tu+fMTfwRvFAttEMpWT4Y14h21VOTzF2nBBhjrZTOqMR -vq9tfB69ri3iDGnHhVNoomG6xT60eVR4ngrHAr5i0RGCS2UvkVrCqIexVmiUefkl98HVrhq4uz2P -qYo4Ffdz0Fpg0YCw8NzVUM1O7pJIae2yIx4wzMiUyLb1O4Z/P6Yun/Y+LLWSlj7fLJOK/4GMDw9Z -IRlXvVWa ------END CERTIFICATE----- - Sonera Class 2 Root CA ====================== -----BEGIN CERTIFICATE----- @@ -1146,109 +674,6 @@ nGQI0DvDKcWy7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw== -----END CERTIFICATE----- -TDC Internet Root CA -==================== ------BEGIN CERTIFICATE----- -MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJESzEVMBMGA1UE -ChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTAeFw0wMTA0MDUx -NjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNVBAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJu -ZXQxHTAbBgNVBAsTFFREQyBJbnRlcm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAxLhAvJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20j -xsNuZp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a0vnRrEvL -znWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc14izbSysseLlJ28TQx5yc -5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeG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wwKwYDVR0QBCQwIoAPMjAwMzAy -MTEwODM5MzBagQ8yMDM3MDIxMTA5MDkzMFowHwYDVR0jBBgwFoAUYLWF7FZkfhIZJ2cdUBVLc647 -+RIwHQYDVR0OBBYEFGC1hexWZH4SGSdnHVAVS3OuO/kSMB0GCSqGSIb2fQdBAAQQMA4bCFY2LjA6 -NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEACromJkbTc6gJ82sLMJn9iuFXehHTuJTXCRBuo7E4 -A9G28kNBKWKnctj7fAXmMXAnVBhOinxO5dHKjHiIzxvTkIvmI/gLDjNDfZziChmPyQE+dF10yYsc -A+UYyAFMP8uXBV2YcaaYb7Z8vTd/vuGTJW1v8AqtFxjhA7wHKcitJuj4YfD9IQl+mo6paH1IYnK9 -AOoBmbgGglGBTvH1tJFUuSN6AJqfXY3gPGS5GhKSKseCRHI53OI8xthV9RVOyAUO28bQYqbsFbS1 -AoLbrIyigfCbmTH1ICCoiGEKB5+U/NDXG8wuF/MEJ3Zn61SD/aSQfgY9BKNDLdr8C2LqL19iUw== ------END CERTIFICATE----- - -UTN DATACorp SGC Root CA -======================== ------BEGIN CERTIFICATE----- -MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCBkzELMAkGA1UE -BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl -IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZ -BgNVBAMTElVUTiAtIERBVEFDb3JwIFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBa -MIGTMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4w -HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh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aIK/QI ------END CERTIFICATE----- - -UTN USERFirst Email Root CA -=========================== ------BEGIN CERTIFICATE----- -MIIEojCCA4qgAwIBAgIQRL4Mi1AAJLQR0zYlJWfJiTANBgkqhkiG9w0BAQUFADCBrjELMAkGA1UE -BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl -IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xNjA0 -BgNVBAMTLVVUTi1VU0VSRmlyc3QtQ2xpZW50IEF1dGhlbnRpY2F0aW9uIGFuZCBFbWFpbDAeFw05 -OTA3MDkxNzI4NTBaFw0xOTA3MDkxNzM2NThaMIGuMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQx -FzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsx -ITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRydXN0LmNvbTE2MDQGA1UEAxMtVVROLVVTRVJGaXJz -dC1DbGllbnQgQXV0aGVudGljYXRpb24gYW5kIEVtYWlsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAsjmFpPJ9q0E7YkY3rs3BYHW8OWX5ShpHornMSMxqmNVNNRm5pELlzkniii8efNIx -B8dOtINknS4p1aJkxIW9hVE1eaROaJB7HHqkkqgX8pgV8pPMyaQylbsMTzC9mKALi+VuG6JG+ni8 -om+rWV6lL8/K2m2qL+usobNqqrcuZzWLeeEeaYji5kbNoKXqvgvOdjp6Dpvq/NonWz1zHyLmSGHG -TPNpsaguG7bUMSAsvIKKjqQOpdeJQ/wWWq8dcdcRWdq6hw2v+vPhwvCkxWeM1tZUOt4KpLoDd7Nl -yP0e03RiqhjKaJMeoYV+9Udly/hNVyh00jT/MLbu9mIwFIws6wIDAQABo4G5MIG2MAsGA1UdDwQE -AwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSJgmd9xJ0mcABLtFBIfN49rgRufTBYBgNV -HR8EUTBPME2gS6BJhkdodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLVVTRVJGaXJzdC1DbGll -bnRBdXRoZW50aWNhdGlvbmFuZEVtYWlsLmNybDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUH -AwQwDQYJKoZIhvcNAQEFBQADggEBALFtYV2mGn98q0rkMPxTbyUkxsrt4jFcKw7u7mFVbwQ+zzne -xRtJlOTrIEy05p5QLnLZjfWqo7NK2lYcYJeA3IKirUq9iiv/Cwm0xtcgBEXkzYABurorbs6q15L+ -5K/r9CYdFip/bDCVNy8zEqx/3cfREYxRmLLQo5HQrfafnoOTHh1CuEava2bwm3/q4wMC5QJRwarV -NZ1yQAOJujEdxRBoUp7fooXFXAimeOZTT7Hot9MUnpOmw2TjrH5xzbyf6QMbzPvprDHBr3wVdAKZ -w7JHpsIyYdfHb0gkUSeh1YdV8nuPmD0Wnu51tvjQjvLzxq4oW6fw8zYX/MMF08oDSlQ= ------END CERTIFICATE----- - UTN USERFirst Hardware Root CA ============================== -----BEGIN CERTIFICATE----- @@ -1275,31 +700,6 @@ iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67 nfhmqA== -----END CERTIFICATE----- -UTN USERFirst Object Root CA -============================ ------BEGIN CERTIFICATE----- -MIIEZjCCA06gAwIBAgIQRL4Mi1AAJLQR0zYt4LNfGzANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UE -BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl -IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHTAb -BgNVBAMTFFVUTi1VU0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X9Ptaqd1y9Fahy85dRNacrACgZ++8A+EVCBibGnU4U3GDZlDAQ0Slox4nb9QorFE -qmrPF3rPbw/U+CRVX/A0FklmPlBGyWNxODFiuGK581OtbLUrohKqGU8J2l7nk8aOFAj+8DCAGKCG -hU3IfdeLA/5u1fedFqySLKAj5ZyRUh+U3xeUc8OzwcFxBSAAeL0TUh2oPs0AH8g= ------END CERTIFICATE----- - Camerfirma Chambers of Commerce Root ==================================== -----BEGIN CERTIFICATE----- @@ -1354,42 +754,6 @@ IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== -----END CERTIFICATE----- -NetLock Qualified (Class QA) Root -================================= ------BEGIN CERTIFICATE----- -MIIG0TCCBbmgAwIBAgIBezANBgkqhkiG9w0BAQUFADCByTELMAkGA1UEBhMCSFUxETAPBgNVBAcT -CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV -BAsTEVRhbnVzaXR2YW55a2lhZG9rMUIwQAYDVQQDEzlOZXRMb2NrIE1pbm9zaXRldHQgS296amVn -eXpvaSAoQ2xhc3MgUUEpIFRhbnVzaXR2YW55a2lhZG8xHjAcBgkqhkiG9w0BCQEWD2luZm9AbmV0 -bG9jay5odTAeFw0wMzAzMzAwMTQ3MTFaFw0yMjEyMTUwMTQ3MTFaMIHJMQswCQYDVQQGEwJIVTER -MA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNhZ2kgS2Z0 -LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxQjBABgNVBAMTOU5ldExvY2sgTWlub3NpdGV0 -dCBLb3pqZWd5em9pIChDbGFzcyBRQSkgVGFudXNpdHZhbnlraWFkbzEeMBwGCSqGSIb3DQEJARYP -aW5mb0Bu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0BuZXRsb2Nr -Lm5ldCBlLW1haWwgY2ltZW4uIFdBUk5JTkchIFRoZSBpc3N1YW5jZSBhbmQgdGhlIHVzZSBvZiB0 -aGlzIGNlcnRpZmljYXRlIGFyZSBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIFF1YWxpZmllZCBDUFMg -YXZhaWxhYmxlIGF0IGh0dHBzOi8vd3d3Lm5ldGxvY2suaHUvZG9jcy8gb3IgYnkgZS1tYWlsIGF0 -IGluZm9AbmV0bG9jay5uZXQwHQYDVR0OBBYEFAlqYhaSsFq7VQ7LdTI6MuWyIckoMA0GCSqGSIb3 -DQEBBQUAA4IBAQCRalCc23iBmz+LQuM7/KbD7kPgz/PigDVJRXYC4uMvBcXxKufAQTPGtpvQMznN -wNuhrWw3AkxYQTvyl5LGSKjN5Yo5iWH5Upfpvfb5lHTocQ68d4bDBsxafEp+NFAwLvt/MpqNPfMg -W/hqyobzMUwsWYACff44yTB1HLdV47yfuqhthCgFdbOLDcCRVCHnpgu0mfVRQdzNo0ci2ccBgcTc -R08m6h/t280NmPSjnLRzMkqWmf68f8glWPhY83ZmiVSkpj7EUFy6iRiCdUgh0k8T6GB+B3bbELVR -5qq5aKrN9p2QdRLqOBrKROi3macqaJVmlaut74nLYKkGEsaUR+ko ------END CERTIFICATE----- - NetLock Notary (Class A) Root ============================= -----BEGIN CERTIFICATE----- @@ -1425,64 +789,6 @@ KuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK8CtmdWOMovsEPoMOmzbwGOQmIMOM 8CgHrTwXZoi1/baI -----END CERTIFICATE----- -NetLock Business (Class B) Root -=============================== ------BEGIN CERTIFICATE----- -MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUxETAPBgNVBAcT -CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV -BAsTEVRhbnVzaX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laXJh -c2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBz -Oi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6ZXNA -bmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhl -IHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2 -YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBj -cHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06sPgzTEdM -43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXan3BukxowOR0w2y7jfLKR -stE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKSNitjrFgBazMpUIaD8QFI ------END CERTIFICATE----- - -NetLock Express (Class C) Root -============================== ------BEGIN CERTIFICATE----- -MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUxETAPBgNVBAcT -CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV -BAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQDEytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBD -KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJ -BgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 -dG9uc2FnaSBLZnQuMRowGAYDVQQ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SB1c2Ugb2YgdGhpcyBjZXJ0aWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQ -UyBhdmFpbGFibGUgYXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwg -YXQgY3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmYta3UzbM2 -xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2gpO0u9f38vf5NNwgMvOOW -gyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4Fp1hBWeAyNDYpQcCNJgEjTME1A== ------END CERTIFICATE----- - XRamp Global CA Root ==================== -----BEGIN CERTIFICATE----- @@ -1626,54 +932,6 @@ CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy +fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS -----END CERTIFICATE----- -Firmaprofesional Root CA -======================== ------BEGIN CERTIFICATE----- -MIIEVzCCAz+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCRVMxIjAgBgNVBAcT -GUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1dG9yaWRhZCBkZSBDZXJ0aWZp -Y2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FA -ZmlybWFwcm9mZXNpb25hbC5jb20wHhcNMDExMDI0MjIwMDAwWhcNMTMxMDI0MjIwMDAwWjCBnTEL -MAkGA1UEBhMCRVMxIjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMT -OUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE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u7IvICtUpKkfnRLb7kuxpo7w6kAOnu5+/u9vnldKTC2FJYxHT7zmu1Oyl5GFrv -m+0fazbuSCUlFLZWohDo7qd/0D+j0MNdJu4HzMPBJCGHHt8qElNvQRbn7a6U+oxy+hNH8Dx+rn0R -OhPs7fpvcmR7nX1/Jv16+yWt6j4pf0zjAFcysLPp7VMX2YuyFA4w6OXVE8Zkr8QA1dhYJPz1j+zx -x32l2w8n0cbyQIjmH/ZhqPRCyLk306m+LFZ4wnKbWV01QIroTmMatukgalHizqSQ33ZwmVxwQ023 -tqcZZE6St8WRPH9IFmV7Fv3L/PvZ1dZPIWU7Sn9Ho/s= ------END CERTIFICATE----- - Swisscom Root CA 1 ================== -----BEGIN CERTIFICATE----- @@ -1838,85 +1096,6 @@ vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3 oKfN5XozNmr6mis= -----END CERTIFICATE----- -TURKTRUST Certificate Services Provider Root 1 -============================================== ------BEGIN CERTIFICATE----- -MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOcUktUUlVTVCBF -bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGDAJUUjEP -MA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykgMjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0 -acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMx -MDI3MTdaFw0xNTAzMjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsg -U2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYDVQQHDAZB -TktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBC -aWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEuxZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GX -yGl8hMW0kWxsE2qkVa2kheiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8i -Si9BB35JYbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5CurKZ -8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1JuTm5Rh8i27fbMx4 -W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51b0dewQIDAQABoxAwDjAMBgNVHRME -BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46 -sWrv7/hg0Uw2ZkUd82YCdAR7kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxE -q8Sn5RTOPEFhfEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy -B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdAaLX/7KfS0zgY -nNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKSRGQDJereW26fyfJOrN3H ------END CERTIFICATE----- - -TURKTRUST Certificate Services Provider Root 2 -============================================== ------BEGIN CERTIFICATE----- -MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF -bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQg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kw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4 -Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFzgw2lGh1uEpJ+ -hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotHuFEJjOp9zYhys2AzsfAKRO8P -9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5 -UrbnBEI= ------END CERTIFICATE----- - -SwissSign Platinum CA - G2 -========================== ------BEGIN CERTIFICATE----- -MIIFwTCCA6mgAwIBAgIITrIAZwwDXU8wDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UEBhMCQ0gxFTAT -BgNVBAoTDFN3aXNzU2lnbiBBRzEjMCEGA1UEAxMaU3dpc3NTaWduIFBsYXRpbnVtIENBIC0gRzIw -HhcNMDYxMDI1MDgzNjAwWhcNMzYxMDI1MDgzNjAwWjBJMQswCQYDVQQGEwJDSDEVMBMGA1UEChMM -U3dpc3NTaWduIEFHMSMwIQYDVQQDExpTd2lzc1NpZ24gUGxhdGludW0gQ0EgLSBHMjCCAiIwDQYJ -KoZIhvcNAQEBBQADggIPADCCAgoCggIBAMrfogLi2vj8Bxax3mCq3pZcZB/HL37PZ/pEQtZ2Y5Wu -669yIIpFR4ZieIbWIDkm9K6j/SPnpZy1IiEZtzeTIsBQnIJ71NUERFzLtMKfkr4k2HtnIuJpX+UF -eNSH2XFwMyVTtIc7KZAoNppVRDBopIOXfw0enHb/FZ1glwCNioUD7IC+6ixuEFGSzH7VozPY1kne -WCqv9hbrS3uQMpe5up1Y8fhXSQQeol0GcN1x2/ndi5objM89o03Oy3z2u5yg+gnOI2Ky6Q0f4nIo -j5+saCB9bzuohTEJfwvH6GXp43gOCWcwizSC+13gzJ2BbWLuCB4ELE6b7P6pT1/9aXjvCR+htL/6 -8++QHkwFix7qepF6w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CaUOcsZWayFCTiMlFGiudgp8DAdwZPmaL/YFOSbGDI8Zf0NebvRbFS/bYV3mZy8/CJT5YLSY -Mdp08YSTcU1f+2BY0fvEwW2JorsgH51xkcsymxM9Pn2SUjWskpSi0xjCfMfqr3YFFt1nJ8J+HAci -IfNAChs0B0QTwoRqjt8ZWr9/6x3iGjjRXK9HkmuAtTClyY3YqzGBH9/CZjfTk6mFhnll0g== ------END CERTIFICATE----- - SwissSign Gold CA - G2 ====================== -----BEGIN CERTIFICATE----- @@ -2254,32 +1433,6 @@ hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0= -----END CERTIFICATE----- -S-TRUST Authentication and Encryption Root CA 2005 PN -===================================================== ------BEGIN CERTIFICATE----- -MIIEezCCA2OgAwIBAgIQNxkY5lNUfBq1uMtZWts1tzANBgkqhkiG9w0BAQUFADCBrjELMAkGA1UE -BhMCREUxIDAeBgNVBAgTF0JhZGVuLVd1ZXJ0dGVtYmVyZyAoQlcpMRIwEAYDVQQHEwlTdHV0dGdh -cnQxKTAnBgNVBAoTIERldXRzY2hlciBTcGFya2Fzc2VuIFZlcmxhZyBHbWJIMT4wPAYDVQQDEzVT -LVRSVVNUIEF1dGhlbnRpY2F0aW9uIGFuZCBFbmNyeXB0aW9uIFJvb3QgQ0EgMjAwNTpQTjAeFw0w -NTA2MjIwMDAwMDBaFw0zMDA2MjEyMzU5NTlaMIGuMQswCQYDVQQGEwJERTEgMB4GA1UECBMXQmFk -ZW4tV3VlcnR0ZW1iZXJnIChCVykxEjAQBgNVBAcTCVN0dXR0Z2FydDEpMCcGA1UEChMgRGV1dHNj -aGVyIFNwYXJrYXNzZW4gVmVybGFnIEdtYkgxPjA8BgNVBAMTNVMtVFJVU1QgQXV0aGVudGljYXRp -b24gYW5kIEVuY3J5cHRpb24gUm9vdCBDQSAyMDA1OlBOMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEA2bVKwdMz6tNGs9HiTNL1toPQb9UY6ZOvJ44TzbUlNlA0EmQpoVXhOmCTnijJ4/Ob -4QSwI7+Vio5bG0F/WsPoTUzVJBY+h0jUJ67m91MduwwA7z5hca2/OnpYH5Q9XIHV1W/fuJvS9eXL -g3KSwlOyggLrra1fFi2SU3bxibYs9cEv4KdKb6AwajLrmnQDaHgTncovmwsdvs91DSaXm8f1Xgqf -eN+zvOyauu9VjxuapgdjKRdZYgkqeQd3peDRF2npW932kKvimAoA0SVtnteFhy+S8dF2g08LOlk3 -KC8zpxdQ1iALCvQm+Z845y2kuJuJja2tyWp9iRe79n+Ag3rm7QIDAQABo4GSMIGPMBIGA1UdEwEB -/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEGMCkGA1UdEQQiMCCkHjAcMRowGAYDVQQDExFTVFJv -bmxpbmUxLTIwNDgtNTAdBgNVHQ4EFgQUD8oeXHngovMpttKFswtKtWXsa1IwHwYDVR0jBBgwFoAU -D8oeXHngovMpttKFswtKtWXsa1IwDQYJKoZIhvcNAQEFBQADggEBAK8B8O0ZPCjoTVy7pWMciDMD -pwCHpB8gq9Yc4wYfl35UvbfRssnV2oDsF9eK9XvCAPbpEW+EoFolMeKJ+aQAPzFoLtU96G7m1R08 -P7K9n3frndOMusDXtk3sU5wPBG7qNWdX4wple5A64U8+wwCSersFiXOMy6ZNwPv2AtawB6MDwidA -nwzkhYItr5pCHdDHjfhA7p0GVxzZotiAFP7hYy0yh9WUUpY6RsZxlj33mA6ykaqP2vROJAA5Veit -F7nTNCtKqUDMFypVZUF0Qn71wK/Ik63yGFs9iQzbRzkk+OBM8h+wPQrKBU6JIRrjKpms/H+h8Q8b -Hz2eBIPdltkdOpQ= ------END CERTIFICATE----- - Microsec e-Szigno Root CA ========================= -----BEGIN CERTIFICATE----- @@ -2342,117 +1495,6 @@ PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== -----END CERTIFICATE----- -AC Ra\xC3\xADz Certic\xC3\xA1mara S.A. -====================================== ------BEGIN CERTIFICATE----- -MIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsxCzAJBgNVBAYT -AkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRpZmljYWNpw7NuIERpZ2l0YWwg -LSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwaQUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4w -HhcNMDYxMTI3MjA0NjI5WhcNMzAwNDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+ -U29jaWVkYWQgQ2FtZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJh -IFMuQS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeGqentLhM0R7LQcNzJPNCN -yu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzLfDe3fezTf3MZsGqy2IiKLUV0qPezuMDU -2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQY5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU3 -4ojC2I+GdV75LaeHM/J4Ny+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP -2yYe68yQ54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+bMMCm -8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQy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b5tNAlQiM+9hup4phO9OSzNHdpdqy35f -/RWmnkJDW2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/RL5h -RqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35rMDOhYil/SrnhLecU -Iw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxkBYn8eNZcLCZDqQ== ------END CERTIFICATE----- - -TC TrustCenter Class 2 CA II -============================ ------BEGIN CERTIFICATE----- -MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC -REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy -IENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYw -MTEyMTQzODQzWhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 -c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UE -AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jftMjWQ+nEdVl//OEd+DFw -IxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKguNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2 -xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2JXjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQ -Xa7pIXSSTYtZgo+U4+lK8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7u -SNQZu+995OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1UdEwEB -/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3kUrL84J6E1wIqzCB -7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 -Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU -cnVzdENlbnRlciUyMENsYXNzJTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i -SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u -TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iSGNn3Bzn1LL4G -dXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprtZjluS5TmVfwLG4t3wVMTZonZ -KNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8au0WOB9/WIFaGusyiC2y8zl3gK9etmF1Kdsj -TYjKUCjLhdLTEKJZbtOTVAB6okaVhgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kP -JOzHdiEoZa5X6AeIdUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfk -vQ== ------END CERTIFICATE----- - -TC TrustCenter Class 3 CA II -============================ ------BEGIN CERTIFICATE----- -MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC -REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudG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dGVSZXZvY2F0aW9u -TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlNirTzwppVMXzE -O2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8TtXqluJucsG7Kv5sbviRmEb8 -yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9 -IJqDnxrcOfHFcqMRA/07QlIp2+gB95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal -092Y+tTmBvTwtiBjS+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc -5A== ------END CERTIFICATE----- - -TC TrustCenter Universal CA I -============================= ------BEGIN CERTIFICATE----- -MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTELMAkGA1UEBhMC -REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy -IFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcN -MDYwMzIyMTU1NDI4WhcNMjUxMjMxMjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMg -VHJ1c3RDZW50ZXIgR21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYw -JAYDVQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSRJJZ4Hgmgm5qVSkr1YnwC -qMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3TfCZdzHd55yx4Oagmcw6iXSVphU9VDprv -xrlE4Vc93x9UIuVvZaozhDrzznq+VZeujRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtw -ag+1m7Z3W0hZneTvWq3zwZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9O -gdwZu5GQfezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYDVR0j -BBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0GCSqGSIb3DQEBBQUAA4IBAQAo0uCG -1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X17caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/Cy -vwbZ71q+s2IhtNerNXxTPqYn8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3 -ghUJGooWMNjsydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT -ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/2TYcuiUaUj0a -7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY ------END CERTIFICATE----- - Deutsche Telekom Root CA 2 ========================== -----BEGIN CERTIFICATE----- @@ -2475,50 +1517,6 @@ dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU Cm26OWMohpLzGITY+9HPBVZkVw== -----END CERTIFICATE----- -ComSign CA -========== ------BEGIN CERTIFICATE----- -MIIDkzCCAnugAwIBAgIQFBOWgxRVjOp7Y+X8NId3RDANBgkqhkiG9w0BAQUFADA0MRMwEQYDVQQD -EwpDb21TaWduIENBMRAwDgY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uFYkRes3x+F2T3I5GN9+dHLHcy056mDmrRGiVod7w2ia/viMcKjfZTL0pECMocJEAw6U -AGegcQCCSA== ------END CERTIFICATE----- - -ComSign Secured CA -================== ------BEGIN CERTIFICATE----- -MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAwPDEbMBkGA1UE -AxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0w -NDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwxGzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBD -QTEQMA4GA1UEChMHQ29tU2lnbjELMAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQDGtWhfHZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs -49ohgHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sWv+bznkqH -7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ueMv5WJDmyVIRD9YTC2LxB -kMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d1 -9guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUw -AwEB/zBEBgNVHR8EPTA7MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29t -U2lnblNlY3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58ADsA -j8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkqhkiG9w0BAQUFAAOC -AQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7piL1DRYHjZiM/EoZNGeQFsOY3wo3a -BijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtCdsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtp -FhpFfTMDZflScZAmlaxMDPWLkz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP -51qJThRv4zdLhfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz -OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw== ------END CERTIFICATE----- - Cybertrust Global Root ====================== -----BEGIN CERTIFICATE----- @@ -2620,26 +1618,6 @@ fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHsh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5w wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho -----END CERTIFICATE----- -Buypass Class 3 CA 1 -==================== ------BEGIN CERTIFICATE----- -MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU -QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMyBDQSAxMB4XDTA1 -MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh -c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKx -ifZgisRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//zNIqeKNc0 -n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI+MkcVyzwPX6UvCWThOia -AJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2RhzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c -1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0P -AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFPBdy7 -pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27sEzNxZy5p+qksP2bA -EllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2mSlf56oBzKwzqBwKu5HEA6BvtjT5 -htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yCe/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQj -el/wroQk5PMr+4okoyeYZdowdXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915 ------END CERTIFICATE----- - EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 ========================================================================== -----BEGIN CERTIFICATE----- @@ -2865,7 +1843,7 @@ A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== -----END CERTIFICATE----- -NetLock Arany (Class Gold) FÅ‘tanúsítvány +NetLock Arany (Class Gold) FÅ‘tanúsítvány ============================================ -----BEGIN CERTIFICATE----- MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G @@ -3045,38 +2023,6 @@ MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA== -----END CERTIFICATE----- -Verisign Class 1 Public Primary Certification Authority -======================================================= ------BEGIN CERTIFICATE----- -MIICPDCCAaUCED9pHoGc8JpK83P/uUii5N0wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx -FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow -XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAx -IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDlGb9to1ZhLZlIcfZn3rmN67eehoAKkQ76OCWvRoiC5XOooJskXQ0fzGVuDLDQ -VoQYh5oGmxChc9+0WDlrbsH2FdWoqD+qEgaNMax/sDTXjzRniAnNFBHiTkVWaR94AoDa3EeRKbs2 -yWNcxeDXLYd7obcysHswuiovMaruo2fa2wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFgVKTk8d6Pa -XCUDfGD67gmZPCcQcMgMCeazh88K4hiWNWLMv5sneYlfycQJ9M61Hd8qveXbhpxoJeUwfLaJFf5n -0a3hUKw8fGJLj7qE1xIVGx/KXQ/BUpQqEZnae88MNhPVNdwQGVnqlMEAv3WP2fr9dgTbYruQagPZ -RjXZ+Hxb ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority -======================================================= ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx -FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow -XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz -IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 -f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol -hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky -CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX -bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/ -D/xwzoiQ ------END CERTIFICATE----- - Microsec e-Szigno Root CA 2009 ============================== -----BEGIN CERTIFICATE----- @@ -3101,28 +2047,6 @@ yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi LXpUq3DDfSJlgnCW -----END CERTIFICATE----- -E-Guven Kok Elektronik Sertifika Hizmet Saglayicisi -=================================================== ------BEGIN CERTIFICATE----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fdPebmvEvFZ96ZDAYBzwq -D2fK/A+JYZ1lpTzlvBNbCNvj/+27BrtqBrF6T2XGgv0enIu1De5Iu7i9qgi0+6N8y5/NkHZchpZ4 -Vwpm+Vganf2XKWDeEaaQHBkc7gGWIjQ0LpH5t8Qn0Xvmv/uARFoW5evg1Ao4vOSR49XrXMGs3xtq -fJ7lddK2l4fbzIcrQzqECK+rPNv3PGYxhrCdU3nt+CPeQuMtgvEP5fqX ------END CERTIFICATE----- - GlobalSign Root CA - R3 ======================= -----BEGIN CERTIFICATE----- @@ -3144,29 +2068,6 @@ YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r kpeDMdmztcpHWD9f -----END CERTIFICATE----- -TC TrustCenter Universal CA III -=============================== ------BEGIN CERTIFICATE----- -MIID4TCCAsmgAwIBAgIOYyUAAQACFI0zFQLkbPQwDQYJKoZIhvcNAQEFBQAwezELMAkGA1UEBhMC -REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy -IFVuaXZlcnNhbCBDQTEoMCYGA1UEAxMfVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIElJSTAe -Fw0wOTA5MDkwODE1MjdaFw0yOTEyMzEyMzU5NTlaMHsxCzAJBgNVBAYTAkRFMRwwGgYDVQQKExNU -QyBUcnVzdENlbnRlciBHbWJIMSQwIgYDVQQLExtUQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0Ex -KDAmBgNVBAMTH1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQSBJSUkwggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQDC2pxisLlxErALyBpXsq6DFJmzNEubkKLF5+cvAqBNLaT6hdqbJYUt -QCggbergvbFIgyIpRJ9Og+41URNzdNW88jBmlFPAQDYvDIRlzg9uwliT6CwLOunBjvvya8o84pxO -juT5fdMnnxvVZ3iHLX8LR7PH6MlIfK8vzArZQe+f/prhsq75U7Xl6UafYOPfjdN/+5Z+s7Vy+Eut -CHnNaYlAJ/Uqwa1D7KRTyGG299J5KmcYdkhtWyUB0SbFt1dpIxVbYYqt8Bst2a9c8SaQaanVDED1 -M4BDj5yjdipFtK+/fz6HP3bFzSreIMUWWMv5G/UPyw0RUmS40nZid4PxWJ//AgMBAAGjYzBhMB8G -A1UdIwQYMBaAFFbn4VslQ4Dg9ozhcbyO5YAvxEjiMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ -BAQDAgEGMB0GA1UdDgQWBBRW5+FbJUOA4PaM4XG8juWAL8RI4jANBgkqhkiG9w0BAQUFAAOCAQEA -g8ev6n9NCjw5sWi+e22JLumzCecYV42FmhfzdkJQEw/HkG8zrcVJYCtsSVgZ1OK+t7+rSbyUyKu+ -KGwWaODIl0YgoGhnYIg5IFHYaAERzqf2EQf27OysGh+yZm5WZ2B6dF7AbZc2rrUNXWZzwCUyRdhK -BgePxLcHsU0GDeGl6/R1yrqc0L2z0zIkTO5+4nYES0lT2PLpVDP85XEfPRRclkvxOvIAu2y0+pZV -CIgJwcyRGSmwIC3/yzikQOEXvnlhgP8HA4ZMTnsGnxGGjYnuJ8Tb4rwZjgvDwxPHLQNjO9Po5KIq -woIIlBZU8O8fJ5AluA0OKBtHd0e9HKgl8ZS0Zg== ------END CERTIFICATE----- - Autoridad de Certificacion Firmaprofesional CIF A62634068 ========================================================= -----BEGIN CERTIFICATE----- @@ -3482,7 +2383,7 @@ Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI 03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= -----END CERTIFICATE----- -Certinomis - Autorité Racine +Certinomis - Autorité Racine ============================= -----BEGIN CERTIFICATE----- MIIFnDCCA4SgAwIBAgIBATANBgk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rWacdaxaujs2e3V -cuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0OBAoECERqlWdV -eRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAVdRU0VlIXLOThaq/Yy/kgM40 -ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fGKOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmr -sQd7TZjTXLDR8KdCoLXEjq/+8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZd -JXDRZslo+S4RFGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS -mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmEDNuxUCAKGkq6 -ahq97BvIxYSazQ== ------END CERTIFICATE----- - TWCA Root Certification Authority ================================= -----BEGIN CERTIFICATE----- @@ -3848,31 +2726,6 @@ eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi Cp/HuZc= -----END CERTIFICATE----- -TÃœRKTRUST Elektronik Sertifika Hizmet SaÄŸlayıcısı -====================================================== ------BEGIN CERTIFICATE----- -MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOcUktUUlVTVCBF -bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP -MA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg -QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4X -DTA3MTIyNTE4MzcxOVoXDTE3MTIyMjE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MrqNvWtMvmDb08PUZqxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAK -poRq0Tl9 ------END CERTIFICATE----- - T-TeleSec GlobalRoot Class 3 ============================ -----BEGIN CERTIFICATE----- @@ -3918,3 +2771,1146 @@ uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU 3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM dcGWxZ0= -----END CERTIFICATE----- + +TURKTRUST Certificate Services Provider Root 2007 +================================================= +-----BEGIN CERTIFICATE----- +MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOcUktUUlVTVCBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP +MA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg +QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4X +DTA3MTIyNTE4MzcxOVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxl +a3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMCVFIxDzAN +BgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDEsGxldGnFn2ltIHZlIEJp +bGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7Fni4gKGMpIEFyYWzEsWsgMjAwNzCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9N +YvDdE3ePYakqtdTyuTFYKTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQv +KUmi8wUG+7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveGHtya +KhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6PIzdezKKqdfcYbwnT +rqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M733WB2+Y8a+xwXrXgTW4qhe04MsC +AwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHkYb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/s +Px+EnWVUXKgWAkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I +aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5mxRZNTZPz/OO +Xl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsaXRik7r4EW5nVcV9VZWRi1aKb +BFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZqxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAK +poRq0Tl9 +-----END CERTIFICATE----- + +D-TRUST Root Class 3 CA 2 2009 +============================== +-----BEGIN CERTIFICATE----- +MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTAe +Fw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NThaME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxE +LVRydXN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JEV +dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph +X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I= +-----END CERTIFICATE----- + +D-TRUST Root Class 3 CA 2 EV 2009 +================================= +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw +OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw +OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS +egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh +zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T +7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo6Kr3HGrHhFPC+Oh25z1uxav60 +sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure35 +11H3a6UCAwEAAaOCASQwggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyv +cop9NteaHNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFwOi8v +ZGlyZWN0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DYGBmCGXgMBAjAsMCoGCCsGAQUFBwIBFh5o +dHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9kcGMwDQYJKoZIhvcNAQELBQADggIBACtZ6yKZu4Sq +T96QxtGGcSOeSwORR3C7wJJg7ODU523G0+1ng3dS1fLld6c2suNUvtm7CpsR72H0xpkzmfWvADmN +g7+mvTV+LFwxNG9s2/NkAZiqlCxB3RWGymspThbASfzXg0gTB1GEMVKIu4YXx2sviiCtxQuPcD4q +uxtxj7mkoP3YldmvWb8lK5jpY5MvYB7Eqvh39YtsL+1+LrVPQA3uvFd359m21D+VJzog1eWuq2w1 +n8GhHVnchIHuTQfiSLaeS5UtQbHh6N5+LwUeaO6/u5BlOsju6rEYNxxik6SgMexxbJHmpHmJWhSn +FFAFTKQAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXzsOfIt+FTvZLm8wyWuevo +5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bEqCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq +3TNWOByyrYDT13K9mmyZY+gAu0F2BbdbmRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5 +poLWccret9W6aAjtmcz9opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3Y +eMLEYC/HYvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km +-----END CERTIFICATE----- + +China Internet Network Information Center EV Certificates Root +============================================================== +-----BEGIN CERTIFICATE----- +MIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCQ04xMjAwBgNV +BAoMKUNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyMUcwRQYDVQQDDD5D +aGluYSBJbnRlcm5ldCBOZXR3b3JrIEluZm9ybWF0aW9uIENlbnRlciBFViBDZXJ0aWZpY2F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SnqaeG8XmDtkx2Q== +-----END CERTIFICATE----- + +Swisscom Root EV CA 2 +===================== +-----BEGIN CERTIFICATE----- +MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAwZzELMAkGA1UE +BhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdpdGFsIENlcnRpZmljYXRlIFNl +cnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcN +MzEwNjI1MDg0NTA4WjBnMQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsT +HERpZ2l0YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYg +Q0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7BxUglgRCgz +o3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD1ycfMQ4jFrclyxy0uYAy +Xhqdk/HoPGAsp15XGVhRXrwsVgu42O+LgrQ8uMIkqBPHoCE2G3pXKSinLr9xJZDzRINpUKTk4Rti +GZQJo/PDvO/0vezbE53PnUgJUmfANykRHvvSEaeFGHR55E+FFOtSN+KxRdjMDUN/rhPSays/p8Li +qG12W0OfvrSdsyaGOx9/5fLoZigWJdBLlzin5M8J0TbDC77aO0RYjb7xnglrPvMyxyuHxuxenPaH +Za0zKcQvidm5y8kDnftslFGXEBuGCxobP/YCfnvUxVFkKJ3106yDgYjTdLRZncHrYTNaRdHLOdAG +alNgHa/2+2m8atwBz735j9m9W8E6X47aD0upm50qKGsaCnw8qyIL5XctcfaCNYGu+HuB5ur+rPQa +m3Rc6I8k9l2dRsQs0h4rIWqDJ2dVSqTjyDKXZpBy2uPUZC5f46Fq9mDU5zXNysRojddxyNMkM3Ox +bPlq4SjbX8Y96L5V5jcb7STZDxmPX2MYWFCBUWVv8p9+agTnNCRxunZLWB4ZvRVgRaoMEkABnRDi +xzgHcgplwLa7JSnaFp6LNYth7eVxV4O1PHGf40+/fh6Bn0GXAgMBAAGjgYYwgYMwDgYDVR0PAQH/ +BAQDAgGGMB0GA1UdIQQWMBQwEgYHYIV0AVMCAgYHYIV0AVMCAjASBgNVHRMBAf8ECDAGAQH/AgED +MB0GA1UdDgQWBBRF2aWBbj2ITY1x0kbBbkUe88SAnTAfBgNVHSMEGDAWgBRF2aWBbj2ITY1x0kbB +bkUe88SAnTANBgkqhkiG9w0BAQsFAAOCAgEAlDpzBp9SSzBc1P6xXCX5145v9Ydkn+0UjrgEjihL +j6p7jjm02Vj2e6E1CqGdivdj5eu9OYLU43otb98TPLr+flaYC/NUn81ETm484T4VvwYmneTwkLbU +wp4wLh/vx3rEUMfqe9pQy3omywC0Wqu1kx+AiYQElY2NfwmTv9SoqORjbdlk5LgpWgi/UOGED1V7 +XwgiG/W9mR4U9s70WBCCswo9GcG/W6uqmdjyMb3lOGbcWAXH7WMaLgqXfIeTK7KK4/HsGOV1timH +59yLGn602MnTihdsfSlEvoqq9X46Lmgxk7lq2prg2+kupYTNHAq4Sgj5nPFhJpiTt3tm7JFe3VE/ +23MPrQRYCd0EApUKPtN236YQHoA96M2kZNEzx5LH4k5E4wnJTsJdhw4Snr8PyQUQ3nqjsTzyP6Wq +J3mtMX0f/fwZacXduT98zca0wjAefm6S139hdlqP65VNvBFuIXxZN5nQBrz5Bm0yFqXZaajh3DyA +HmBR3NdUIR7KYndP+tiPsys6DXhyyWhBWkdKwqPrGtcKqzwyVcgKEZzfdNbwQBUdyLmPtTbFr/gi +uMod89a2GQ+fYWVq6nTIfI/DT11lgh/ZDYnadXL77/FHZxOzyNEZiCcmmpl5fx7kLD977vHeTYuW +l8PVP3wbI+2ksx0WckNLIOFZfsLorSa/ovc= +-----END CERTIFICATE----- + +CA Disig Root R1 +================ +-----BEGIN CERTIFICATE-----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ABo0IwQDAPBgNV +HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUiQq0OJMa5qvum5EY+fU8PjXQ +04IwDQYJKoZIhvcNAQEFBQADggIBADKL9p1Kyb4U5YysOMo6CdQbzoaz3evUuii+Eq5FLAR0rBNR +xVgYZk2C2tXck8An4b58n1KeElb21Zyp9HWc+jcSjxyT7Ff+Bw+r1RL3D65hXlaASfX8MPWbTx9B +LxyE04nH4toCdu0Jz2zBuByDHBb6lM19oMgY0sidbvW9adRtPTXoHqJPYNcHKfyyo6SdbhWSVhlM +CrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpBemOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5Gfb +VSUZP/3oNn6z4eGBrxEWi1CXYBmCAMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85 +YmLLW1AL14FABZyb7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKS +ds+xDzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvkF7mGnjix +lAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqFa3qdnom2piiZk4hA9z7N +UaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsTQ6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJ +a7+h89n07eLw4+1knj0vllJPgFOL +-----END CERTIFICATE----- + +CA Disig Root R2 +================ +-----BEGIN CERTIFICATE----- +MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNVBAYTAlNLMRMw +EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp +ZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQyMDcxOTA5MTUzMF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PPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQABDzfuBSO6N+pjWxn +kjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcEqYSjMq+u7msXi7Kx/mzhkIyIqJdI +zshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMC +AQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6g +cFGn90xHNcgL1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn +LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WFH6vPNOw/KP4M +8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNoRI2T9GRwoD2dKAXDOXC4Ynsg +/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlg +lPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryP +A9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3m +i4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5jwa19hAM8 +EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWzaGHQRiapIVJpLesux+t3 +zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0= +-----END CERTIFICATE----- + +TeliaSonera Root CA v1 +====================== +-----BEGIN CERTIFICATE----- +MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIh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AQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNm +zqjMDfz1mgbldxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx +0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1TjTQpgcmLNkQfW +pb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBedY2gea+zDTYa4EzAvXUYNR0PV +G6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpc +c41teyWRyu5FrgZLAMzTsVlQ2jqIOylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOT +JsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2 +qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6 +Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems +WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= +-----END CERTIFICATE----- + +E-Tugra Certification Authority +=============================== +-----BEGIN CERTIFICATE----- +MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w +DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls +ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN +ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw +NTE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E5UMA8GA1UdEwEB +/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEG +MA0GCSqGSIb3DQEBCwUAA4ICAQAFNzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAK +kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO +XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807 +VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo +a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc +dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV +KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT +Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0 +8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G +C7TbO6Orb1wdtn7os4I07QZcJA== +-----END CERTIFICATE----- + +T-TeleSec GlobalRoot Class 2 +============================ +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM +IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU +cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZ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/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== +-----END CERTIFICATE----- + +Atos TrustedRoot 2011 +===================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRvcyBU +cnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQGEwJERTAeFw0xMTA3MDcxNDU4 +MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsG +A1UECgwEQXRvczELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV +hTuXbyo7LjvPpvMpNb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr +54rMVD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+SZFhyBH+ +DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ4J7sVaE3IqKHBAUsR320 +HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0Lcp2AMBYHlT8oDv3FdU9T1nSatCQujgKR +z3bFmx5VdJx4IbHwLfELn8LVlhgf8FQieowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7R +l+lwrrw7GWzbITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZ +bNshMBgGA1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB +CwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8jvZfza1zv7v1Apt+h +k6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5k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gS7ZklmOV +hMJKzRwuJIczYOXD +-----END CERTIFICATE----- + +QuoVadis Root CA 2 G3 +===================== +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQELBQAwSDELMAkG +A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv +b3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJN +MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDIg +RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjcV4g/Ruv5r+LrI3HimtFh +ZiFfqq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WVHhLL5hSEBMHfNrMWn4rjyduY +NM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs+L5u+9ymc5GQYaYDFCDy54ejiK2t +oIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+O7q414AB+6XrW7PFXmAqMaCvN+ggOp+o +MiwMzAkd056OXbxMmO7FGmh77FOm6RQ1o9/NgJ8MSPsc9PG/Srj61YxxSscfrf5BmrODXfKEVu+l +V0POKa2Mq1W/xPtbAd0jIaFYAI7D0GoT7RPjEiuA3GfmlbLNHiJuKvhB1PLKFAeNilUSxmn1uIZo +L1NesNKqIcGY5jDjZ1XHm26sGahVpkUG0CM62+tlXSoREfA7T8pt9DTEceT/AFr2XK4jYIVz8eQQ +sSWu1ZK7E8EM4DnatDlXtas1qnIhO4M15zHfeiFuuDIIfR0ykRVKYnLP43ehvNURG3YBZwjgQQvD +6xVu+KQZ2aKrr+InUlYrAoosFCT5v0ICvybIxo/gbjh9Uy3l7ZizlWNof/k19N+I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N7E8trP6KZ1/AvWkyaiTt3px +KGmPc+FSkNrVvjrlt3ZqVoAh313m6Tqe5T72omnHKgqwGEfcIHB9UqM+WXzBusnIFUBhynLWcKzS +t/Ac5IYp8M7vaGPQtSCKFWGafoaYtMnCdvvMujAWzKNhxnQT5WvvoxXqA/4Ti2Tk08HS6IT7SdEQ +TXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFgu/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9Du +DcpmvJRPpq3t/O5jrFc/ZSXPsoaP0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGib +Ih6BJpsQBJFxwAYf3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmD +hPbl8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+DhcI00iX +0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HNPlopNLk9hM6xZdRZkZFW +dSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ywaZWWDYWGWVjUTR939+J399roD1B0y2 +PpxxVJkES/1Y+Zj0 +-----END CERTIFICATE----- + +DigiCert Assured ID Root G2 +=========================== +-----BEGIN CERTIFICATE----- +MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw +IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgw +MTE1MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL +ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSAn61UQbVH +35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4HteccbiJVMWWXvdMX0h5i89vq +bFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9HpEgjAALAcKxHad3A2m67OeYfcgnDmCXRw +VWmvo2ifv922ebPynXApVfSr/5Vh88lAbx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OP +YLfykqGxvYmJHzDNw6YuYjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+Rn +lTGNAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTO +w0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPIQW5pJ6d1Ee88hjZv +0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I0jJmwYrA8y8678Dj1JGG0VDjA9tz +d29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4GnilmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAW +hsI6yLETcDbYz+70CjTVW0z9B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0M +jomZmWzwPDCvON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo +IhNzbM8m9Yop5w== +-----END CERTIFICATE----- + +DigiCert Assured ID Root G3 +=========================== +-----BEGIN CERTIFICATE----- +MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYD +VQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 +MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQ +BgcqhkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJfZn4f5dwb +RXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17QRSAPWXYQ1qAk8C3eNvJs +KTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgF +UaFNN6KDec6NHSrkhDAKBggqhkjOPQQDAwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5Fy +YZ5eEJJZVrmDxxDnOOlYJjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy +1vUhZscv6pZjamVFkpUBtA== +-----END CERTIFICATE----- + +DigiCert Global Root G2 +======================= +-----BEGIN CERTIFICATE----- +MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw +HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUx +MjAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 +dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI2/Ou8jqJ +kTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx1x7e/dfgy5SDN67sH0NO +3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQq2EGnI/yuum06ZIya7XzV+hdG82MHauV +BJVJ8zUtluNJbd134/tJS7SsVQepj5WztCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyM +UNGPHgm+F6HmIcr9g+UQvIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQAB +o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV5uNu +5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY1Yl9PMWLSn/pvtsr +F9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4NeF22d+mQrvHRAiGfzZ0JFrabA0U +WTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NGFdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBH +QRFXGU7Aj64GxJUTFy8bJZ918rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/ +iyK5S9kJRaTepLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl +MrY= +-----END CERTIFICATE----- + +DigiCert Global Root G3 +======================= +-----BEGIN CERTIFICATE----- +MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQ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0f9BckgG/Jou5yD5m6Leie2uPAmvylezkolwQOQv +T8Jwg0DXJCxr5wkf09XHwQj02w47HAcLQxGEIYbpgNR12KvxAmLBsX5VYc8T1yaw15zLKYs4SgsO +kI26oQ== +-----END CERTIFICATE----- + +COMODO RSA Certification Authority +================================== +-----BEGIN CERTIFICATE----- +MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCBhTELMAkGA1UE +BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG +A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwHhcNMTAwMTE5MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMC +R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE +ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR6FSS0gpWsawNJN3Fz0Rn +dJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8Xpz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZ +FGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+ +5eNu/Nio5JIk2kNrYrhV/erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pG +x8cgoLEfZd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z+pUX +2nwzV0E8jVHtC7ZcryxjGt9XyD+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C2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7I +LaZRfyHBNVOFBkpdn627G190 +-----END CERTIFICATE----- + +USERTrust RSA Certification Authority +===================================== +-----BEGIN CERTIFICATE----- +MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCBiDELMAkGA1UE +BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK +ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UE +BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK +ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCAEmUXNg7D2wiz +0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2j +Y0K2dvKpOyuR+OJv0OwWIJAJPuLodMkYtJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFn +RghRy4YUVD+8M/5+bJz/Fp0YvVGONaanZshyZ9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O ++T23LLb2VN3I5xI6Ta5MirdcmrS3ID3KfyI0rn47aGYBROcBTkZTmzNg95S+UzeQc0PzMsNT79uq +/nROacdrjGCT3sTHDN/hMq7MkztReJVni+49Vv4M0GkPGw/zJSZrM233bkf6c0Plfg6lZrEpfDKE +Y1WJxA3Bk1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ljFH4gx +Q+6IHdfGjjxDah2nGN59PRbxYvnKkKj9 +-----END CERTIFICATE----- + +USERTrust ECC Certification Authority +===================================== +-----BEGIN CERTIFICATE----- +MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDELMAkGA1UEBhMC +VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU +aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMC +VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU +aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQarFRaqfloI+d61SRvU8Za2EurxtW2 +0eZzca7dnNYMYf3boIkDuAUU7FfO7l0/4iGzzvfUinngo4N+LZfQYcTxmdwlkWOrfzCjtHDix6Ez +nPO/LlxTsV+zfTJ/ijTjeXmjQjBAMB0GA1UdDgQWBBQ64QmG1M8ZwpZ2dEl23OA1xmNjmjAOBgNV +HQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBB +HU6+4WMBzzuqQhFkoJ2UOQIReVx7Hfpkue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbWRNZu +9YO6bVi9JNlWSOrvxKJGgYhqOkbRqZtNyWHa0V1Xahg= +-----END CERTIFICATE----- + +GlobalSign ECC Root CA - R4 +=========================== +-----BEGIN CERTIFICATE----- +MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprl +OQcJFspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAwDgYDVR0P +AQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61FuOJAf/sKbvu+M8k8o4TV +MAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGXkPoUVy0D7O48027KqGx2vKLeuwIgJ6iF +JzWbVsaj8kfSt24bAgAXqmemFZHe+pTsewv4n4Q= +-----END CERTIFICATE----- + +GlobalSign ECC Root CA - R5 +=========================== +-----BEGIN CERTIFICATE----- +MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6 +SFkc8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8kehOvRnkmS +h5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd +BgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYIKoZIzj0EAwMDaAAwZQIxAOVpEslu28Yx +uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7 +yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3 +-----END CERTIFICATE----- + +Staat der Nederlanden Root CA - G3 +================================== +-----BEGIN CERTIFICATE----- +MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g +Um9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloXDTI4MTExMzIzMDAwMFowWjELMAkGA1UEBhMC +TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l +ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL4y +olQPcPssXFnrbMSkUeiFKrPMSjTysF/zDsccPVMeiAho2G89rcKezIJnByeHaHE6n3WWIkYFsO2t +x1ueKt6c/DrGlaf1F2cY5y9JCAxcz+bMNO14+1Cx3Gsy8KL+tjzk7FqXxz8ecAgwoNzFs21v0IJy +EavSgWhZghe3eJJg+szeP4TrjTgzkApyI/o1zCZxMdFyKJLZWyNtZrVtB0LrpjPOktvA9mxjeM3K +Tj215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BZ+Extq +1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR1VmiiXTTn74eS9fGbbeI +JG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/QFH1T/U67cjF68IeHRaVesd+QnGTbksV +tzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM94B7IWcnMFk= +-----END CERTIFICATE----- + +Staat der Nederlanden EV Root CA +================================ +-----BEGIN CERTIFICATE----- +MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFhdCBkZXIgTmVkZXJsYW5kZW4g +RVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0yMjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5M +MR4wHAYDVQQKDBVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRl +cmxhbmRlbiBFViBSb290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkk +SzrSM4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nCUiY4iKTW +O0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3dZ//BYY1jTw+bbRcwJu+r +0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46prfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8 +Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13lpJhQDBXd4Pqcfzho0LKmeqfRMb1+ilgnQ7O6M5HTp5gV +XJrm0w912fxBmJc+qiXbj5IusHsMX/FjqTf5m3VpTCgmJdrV8hJwRVXj33NeN/UhbJCONVrJ0yPr +08C+eKxCKFhmpUZtcALXEPlLVPxdhkqHz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b3Z6fJfUEkc7uzXLg== +-----END CERTIFICATE----- + +IdenTrust Commercial Root CA 1 +============================== +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBKMQswCQYDVQQG +EwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBS +b290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQwMTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzES +MBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENB +IDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ld +hNlT3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU+ehcCuz/ +mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gpS0l4PJNgiCL8mdo2yMKi +1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1bVoE/c40yiTcdCMbXTMTEl3EASX2MN0C +XZ/g1Ue9tOsbobtJSdifWwLziuQkkORiT0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl +3ZBWzvurpWCdxJ35UrCLvYf5jysjCiN2O/cz4ckA82n5S6LgTrx+kzmEB/dEcH7+B1rlsazRGMzy +NeVJSQjKVsk9+w8YfYs7wRPCTY/JTw436R+hDmrfYi7LNQZReSzIJTj0+kuniVyc0uMNOYZKdHzV +WYfCP04MXFL0PfdSgvHqo6z9STQaKPNBiDoT7uje/5kdX7rL6B7yuVBgwDHTc+XvvqDtMwt0viAg +xGds8AgDelWAf0ZOlqf0Hj7h9tgJ4TNkK2PXMl6f+cB7D3hvl7yTmvmcEpB4eoCHFddydJxVdHix +uuFucAS6T6C6aMN7/zHwcz09lCqxC0EOoP5NiGVreTO01wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMC +AQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU7UQZwNPwBovupHu+QucmVMiONnYwDQYJKoZI +hvcNAQELBQADggIBAA2ukDL2pkt8RHYZYR4nKM1eVO8lvOMIkPkp165oCOGUAFjvLi5+U1KMtlwH +6oi6mYtQlNeCgN9hCQCTrQ0U5s7B8jeUeLBfnLOic7iPBZM4zY0+sLj7wM+x8uwtLRvM7Kqas6pg +ghstO8OEPVeKlh6cdbjTMM1gCIOQ045U8U1mwF10A0Cj7oV+wh93nAbowacYXVKV7cndJZ5t+qnt +ozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3+wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmV +YjzlVYA211QC//G5Xc7UI2/YRYRKW2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUX +feu+h1sXIFRRk0pTAwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/ro +kTLql1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG4iZZRHUe +2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZmUlO+KWA2yUPHGNiiskz +Z2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7R +cGzM7vRX+Bi6hG6H +-----END CERTIFICATE----- + +IdenTrust Public Sector Root CA 1 +================================= +-----BEGIN CERTIFICATE----- +MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQG +EwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUH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cVYpZmxI1Qj +t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHVDRDtfULAj+7A +mgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9TaDKQGXSc3z1i9kKlT/YPyNt +GtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8GlwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFt +m6/n6J91eEyrRjuazr8FGF1NFTwWmhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMx +NRF4eKLg6TCMf4DfWN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4 +Mhn5+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJtshquDDI +ajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhAGaQdp/lLQzfcaFpPz+vC +ZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ +3Wl9af0AVqW3rLatt8o+Ae+c +-----END CERTIFICATE----- + +Entrust Root Certification Authority - G2 +========================================= +-----BEGIN CERTIFICATE----- +MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMCVVMxFjAUBgNV +BAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVy +bXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ug +b25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIw +HhcNMDkwNzA3MTcyNTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1U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QrBVUAdj8BbGJoX90g5pJ19xO +e4pIb4tF9g== +-----END CERTIFICATE----- + +Entrust Root Certification Authority - EC1 +========================================== +-----BEGIN CERTIFICATE----- +MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkGA1UEBhMCVVMx +FjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVn +YWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXpl +ZCB1c2Ugb25seTEzMDEGA1UEAxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +IC0gRUMxMB4XDTEyMTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYw +FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2Fs +LXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQg +dXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt +IEVDMTB2MBAGByqGSM49AgEGBSuBBAAiA2IABIQTydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHy +AsWfoPZb1YsGGYZPUxBtByQnoaD41UcZYUx9ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef +9eNi1KlHBz7MIKNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE +FLdj5xrdjekIplWDpOBqUEFlEUJJMAoGCCqGSM49BAMDA2cAMGQCMGF52OVCR98crlOZF7ZvHH3h +vxGU0QOIdeSNiaSKd0bebWHvAvX7td/M/k7//qnmpwIwW5nXhTcGtXsI/esni0qU+eH6p44mCOh8 +kmhtc9hvJqwhAriZtyZBWyVgrtBIGu4G +-----END CERTIFICATE----- + +CFCA EV ROOT +============ +-----BEGIN CERTIFICATE----- +MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJDTjEwMC4GA1UE +CgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQDDAxDRkNB +IEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkxMjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEw +MC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQD +DAxDRkNBIEVWIFJPT1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXXWvNED8fBVnV +BU03sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCjZ9YMrM8irq93VCpLTIpTUnrD +7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3IvHWOX6Jn5/ZOkVIBMUtRSqy5J35DN +uF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp7hZZLDRJGqgG16iI0gNyejLi6mhNbiyW +ZXvKWfry4t3uMCz7zEasxGPrb382KzRzEpR/38wmnvFyXVBlWY9ps4deMm/DGIq1lY+wejfeWkU7 +xzbh72fROdOXW3NiGUgthxwG+3SYIElz8AXSG7Ggo7cbcNOIabla1jj0Ytwli3i/+Oh+uFzJlU9f +py25IGvPa931DfSCt/SyZi4QKPaXWnuWFo8BGS1sbn85WAZkgwGDg8NNkt0yxoekN+kWzqotaK8K +gWU6cMGbrU1tVMoqLUuFG7OA5nBFDWteNfB/O7ic5ARwiRIlk9oKmSJgamNgTnYGmE69g60dWIol +hdLHZR4tjsbftsbhf4oEIRUpdPA+nJCdDC7xij5aqgwJHsfVPKPtl8MeNPo4+QgO48BdK4PRVmrJ +tqhUUy54Mmc9gn900PvhtgVguXDbjgv5E1hvcWAQUhC5wUEJ73IfZzF4/5YFjQIDAQABo2MwYTAf +BgNVHSMEGDAWgBTj/i39KNALtbq2osS/BqoFjJP7LzAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB +/wQEAwIBBjAdBgNVHQ4EFgQU4/4t/SjQC7W6tqLEvwaqBYyT+y8wDQYJKoZIhvcNAQELBQADggIB +ACXGumvrh8vegjmWPfBEp2uEcwPenStPuiB/vHiyz5ewG5zz13ku9Ui20vsXiObTej/tUxPQ4i9q +ecsAIyjmHjdXNYmEwnZPNDatZ8POQQaIxffu2Bq41gt/UP+TqhdLjOztUmCypAbqTuv0axn96/Ua +4CUqmtzHQTb3yHQFhDmVOdYLO6Qn+gjYXB74BGBSESgoA//vU2YApUo0FmZ8/Qmkrp5nGm9BC2sG +E5uPhnEFtC+NiWYzKXZUmhH4J/qyP5Hgzg0b8zAarb8iXRvTvyUFTeGSGn+ZnzxEk8rUQElsgIfX +BDrDMlI1Dlb4pd19xIsNER9Tyx6yF7Zod1rg1MvIB671Oi6ON7fQAUtDKXeMOZePglr4UeWJoBjn +aH9dCi77o0cOPaYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN5mydLIhy +PDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe/v5WOaHIz16eGWRGENoX +kbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+ZAAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3C +ekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su +-----END CERTIFICATE----- + +TÃœRKTRUST Elektronik Sertifika Hizmet SaÄŸlayıcısı H5 +========================================================= +-----BEGIN CERTIFICATE----- +MIIEJzCCAw+g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QYJKoZI +hvcNAQELBQADggEBAJ5FdnsXSDLyOIspve6WSk6BGLFRRyDN0GSxDsnZAdkJzsiZ3GglE9Rc8qPo +BP5yCccLqh0lVX6Wmle3usURehnmp349hQ71+S4pL+f5bFgWV1Al9j4uPqrtd3GqqpmWRgqujuwq +URawXs3qZwQcWDD1YIq9pr1N5Za0/EKJAWv2cMhQOQwt1WbZyNKzMrcbGW3LM/nfpeYVhDfwwvJl +lpKQd/Ct9JDpEXjXk4nAPQu6KfTomZ1yju2dL+6SfaHx/126M2CFYv4HAqGEVka+lgqaE9chTLd8 +B59OTj+RdPsnnRHM3eaxynFNExc5JsUpISuTKWqW+qtB4Uu2NQvAmxU= +-----END CERTIFICATE----- + +TÃœRKTRUST Elektronik Sertifika Hizmet SaÄŸlayıcısı H6 +========================================================= +-----BEGIN CERTIFICATE----- +MIIEJjCCAw6gAwIBAgIGfaHyZeyKMA0GCSqGSIb3DQEBCwUAMIGxMQswCQYDVQQGEwJUUjEPMA0G +A1UEBwwGQW5rYXJhMU0wSwYDVQQKDERUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls +acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIEg2MB4XDTEzMTIxODA5 +MDQxMFoXDTIzMTIxNjA5MDQxMFowgbExCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExTTBL +BgNVBAoMRFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBCaWxpxZ9pbSBHw7x2ZW5sacSf +aSBIaXptZXRsZXJpIEEuxZ4uMUIwQAYDVQQDDDlUw5xSS1RSVVNUIEVsZWt0cm9uaWsgU2VydGlm +aWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLEgSDYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQCdsGjW6L0UlqMACprx9MfMkU1xeHe59yEmFXNRFpQJRwXiM/VomjX/3EsvMsew7eKC5W/a +2uqsxgbPJQ1BgfbBOCK9+bGlprMBvD9QFyv26WZV1DOzXPhDIHiTVRZwGTLmiddk671IUP320EED +wnS3/faAz1vFq6TWlRKb55cTMgPp1KtDWxbtMyJkKbbSk60vbNg9tvYdDjTu0n2pVQ8g9P0pu5Fb +HH3GQjhtQiht1AH7zYiXSX6484P4tZgvsycLSF5W506jM7NE1qXyGJTtHB6plVxiSvgNZ1GpryHV ++DKdeboaX+UEVU0TRv/yz3THGmNtwx8XEsMeED5gCLMxAgMBAAGjQjBAMB0GA1UdDgQWBBTdVRcT +9qzoSCHK77Wv0QAy7Z6MtTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG +9w0BAQsFAAOCAQEAb1gNl0OqFlQ+v6nfkkU/hQu7VtMMUszIv3ZnXuaqs6fvuay0EBQNdH49ba3R +fdCaqaXKGDsCQC4qnFAUi/5XfldcEQlLNkVS9z2sFP1E34uXI9TDwe7UU5X+LEr+DXCqu4svLcsy +o4LyVN/Y8t3XSHLuSqMplsNEzm61kod2pLv0kmzOLBQJZo6NrRa1xxsJYTvjIKIDgI6tflEATseW +hvtDmHd9KMeP2Cpu54Rvl0EpABZeTeIT6lnAY2c6RPuY/ATTMHKm9ocJV612ph1jmv3XZch4gyt1 +O6VbuA1df74jrlZVlFjvH4GMKrLN5ptjnhi85WsGtAuYSyher4hYyw== +-----END CERTIFICATE----- + +Certinomis - Root CA +==================== +-----BEGIN CERTIFICATE----- +MIIFkjCCA3qgAwIBAgIBATANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJGUjETMBEGA1UEChMK +Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxHTAbBgNVBAMTFENlcnRpbm9taXMg +LSBSb290IENBMB4XDTEzMTAyMTA5MTcxOFo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Maauo++RLrVl89UM7g6kgmJs95Vn6RHJk/0KGRHCwPT5iV +WVO90CLYiF2cN/z7ZMF4jIuaYAnq1fohX9B0ZedQxb8uuQsLrbWwF6YSjNRieOpWauwK0kDDPAUw +Pk2Ut59KA9N9J0u2/kTO+hkzGm2kQtHdzMjI1xZSg081lLMSVX3l4kLr5JyTCcBMWwerx20RoFAX +lCOotQqSD7J6wWAsOMwaplv/8gzjqh8c3LigkyfeY+N/IZ865Z764BNqdeuWXGKRlI5nU7aJ+BIJ +y29SWwNyhlCVCNSNh4YVH5Uk2KRvms6knZtt0rJ2BobGVgjF6wnaNsIbW0G+YSrjcOa4pvi2WsS9 +Iff/ql+hbHY5ZtbqTFXhADObE5hjyW/QASAJN1LnDE8+zbz1X5YnpyACleAu6AdBBR8Vbtaw5Bng +DwKTACdyxYvRVB9dSsNAl35VpnzBMwQUAR1JIGkLGZOdblgi90AMRgwjY/M50n92Uaf0yKHxDHYi +I0ZSKS3io0EHVmmY0gUJvGnHWmHNj4FgFU2A3ZDifcRQ8ow7bkrHxuaAKzyBvBGAFhAn1/DNP3nM +cyrDflOR1m749fPH0FFNjkulW+YZFzvWgQncItzujrnEj1PhZ7szuIgVRs/taTX/dQ1G885x4cVr +hkIGuUE= +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GB CA +=============================== +-----BEGIN CERTIFICATE----- +MIIDtTCCAp2gAwIBAgIQdrEgUnTwhYdGs/gjGvbCwDANBgkqhkiG9w0BAQsFADBtMQswCQYDVQQG +EwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl +ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQiBDQTAeFw0xNDEyMDExNTAw +MzJaFw0zOTEyMDExNTEwMzFaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYD +VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEds +b2JhbCBSb290IEdCIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Be3HEokKtaX +scriHvt9OO+Y9bI5mE4nuBFde9IllIiCFSZqGzG7qFshISvYD06fWvGxWuR51jIjK+FTzJlFXHtP +rby/h0oLS5daqPZI7H17Dc0hBt+eFf1Biki3IPShehtX1F1Q/7pn2COZH8g/497/b1t3sWtuuMlk +9+HKQUYOKXHQuSP8yYFfTvdv37+ErXNku7dCjmn21HYdfp2nuFeKUWdy19SouJVUQHMD9ur06/4o +Qnc/nSMbsrY9gBQHTC5P99UKFg29ZkM3fiNDecNAhvVMKdqOmq0NpQSHiB6F4+lT1ZvIiwNjeOvg +GUpuuy9rM2RYk61pv48b74JIxwIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB +/zAdBgNVHQ4EFgQUNQ/INmNe4qPs+TtmFc5RUuORmj0wEAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZI +hvcNAQELBQADggEBAEBM+4eymYGQfp3FsLAmzYh7KzKNbrghcViXfa43FK8+5/ea4n32cZiZBKpD +dHij40lhPnOMTZTg+XHEthYOU3gf1qKHLwI5gSk8rxWYITD+KJAAjNHhy/peyP34EEY7onhCkRd0 +VQreUGdNZtGn//3ZwLWoo4rOZvUPQ82nK1d7Y0Zqqi5S2PTt4W2tKZB4SLrhI6qjiey1q5bAtEui +HZeeevJuQHHfaPFlTc58Bd9TZaml8LGXBHAVRgOY1NK/VLSgWH1Sb9pWJmLU2NuJMW8c8CLC02Ic +Nc1MaRVUGpCY3useX8p3x8uOPUNpnJpY0CQ73xtAln41rYHHTnG6iBM= +-----END CERTIFICATE----- + +Certification Authority of WoSign G2 +==================================== +-----BEGIN CERTIFICATE----- +MIIDfDCCAmSgAwIBAgIQayXaioidfLwPBbOxemFFRDANBgkqhkiG9w0BAQsFADBYMQswCQYDVQ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TS+ +7Q9LGOHSJDy7XUe3IfKN0QqZjuNuPq1w4I+5ysxugTH2e5x6eeRncRg= +-----END CERTIFICATE----- + +CA WoSign ECC Root +================== +-----BEGIN CERTIFICATE----- +MIICCTCCAY+gAwIBAgIQaEpYcIBr8I8C+vbe6LCQkDAKBggqhkjOPQQDAzBGMQswCQYDVQQGEwJD +TjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxGzAZBgNVBAMTEkNBIFdvU2lnbiBFQ0MgUm9v +dDAeFw0xNDExMDgwMDU4NThaFw00NDExMDgwMDU4NThaMEYxCzAJBgNVBAYTAkNOMRowGAYDVQQK +ExFXb1NpZ24gQ0EgTGltaXRlZDEbMBkGA1UEAxMSQ0EgV29TaWduIEVDQyBSb290MHYwEAYHKoZI +zj0CAQYFK4EEACIDYgAE4f2OuEMkq5Z7hcK6C62N4DrjJLnSsb6IOsq/Srj57ywvr1FQPEd1bPiU +t5v8KB7FVMxjnRZLU8HnIKvNrCXSf4/CwVqCXjCLelTOA7WRf6qU0NGKSMyCBSah1VES1ns2o0Iw +QDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUqv3VWqP2h4syhf3R +MluARZPzA7gwCgYIKoZIzj0EAwMDaAAwZQIxAOSkhLCB1T2wdKyUpOgOPQB0TKGXa/kNUTyh2Tv0 +Daupn75OcsqF1NnstTJFGG+rrQIwfcf3aWMvoeGY7xMQ0Xk/0f7qO3/eVvSQsRUR2LIiFdAvwyYu +a/GRspBl9JrmkO5K +-----END CERTIFICATE----- diff --git a/web/api/lib/Cake/Config/config.php b/web/api/lib/Cake/Config/config.php index cd3a398c4..755944ab4 100644 --- a/web/api/lib/Cake/Config/config.php +++ b/web/api/lib/Cake/Config/config.php @@ -2,18 +2,18 @@ /** * Core Configurations. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package Cake.Config * @since CakePHP(tm) v 1.1.11.4062 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ $versionFile = file(CAKE . 'VERSION.txt'); diff --git a/web/api/lib/Cake/Config/routes.php b/web/api/lib/Cake/Config/routes.php index 7bcc0c06b..5d603ed8e 100644 --- a/web/api/lib/Cake/Config/routes.php +++ b/web/api/lib/Cake/Config/routes.php @@ -1,17 +1,17 @@ _path = $path; $this->_section = $section; diff --git a/web/api/lib/Cake/Configure/PhpReader.php b/web/api/lib/Cake/Configure/PhpReader.php index d15a41b83..40176ce9f 100644 --- a/web/api/lib/Cake/Configure/PhpReader.php +++ b/web/api/lib/Cake/Configure/PhpReader.php @@ -2,17 +2,17 @@ /** * PhpReader file * - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://book.cakephp.org/2.0/en/development/configuration.html#loading-configuration-files CakePHP(tm) Configuration + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://book.cakephp.org/2.0/en/development/configuration.html#loading-configuration-files CakePHP(tm) Configuration * @package Cake.Configure * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('CakePlugin', 'Core'); @@ -38,11 +38,11 @@ class PhpReader implements ConfigReaderInterface { /** * Constructor for PHP Config file reading. * - * @param string $path The path to read config files from. Defaults to APP . 'Config' . DS + * @param string $path The path to read config files from. Defaults to CONFIG */ public function __construct($path = null) { if (!$path) { - $path = APP . 'Config' . DS; + $path = CONFIG; } $this->_path = $path; } diff --git a/web/api/lib/Cake/Console/Command/AclShell.php b/web/api/lib/Cake/Console/Command/AclShell.php index 15536ebb6..10db318eb 100644 --- a/web/api/lib/Cake/Console/Command/AclShell.php +++ b/web/api/lib/Cake/Console/Command/AclShell.php @@ -2,17 +2,17 @@ /** * Acl Shell provides Acl access in the CLI environment * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 1.2.0.5012 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -89,7 +89,7 @@ class AclShell extends AppShell { $this->args = null; return $this->DbConfig->execute(); } - require_once APP . 'Config' . DS . 'database.php'; + require_once CONFIG . 'database.php'; if (!in_array($this->command, array('initdb'))) { $collection = new ComponentCollection(); diff --git a/web/api/lib/Cake/Console/Command/ApiShell.php b/web/api/lib/Cake/Console/Command/ApiShell.php index 8b0c979d7..3c3dd1cef 100644 --- a/web/api/lib/Cake/Console/Command/ApiShell.php +++ b/web/api/lib/Cake/Console/Command/ApiShell.php @@ -4,17 +4,17 @@ * * Implementation of a Cake Shell to show CakePHP core method signatures. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 1.2.0.5012 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); diff --git a/web/api/lib/Cake/Console/Command/AppShell.php b/web/api/lib/Cake/Console/Command/AppShell.php index 4ea0f2dd8..030ae49fd 100644 --- a/web/api/lib/Cake/Console/Command/AppShell.php +++ b/web/api/lib/Cake/Console/Command/AppShell.php @@ -2,17 +2,17 @@ /** * AppShell file * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('Shell', 'Console'); diff --git a/web/api/lib/Cake/Console/Command/BakeShell.php b/web/api/lib/Cake/Console/Command/BakeShell.php index c1e59c690..e0db7bc0c 100644 --- a/web/api/lib/Cake/Console/Command/BakeShell.php +++ b/web/api/lib/Cake/Console/Command/BakeShell.php @@ -6,17 +6,17 @@ * application development by writing fully functional skeleton controllers, * models, and views. Going further, Bake can also write Unit Tests for you. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 1.2.0.5012 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -30,7 +30,7 @@ App::uses('Model', 'Model'); * models, and views. Going further, Bake can also write Unit Tests for you. * * @package Cake.Console.Command - * @link http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html + * @link https://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html */ class BakeShell extends AppShell { diff --git a/web/api/lib/Cake/Console/Command/CommandListShell.php b/web/api/lib/Cake/Console/Command/CommandListShell.php index ca6620a5b..49b987783 100644 --- a/web/api/lib/Cake/Console/Command/CommandListShell.php +++ b/web/api/lib/Cake/Console/Command/CommandListShell.php @@ -1,17 +1,17 @@ out(" -working: " . rtrim(APP, DS)); $this->out(" -root: " . rtrim(ROOT, DS)); $this->out(" -core: " . rtrim(CORE_PATH, DS)); + $this->out(" -webroot: " . rtrim(WWW_ROOT, DS)); $this->out(""); $this->out(__d('cake_console', "Changing Paths:"), 2); $this->out(__d('cake_console', "Your working path should be the same as your application path. To change your path use the '-app' param.")); diff --git a/web/api/lib/Cake/Console/Command/CompletionShell.php b/web/api/lib/Cake/Console/Command/CompletionShell.php index 57e86f949..3d6fa17e0 100644 --- a/web/api/lib/Cake/Console/Command/CompletionShell.php +++ b/web/api/lib/Cake/Console/Command/CompletionShell.php @@ -1,17 +1,17 @@ __d('cake_console', 'Path to read and write schema.php'), - 'default' => APP . 'Config' . DS . 'Schema' + 'default' => CONFIG . 'Schema' ); $file = array( 'help' => __d('cake_console', 'File name to read and write.'), diff --git a/web/api/lib/Cake/Console/Command/ServerShell.php b/web/api/lib/Cake/Console/Command/ServerShell.php index 8c7d5e5e3..014d3978a 100644 --- a/web/api/lib/Cake/Console/Command/ServerShell.php +++ b/web/api/lib/Cake/Console/Command/ServerShell.php @@ -2,17 +2,17 @@ /** * built-in Server Shell * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 2.3.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -78,7 +78,7 @@ class ServerShell extends AppShell { * or otherwise modify the pre-command flow. * * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup */ public function startup() { if (!empty($this->params['host'])) { diff --git a/web/api/lib/Cake/Console/Command/Task/BakeTask.php b/web/api/lib/Cake/Console/Command/Task/BakeTask.php index 8298e112a..c886c95e6 100644 --- a/web/api/lib/Cake/Console/Command/Task/BakeTask.php +++ b/web/api/lib/Cake/Console/Command/Task/BakeTask.php @@ -2,17 +2,17 @@ /** * Base class for Bake Tasks. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 1.3 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); diff --git a/web/api/lib/Cake/Console/Command/Task/CommandTask.php b/web/api/lib/Cake/Console/Command/Task/CommandTask.php index fca006a72..99c888f8e 100644 --- a/web/api/lib/Cake/Console/Command/Task/CommandTask.php +++ b/web/api/lib/Cake/Console/Command/Task/CommandTask.php @@ -1,16 +1,16 @@ doComponents(); $wannaUseSession = $this->in( - __d('cake_console', "Would you like to use Session flash messages?"), array('y', 'n'), 'y' + __d('cake_console', "Would you like to use the FlashComponent to display flash messages?"), array('y', 'n'), 'y' ); if (strtolower($wannaUseSession) === 'y') { - array_push($components, 'Session'); + array_push($components, 'Session', 'Flash'); } array_unique($components); } @@ -331,6 +331,12 @@ class ControllerTask extends BakeTask { public function bake($controllerName, $actions = '', $helpers = null, $components = null) { $this->out("\n" . __d('cake_console', 'Baking controller class for %s...', $controllerName), 1, Shell::QUIET); + if ($helpers === null) { + $helpers = array(); + } + if ($components === null) { + $components = array(); + } $isScaffold = ($actions === 'scaffold') ? true : false; $this->Template->set(array( @@ -384,9 +390,9 @@ class ControllerTask extends BakeTask { * @return array Components the user wants to use. */ public function doComponents() { - $components = array('Paginator', 'Flash'); + $components = array('Paginator'); return array_merge($components, $this->_doPropertyChoices( - __d('cake_console', "Would you like this controller to use other components\nbesides PaginatorComponent and FlashComponent?"), + __d('cake_console', "Would you like this controller to use other components\nbesides PaginatorComponent?"), __d('cake_console', "Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'") )); } diff --git a/web/api/lib/Cake/Console/Command/Task/DbConfigTask.php b/web/api/lib/Cake/Console/Command/Task/DbConfigTask.php index ee1aa6c99..c76b87bcd 100644 --- a/web/api/lib/Cake/Console/Command/Task/DbConfigTask.php +++ b/web/api/lib/Cake/Console/Command/Task/DbConfigTask.php @@ -2,17 +2,17 @@ /** * The DbConfig Task handles creating and updating the database.php * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 1.2 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -64,7 +64,7 @@ class DbConfigTask extends AppShell { * @return void */ public function initialize() { - $this->path = APP . 'Config' . DS; + $this->path = CONFIG; } /** diff --git a/web/api/lib/Cake/Console/Command/Task/ExtractTask.php b/web/api/lib/Cake/Console/Command/Task/ExtractTask.php index 740528f70..eaa691e31 100644 --- a/web/api/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/web/api/lib/Cake/Console/Command/Task/ExtractTask.php @@ -2,17 +2,17 @@ /** * Language string extractor * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 1.2.0.5012 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); diff --git a/web/api/lib/Cake/Console/Command/Task/FixtureTask.php b/web/api/lib/Cake/Console/Command/Task/FixtureTask.php index 1f578d083..7b2ee52e7 100644 --- a/web/api/lib/Cake/Console/Command/Task/FixtureTask.php +++ b/web/api/lib/Cake/Console/Command/Task/FixtureTask.php @@ -2,17 +2,17 @@ /** * The FixtureTask handles creating and updating fixture files. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 1.3 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -125,7 +125,8 @@ class FixtureTask extends BakeTask { return $this->all(); } $model = $this->_modelName($this->args[0]); - $this->bake($model); + $importOptions = $this->importOptions($model); + $this->bake($model, false, $importOptions); } } @@ -177,24 +178,29 @@ class FixtureTask extends BakeTask { */ public function importOptions($modelName) { $options = array(); + $plugin = ''; + if (isset($this->params['plugin'])) { + $plugin = $this->params['plugin'] . '.'; + } if (!empty($this->params['schema'])) { - $options['schema'] = $modelName; - } else { + $options['schema'] = $plugin . $modelName; + } elseif ($this->interactive) { $doSchema = $this->in(__d('cake_console', 'Would you like to import schema for this fixture?'), array('y', 'n'), 'n'); if ($doSchema === 'y') { $options['schema'] = $modelName; } } + if (!empty($this->params['records'])) { - $doRecords = 'y'; - } else { + $options['fromTable'] = true; + } elseif ($this->interactive) { $doRecords = $this->in(__d('cake_console', 'Would you like to use record importing for this fixture?'), array('y', 'n'), 'n'); + if ($doRecords === 'y') { + $options['records'] = true; + } } - if ($doRecords === 'y') { - $options['records'] = true; - } - if ($doRecords === 'n') { + if (!isset($options['records']) && $this->interactive) { $prompt = __d('cake_console', "Would you like to build this fixture with data from %s's table?", $modelName); $fromTable = $this->in($prompt, array('y', 'n'), 'n'); if (strtolower($fromTable) === 'y') { @@ -329,6 +335,9 @@ class FixtureTask extends BakeTask { } $insert = ''; switch ($fieldInfo['type']) { + case 'tinyinteger': + case 'smallinteger': + case 'biginteger': case 'integer': case 'float': $insert = $i + 1; diff --git a/web/api/lib/Cake/Console/Command/Task/ModelTask.php b/web/api/lib/Cake/Console/Command/Task/ModelTask.php index 2dc03a5c3..4619655f9 100644 --- a/web/api/lib/Cake/Console/Command/Task/ModelTask.php +++ b/web/api/lib/Cake/Console/Command/Task/ModelTask.php @@ -2,17 +2,17 @@ /** * The ModelTask handles creating and updating models files. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 1.2 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -450,6 +450,10 @@ class ModelTask extends BakeTask { $guess = $methods['notBlank']; } elseif ($metaData['type'] === 'integer') { $guess = $methods['numeric']; + } elseif ($metaData['type'] === 'smallinteger') { + $guess = $methods['numeric']; + } elseif ($metaData['type'] === 'tinyinteger') { + $guess = $methods['numeric']; } elseif ($metaData['type'] === 'float') { $guess = $methods['numeric']; } elseif ($metaData['type'] === 'boolean') { diff --git a/web/api/lib/Cake/Console/Command/Task/PluginTask.php b/web/api/lib/Cake/Console/Command/Task/PluginTask.php index 7cd507942..10a00864a 100644 --- a/web/api/lib/Cake/Console/Command/Task/PluginTask.php +++ b/web/api/lib/Cake/Console/Command/Task/PluginTask.php @@ -1,16 +1,16 @@ path = current(App::path('plugins')); - $this->bootstrap = APP . 'Config' . DS . 'bootstrap.php'; + $this->bootstrap = CONFIG . 'bootstrap.php'; } /** diff --git a/web/api/lib/Cake/Console/Command/Task/ProjectTask.php b/web/api/lib/Cake/Console/Command/Task/ProjectTask.php index df1ab19db..ed38f6855 100644 --- a/web/api/lib/Cake/Console/Command/Task/ProjectTask.php +++ b/web/api/lib/Cake/Console/Command/Task/ProjectTask.php @@ -2,17 +2,17 @@ /** * The Project Task handles creating the base application * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 1.2 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -79,14 +79,14 @@ class ProjectTask extends AppShell { if ($this->securitySalt($path) === true) { $this->out(__d('cake_console', ' * Random hash key created for \'Security.salt\'')); } else { - $this->err(__d('cake_console', 'Unable to generate random hash for \'Security.salt\', you should change it in %s', APP . 'Config' . DS . 'core.php')); + $this->err(__d('cake_console', 'Unable to generate random hash for \'Security.salt\', you should change it in %s', CONFIG . 'core.php')); $success = false; } if ($this->securityCipherSeed($path) === true) { $this->out(__d('cake_console', ' * Random seed created for \'Security.cipherSeed\'')); } else { - $this->err(__d('cake_console', 'Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', APP . 'Config' . DS . 'core.php')); + $this->err(__d('cake_console', 'Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', CONFIG . 'core.php')); $success = false; } @@ -362,7 +362,7 @@ class ProjectTask extends AppShell { * @return bool Success */ public function cakeAdmin($name) { - $path = (empty($this->configPath)) ? APP . 'Config' . DS : $this->configPath; + $path = (empty($this->configPath)) ? CONFIG : $this->configPath; $File = new File($path . 'core.php'); $contents = $File->read(); if (preg_match('%(\s*[/]*Configure::write\(\'Routing.prefixes\',[\s\'a-z,\)\(]*\);)%', $contents, $match)) { diff --git a/web/api/lib/Cake/Console/Command/Task/TemplateTask.php b/web/api/lib/Cake/Console/Command/Task/TemplateTask.php index d5dfc4440..0691bf5c2 100644 --- a/web/api/lib/Cake/Console/Command/Task/TemplateTask.php +++ b/web/api/lib/Cake/Console/Command/Task/TemplateTask.php @@ -2,17 +2,17 @@ /** * Template Task can generate templated output Used in other Tasks * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 1.3 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); diff --git a/web/api/lib/Cake/Console/Command/Task/TestTask.php b/web/api/lib/Cake/Console/Command/Task/TestTask.php index a147951c2..342494e57 100644 --- a/web/api/lib/Cake/Console/Command/Task/TestTask.php +++ b/web/api/lib/Cake/Console/Command/Task/TestTask.php @@ -2,17 +2,17 @@ /** * The TestTask handles creating and updating test files. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 1.3 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -367,7 +367,7 @@ class TestTask extends BakeTask { * Generate the list of fixtures that will be required to run this test based on * loaded models. * - * @param object $subject The object you want to generate fixtures for. + * @param CakeObject $subject The object you want to generate fixtures for. * @return array Array of fixtures to be included in the test. */ public function generateFixtureList($subject) { diff --git a/web/api/lib/Cake/Console/Command/Task/ViewTask.php b/web/api/lib/Cake/Console/Command/Task/ViewTask.php index 06ecf0013..fa7ddef44 100644 --- a/web/api/lib/Cake/Console/Command/Task/ViewTask.php +++ b/web/api/lib/Cake/Console/Command/Task/ViewTask.php @@ -2,17 +2,17 @@ /** * The View Tasks handles creating and updating view files. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 1.2 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); diff --git a/web/api/lib/Cake/Console/Command/TestShell.php b/web/api/lib/Cake/Console/Command/TestShell.php index 4dfacfdfc..b12f6a078 100644 --- a/web/api/lib/Cake/Console/Command/TestShell.php +++ b/web/api/lib/Cake/Console/Command/TestShell.php @@ -4,17 +4,17 @@ * * This Shell allows the running of test suites via the cake command line * - * CakePHP(tm) Tests - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) Tests + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://book.cakephp.org/2.0/en/development/testing.html + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://book.cakephp.org/2.0/en/development/testing.html * @since CakePHP(tm) v 1.2.0.4433 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('Shell', 'Console'); @@ -71,6 +71,9 @@ class TestShell extends Shell { ))->addOption('coverage-clover', array( 'help' => __d('cake_console', ' Write code coverage data in Clover XML format.'), 'default' => false + ))->addOption('coverage-text', array( + 'help' => __d('cake_console', 'Output code coverage report in Text format.'), + 'boolean' => true ))->addOption('testdox-html', array( 'help' => __d('cake_console', ' Write agile documentation in HTML format to file.'), 'default' => false @@ -152,6 +155,7 @@ class TestShell extends Shell { 'default' => false ))->addOption('directive', array( 'help' => __d('cake_console', 'key[=value] Sets a php.ini value.'), + 'short' => 'd', 'default' => false ))->addOption('fixture', array( 'help' => __d('cake_console', 'Choose a custom fixture manager.') @@ -234,7 +238,11 @@ class TestShell extends Shell { if ($value === false) { continue; } - $options[] = '--' . $param; + if ($param === 'directive') { + $options[] = '-d'; + } else { + $options[] = '--' . $param; + } if (is_string($value)) { $options[] = $value; } diff --git a/web/api/lib/Cake/Console/Command/TestsuiteShell.php b/web/api/lib/Cake/Console/Command/TestsuiteShell.php index d37ac501b..911f787c9 100644 --- a/web/api/lib/Cake/Console/Command/TestsuiteShell.php +++ b/web/api/lib/Cake/Console/Command/TestsuiteShell.php @@ -4,17 +4,17 @@ * * This is a bc wrapper for the newer Test shell * - * CakePHP(tm) Tests - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) Tests + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://book.cakephp.org/2.0/en/development/testing.html + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://book.cakephp.org/2.0/en/development/testing.html * @since CakePHP(tm) v 1.2.0.4433 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('TestShell', 'Console/Command'); diff --git a/web/api/lib/Cake/Console/Command/UpgradeShell.php b/web/api/lib/Cake/Console/Command/UpgradeShell.php index 12b3fbc9d..f9d1223af 100644 --- a/web/api/lib/Cake/Console/Command/UpgradeShell.php +++ b/web/api/lib/Cake/Console/Command/UpgradeShell.php @@ -2,18 +2,18 @@ /** * Upgrade Shell * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package Cake.Console.Command * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -532,7 +532,7 @@ class UpgradeShell extends AppShell { /** * Update components. * - * - Make components that extend Object to extend Component. + * - Make components that extend CakeObject to extend Component. * * @return void */ @@ -547,6 +547,11 @@ class UpgradeShell extends AppShell { '/([a-zA-Z]*Component extends) Object/', '\1 Component' ), + array( + '*Component extends CakeObject to *Component extends Component', + '/([a-zA-Z]*Component extends) CakeObject/', + '\1 Component' + ), ); $this->_filesRegexpUpdate($patterns); diff --git a/web/api/lib/Cake/Console/ConsoleErrorHandler.php b/web/api/lib/Cake/Console/ConsoleErrorHandler.php index 7cbb2df15..3df0bf734 100644 --- a/web/api/lib/Cake/Console/ConsoleErrorHandler.php +++ b/web/api/lib/Cake/Console/ConsoleErrorHandler.php @@ -2,17 +2,17 @@ /** * ErrorHandler for Console Shells * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('ErrorHandler', 'Error'); diff --git a/web/api/lib/Cake/Console/ConsoleInput.php b/web/api/lib/Cake/Console/ConsoleInput.php index 551635b82..dc416ce82 100644 --- a/web/api/lib/Cake/Console/ConsoleInput.php +++ b/web/api/lib/Cake/Console/ConsoleInput.php @@ -2,18 +2,18 @@ /** * ConsoleInput file. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package Cake.Console * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/web/api/lib/Cake/Console/ConsoleInputArgument.php b/web/api/lib/Cake/Console/ConsoleInputArgument.php index 08dbc21e9..36f085509 100644 --- a/web/api/lib/Cake/Console/ConsoleInputArgument.php +++ b/web/api/lib/Cake/Console/ConsoleInputArgument.php @@ -2,17 +2,17 @@ /** * ConsoleArgumentOption file * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** @@ -159,7 +159,7 @@ class ConsoleInputArgument { $option = $parent->addChild('argument'); $option->addAttribute('name', $this->_name); $option->addAttribute('help', $this->_help); - $option->addAttribute('required', $this->isRequired()); + $option->addAttribute('required', (int)$this->isRequired()); $choices = $option->addChild('choices'); foreach ($this->_choices as $valid) { $choices->addChild('choice', $valid); diff --git a/web/api/lib/Cake/Console/ConsoleInputOption.php b/web/api/lib/Cake/Console/ConsoleInputOption.php index 3a4b7a1c9..139c98353 100644 --- a/web/api/lib/Cake/Console/ConsoleInputOption.php +++ b/web/api/lib/Cake/Console/ConsoleInputOption.php @@ -2,17 +2,17 @@ /** * ConsoleInputOption file * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** @@ -205,10 +205,11 @@ class ConsoleInputOption { $option->addAttribute('name', '--' . $this->_name); $short = ''; if (strlen($this->_short)) { - $short = $this->_short; + $short = '-' . $this->_short; } - $option->addAttribute('short', '-' . $short); - $option->addAttribute('boolean', $this->_boolean); + $option->addAttribute('short', $short); + $option->addAttribute('help', $this->_help); + $option->addAttribute('boolean', (int)$this->_boolean); $option->addChild('default', $this->_default); $choices = $option->addChild('choices'); foreach ($this->_choices as $valid) { diff --git a/web/api/lib/Cake/Console/ConsoleInputSubcommand.php b/web/api/lib/Cake/Console/ConsoleInputSubcommand.php index 65c10db06..b67210698 100644 --- a/web/api/lib/Cake/Console/ConsoleInputSubcommand.php +++ b/web/api/lib/Cake/Console/ConsoleInputSubcommand.php @@ -2,17 +2,17 @@ /** * ConsoleInputSubcommand file * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/web/api/lib/Cake/Console/ConsoleOptionParser.php b/web/api/lib/Cake/Console/ConsoleOptionParser.php index f54c5460d..f90dbc4e1 100644 --- a/web/api/lib/Cake/Console/ConsoleOptionParser.php +++ b/web/api/lib/Cake/Console/ConsoleOptionParser.php @@ -2,17 +2,17 @@ /** * ConsoleOptionParser file * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('TaskCollection', 'Console'); diff --git a/web/api/lib/Cake/Console/ConsoleOutput.php b/web/api/lib/Cake/Console/ConsoleOutput.php index ec6fb3941..4690a850b 100644 --- a/web/api/lib/Cake/Console/ConsoleOutput.php +++ b/web/api/lib/Cake/Console/ConsoleOutput.php @@ -2,17 +2,17 @@ /** * ConsoleOutput file. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/web/api/lib/Cake/Console/HelpFormatter.php b/web/api/lib/Cake/Console/HelpFormatter.php index 3a8fac98f..0c4259aae 100644 --- a/web/api/lib/Cake/Console/HelpFormatter.php +++ b/web/api/lib/Cake/Console/HelpFormatter.php @@ -2,16 +2,16 @@ /** * HelpFormatter * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('CakeText', 'Utility'); @@ -182,7 +182,6 @@ class HelpFormatter { $xml->addChild('command', $parser->command()); $xml->addChild('description', $parser->description()); - $xml->addChild('epilog', $parser->epilog()); $subcommands = $xml->addChild('subcommands'); foreach ($parser->subcommands() as $command) { $command->xml($subcommands); @@ -195,6 +194,7 @@ class HelpFormatter { foreach ($parser->arguments() as $argument) { $argument->xml($arguments); } + $xml->addChild('epilog', $parser->epilog()); return $string ? $xml->asXml() : $xml; } diff --git a/web/api/lib/Cake/Console/Helper/BaseShellHelper.php b/web/api/lib/Cake/Console/Helper/BaseShellHelper.php index f06a17aac..96f12c1bb 100644 --- a/web/api/lib/Cake/Console/Helper/BaseShellHelper.php +++ b/web/api/lib/Cake/Console/Helper/BaseShellHelper.php @@ -1,16 +1,16 @@ name) { @@ -222,7 +222,7 @@ class Shell extends Object { * allows configuration of tasks prior to shell execution * * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::initialize + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::initialize */ public function initialize() { $this->_loadModels(); @@ -237,7 +237,7 @@ class Shell extends Object { * or otherwise modify the pre-command flow. * * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup */ public function startup() { $this->_welcome(); @@ -340,7 +340,7 @@ class Shell extends Object { * * @param string $task The task name to check. * @return bool Success - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasTask + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasTask */ public function hasTask($task) { return isset($this->_taskMap[Inflector::camelize($task)]); @@ -351,7 +351,7 @@ class Shell extends Object { * * @param string $name The method name to check. * @return bool - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasMethod + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasMethod */ public function hasMethod($name) { try { @@ -369,7 +369,7 @@ class Shell extends Object { } /** - * Dispatch a command to another Shell. Similar to Object::requestAction() + * Dispatch a command to another Shell. Similar to CakeObject::requestAction() * but intended for running shells from other shells. * * ### Usage: @@ -387,7 +387,7 @@ class Shell extends Object { * `return $this->dispatchShell('schema', 'create', 'i18n', '--dry');` * * @return mixed The return of the other shell. - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::dispatchShell + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::dispatchShell */ public function dispatchShell() { $args = func_get_args(); @@ -415,8 +415,8 @@ class Shell extends Object { * @param string $command The command name to run on this shell. If this argument is empty, * and the shell has a `main()` method, that will be called instead. * @param array $argv Array of arguments to run the shell with. This array should be missing the shell name. - * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::runCommand + * @return int|bool + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::runCommand */ public function runCommand($command, $argv) { $isTask = $this->hasTask($command); @@ -431,6 +431,7 @@ class Shell extends Object { try { list($this->params, $this->args) = $this->OptionParser->parse($argv, $command); } catch (ConsoleException $e) { + $this->err(__d('cake_console', 'Error: %s', $e->getMessage())); $this->out($this->OptionParser->help($command)); return false; } @@ -468,7 +469,7 @@ class Shell extends Object { * Display the help in the correct format * * @param string $command The command to get help for. - * @return void + * @return int|bool */ protected function _displayHelp($command) { $format = 'text'; @@ -487,7 +488,7 @@ class Shell extends Object { * By overriding this method you can configure the ConsoleOptionParser before returning it. * * @return ConsoleOptionParser - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::getOptionParser + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::getOptionParser */ public function getOptionParser() { $name = ($this->plugin ? $this->plugin . '.' : '') . $this->name; @@ -533,7 +534,7 @@ class Shell extends Object { * @param string|array $options Array or string of options. * @param string $default Default input value. * @return mixed Either the default value, or the user-provided input. - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::in + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::in */ public function in($prompt, $options = null, $default = null) { if (!$this->interactive) { @@ -570,7 +571,7 @@ class Shell extends Object { * @param string $prompt Prompt text. * @param string|array $options Array or string of options. * @param string $default Default input value. - * @return Either the default value, or the user-provided input. + * @return string|int the default value, or the user-provided input. */ protected function _getInput($prompt, $options, $default) { if (!is_array($options)) { @@ -612,7 +613,7 @@ class Shell extends Object { * @param string|int|array $options Array of options to use, or an integer to wrap the text to. * @return string Wrapped / indented text * @see CakeText::wrap() - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::wrapText + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::wrapText */ public function wrapText($text, $options = array()) { return CakeText::wrap($text, $options); @@ -633,7 +634,7 @@ class Shell extends Object { * @param int $newlines Number of newlines to append * @param int $level The message's output level, see above. * @return int|bool Returns the number of bytes returned from writing to stdout. - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::out + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::out */ public function out($message = null, $newlines = 1, $level = Shell::NORMAL) { $currentLevel = Shell::NORMAL; @@ -688,7 +689,7 @@ class Shell extends Object { * @param string|array $message A string or an array of strings to output * @param int $newlines Number of newlines to append * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::err + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::err */ public function err($message = null, $newlines = 1) { $this->stderr->write($message, $newlines); @@ -699,7 +700,7 @@ class Shell extends Object { * * @param int $multiplier Number of times the linefeed sequence should be repeated * @return string - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::nl + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::nl */ public function nl($multiplier = 1) { return str_repeat(ConsoleOutput::LF, $multiplier); @@ -711,7 +712,7 @@ class Shell extends Object { * @param int $newlines Number of newlines to pre- and append * @param int $width Width of the line, defaults to 63 * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hr + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hr */ public function hr($newlines = 0, $width = 63) { $this->out(null, $newlines); @@ -725,8 +726,8 @@ class Shell extends Object { * * @param string $title Title of the error * @param string $message An optional error message - * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::error + * @return int + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::error */ public function error($title, $message = null) { $this->err(__d('cake_console', 'Error: %s', $title)); @@ -742,7 +743,7 @@ class Shell extends Object { * Clear the console * * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::clear + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::clear */ public function clear() { if (empty($this->params['noclear'])) { @@ -760,7 +761,7 @@ class Shell extends Object { * @param string $path Where to put the file. * @param string $contents Content to put in the file. * @return bool Success - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::createFile + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::createFile */ public function createFile($path, $contents) { $path = str_replace(DS . DS, DS, $path); @@ -849,7 +850,7 @@ class Shell extends Object { * * @param string $file Absolute file path * @return string short path - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::shortPath + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::shortPath */ public function shortPath($file) { $shortPath = str_replace(ROOT, null, $file); @@ -974,15 +975,48 @@ class Shell extends Object { CakeLog::drop('stderr'); return; } + if (!$this->_loggerIsConfigured("stdout")) { + $this->_configureStdOutLogger(); + } + if (!$this->_loggerIsConfigured("stderr")) { + $this->_configureStdErrLogger(); + } + } + +/** + * Configure the stdout logger + * + * @return void + */ + protected function _configureStdOutLogger() { CakeLog::config('stdout', array( 'engine' => 'Console', 'types' => array('notice', 'info'), 'stream' => $this->stdout, )); + } + +/** + * Configure the stderr logger + * + * @return void + */ + protected function _configureStdErrLogger() { CakeLog::config('stderr', array( 'engine' => 'Console', 'types' => array('emergency', 'alert', 'critical', 'error', 'warning', 'debug'), 'stream' => $this->stderr, )); } + +/** + * Checks if the given logger is configured + * + * @param string $logger The name of the logger to check + * @return bool + */ + protected function _loggerIsConfigured($logger) { + $configured = CakeLog::configured(); + return in_array($logger, $configured); + } } diff --git a/web/api/lib/Cake/Console/ShellDispatcher.php b/web/api/lib/Cake/Console/ShellDispatcher.php index d53851127..9f21befb2 100644 --- a/web/api/lib/Cake/Console/ShellDispatcher.php +++ b/web/api/lib/Cake/Console/ShellDispatcher.php @@ -2,17 +2,17 @@ /** * ShellDispatcher file * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** @@ -106,7 +106,7 @@ class ShellDispatcher { $message = "This file has been loaded incorrectly and cannot continue.\n" . "Please make sure that " . DS . 'lib' . DS . 'Cake' . DS . "Console is in your system path,\n" . "and check the cookbook for the correct usage of this command.\n" . - "(http://book.cakephp.org/)"; + "(https://book.cakephp.org/)"; throw new CakeException($message); } @@ -129,15 +129,22 @@ class ShellDispatcher { define('APP', $this->params['working'] . DS); } if (!defined('WWW_ROOT')) { - define('WWW_ROOT', APP . $this->params['webroot'] . DS); + if (!$this->_isAbsolutePath($this->params['webroot'])) { + $webroot = realpath(APP . $this->params['webroot']); + } else { + $webroot = $this->params['webroot']; + } + define('WWW_ROOT', $webroot . DS); } if (!defined('TMP') && !is_dir(APP . 'tmp')) { define('TMP', CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'tmp' . DS); } + + // $boot is used by Cake/bootstrap.php file $boot = file_exists(ROOT . DS . APP_DIR . DS . 'Config' . DS . 'bootstrap.php'); require CORE_PATH . 'Cake' . DS . 'bootstrap.php'; - if (!file_exists(APP . 'Config' . DS . 'core.php')) { + if (!file_exists(CONFIG . 'core.php')) { include_once CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'Config' . DS . 'core.php'; App::build(); } @@ -305,25 +312,45 @@ class ShellDispatcher { } } - if ($params['app'][0] === '/' || preg_match('/([a-z])(:)/i', $params['app'], $matches)) { + if ($this->_isAbsolutePath($params['app'])) { $params['root'] = dirname($params['app']); } elseif (strpos($params['app'], '/')) { $params['root'] .= '/' . dirname($params['app']); } - + $isWindowsAppPath = $this->_isWindowsPath($params['app']); $params['app'] = basename($params['app']); $params['working'] = rtrim($params['root'], '/'); if (!$isWin || !preg_match('/^[A-Z]:$/i', $params['app'])) { $params['working'] .= '/' . $params['app']; } - if (!empty($matches[0]) || !empty($isWin)) { + if ($isWindowsAppPath || !empty($isWin)) { $params = str_replace('/', '\\', $params); } $this->params = $params + $this->params; } +/** + * Checks whether the given path is absolute or relative. + * + * @param string $path absolute or relative path. + * @return bool + */ + protected function _isAbsolutePath($path) { + return $path[0] === '/' || $this->_isWindowsPath($path); + } + +/** + * Checks whether the given path is Window OS path. + * + * @param string $path absolute path. + * @return bool + */ + protected function _isWindowsPath($path) { + return preg_match('/([a-z])(:)/i', $path) == 1; + } + /** * Parses out the paths from from the argv * @@ -332,7 +359,7 @@ class ShellDispatcher { */ protected function _parsePaths($args) { $parsed = array(); - $keys = array('-working', '--working', '-app', '--app', '-root', '--root'); + $keys = array('-working', '--working', '-app', '--app', '-root', '--root', '-webroot', '--webroot'); $args = (array)$args; foreach ($keys as $key) { while (($index = array_search($key, $args)) !== false) { diff --git a/web/api/lib/Cake/Console/TaskCollection.php b/web/api/lib/Cake/Console/TaskCollection.php index 3fafddd13..5d2e7a7a9 100644 --- a/web/api/lib/Cake/Console/TaskCollection.php +++ b/web/api/lib/Cake/Console/TaskCollection.php @@ -3,17 +3,17 @@ * Task collection is used as a registry for loaded tasks and handles loading * and constructing task class objects. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('ObjectCollection', 'Utility'); @@ -64,7 +64,7 @@ class TaskCollection extends ObjectCollection { * * @param string $task Task name to load * @param array $settings Settings for the task. - * @return Task A task object, Either the existing loaded task or a new one. + * @return AppShell A task object, Either the existing loaded task or a new one. * @throws MissingTaskException when the task could not be found */ public function load($task, $settings = array()) { diff --git a/web/api/lib/Cake/Console/Templates/default/actions/controller_actions.ctp b/web/api/lib/Cake/Console/Templates/default/actions/controller_actions.ctp index dfc309215..8a943b9e7 100644 --- a/web/api/lib/Cake/Console/Templates/default/actions/controller_actions.ctp +++ b/web/api/lib/Cake/Console/Templates/default/actions/controller_actions.ctp @@ -2,18 +2,18 @@ /** * Bake Template for Controller action generation. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package Cake.Console.Templates.default.actions * @since CakePHP(tm) v 1.3 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ ?> diff --git a/web/api/lib/Cake/Console/Templates/default/classes/controller.ctp b/web/api/lib/Cake/Console/Templates/default/classes/controller.ctp index 6beb4b401..30a9846d3 100644 --- a/web/api/lib/Cake/Console/Templates/default/classes/controller.ctp +++ b/web/api/lib/Cake/Console/Templates/default/classes/controller.ctp @@ -4,18 +4,18 @@ * * Allows templating of Controllers generated from bake. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package Cake.Console.Templates.default.classes * @since CakePHP(tm) v 1.3 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ echo "
diff --git a/web/api/lib/Cake/Console/Templates/default/views/index.ctp b/web/api/lib/Cake/Console/Templates/default/views/index.ctp index cf77c0ed9..72277141f 100644 --- a/web/api/lib/Cake/Console/Templates/default/views/index.ctp +++ b/web/api/lib/Cake/Console/Templates/default/views/index.ctp @@ -1,17 +1,17 @@
diff --git a/web/api/lib/Cake/Console/Templates/default/views/view.ctp b/web/api/lib/Cake/Console/Templates/default/views/view.ctp index 3acfad8be..b229b9f11 100644 --- a/web/api/lib/Cake/Console/Templates/default/views/view.ctp +++ b/web/api/lib/Cake/Console/Templates/default/views/view.ctp @@ -1,17 +1,17 @@
diff --git a/web/api/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php b/web/api/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php index 9a4f54337..12ad8ee98 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php +++ b/web/api/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php @@ -4,7 +4,7 @@ * * Use it to configure database for ACL * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config.Schema * @since CakePHP(tm) v 0.2.9 */ diff --git a/web/api/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.sql b/web/api/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.sql index 0bf3f7687..cbb0ccece 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.sql +++ b/web/api/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.sql @@ -1,11 +1,11 @@ # $Id$ # -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) # # Licensed under The MIT License # For full copyright and license information, please see the LICENSE.txt # Redistributions of files must retain the above copyright notice. -# MIT License (http://www.opensource.org/licenses/mit-license.php) +# MIT License (https://opensource.org/licenses/mit-license.php) CREATE TABLE acos ( id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, diff --git a/web/api/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php b/web/api/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php index cd598b35e..63dc0db9f 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php +++ b/web/api/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php @@ -4,18 +4,18 @@ * * Use it to configure database for i18n * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config.Schema * @since CakePHP(tm) v 0.2.9 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/web/api/lib/Cake/Console/Templates/skel/Config/Schema/i18n.sql b/web/api/lib/Cake/Console/Templates/skel/Config/Schema/i18n.sql index 66a42bd19..a1a4e6893 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Config/Schema/i18n.sql +++ b/web/api/lib/Cake/Console/Templates/skel/Config/Schema/i18n.sql @@ -1,11 +1,11 @@ # $Id$ # -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) # # Licensed under The MIT License # For full copyright and license information, please see the LICENSE.txt # Redistributions of files must retain the above copyright notice. -# MIT License (http://www.opensource.org/licenses/mit-license.php) +# MIT License (https://opensource.org/licenses/mit-license.php) CREATE TABLE i18n ( id int(10) NOT NULL auto_increment, diff --git a/web/api/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php b/web/api/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php index bd7b1efc3..b766ebff0 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php +++ b/web/api/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php @@ -4,18 +4,18 @@ * * Use it to configure database for Sessions * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config.Schema * @since CakePHP(tm) v 0.2.9 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/web/api/lib/Cake/Console/Templates/skel/Config/Schema/sessions.sql b/web/api/lib/Cake/Console/Templates/skel/Config/Schema/sessions.sql index 76845bdc8..e19755622 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Config/Schema/sessions.sql +++ b/web/api/lib/Cake/Console/Templates/skel/Config/Schema/sessions.sql @@ -1,13 +1,13 @@ # $Id$ # -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) # 1785 E. Sahara Avenue, Suite 490-204 # Las Vegas, Nevada 89104 # # Licensed under The MIT License # For full copyright and license information, please see the LICENSE.txt # Redistributions of files must retain the above copyright notice. -# MIT License (http://www.opensource.org/licenses/mit-license.php) +# MIT License (https://opensource.org/licenses/mit-license.php) CREATE TABLE cake_sessions ( id varchar(255) NOT NULL default '', diff --git a/web/api/lib/Cake/Console/Templates/skel/Config/acl.ini.php b/web/api/lib/Cake/Console/Templates/skel/Config/acl.ini.php index 5f37e1c97..1f9315869 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Config/acl.ini.php +++ b/web/api/lib/Cake/Console/Templates/skel/Config/acl.ini.php @@ -2,7 +2,7 @@ ;/** ; * ACL Configuration ; * -; * @link http://cakephp.org CakePHP(tm) Project +; * @link https://cakephp.org CakePHP(tm) Project ; * @package app.Config ; * @since CakePHP(tm) v 0.10.0.1076 ; */ diff --git a/web/api/lib/Cake/Console/Templates/skel/Config/acl.php b/web/api/lib/Cake/Console/Templates/skel/Config/acl.php index d008979c9..2fe93fea4 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Config/acl.php +++ b/web/api/lib/Cake/Console/Templates/skel/Config/acl.php @@ -4,7 +4,7 @@ * * Use it to configure access control of your CakePHP application. * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 2.1 */ diff --git a/web/api/lib/Cake/Console/Templates/skel/Config/bootstrap.php b/web/api/lib/Cake/Console/Templates/skel/Config/bootstrap.php index 0cf81bec3..6d05aabbb 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Config/bootstrap.php +++ b/web/api/lib/Cake/Console/Templates/skel/Config/bootstrap.php @@ -8,7 +8,7 @@ * You should also use this file to include any files that provide global functions/constants * that your application uses. * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 0.10.8.2117 */ diff --git a/web/api/lib/Cake/Console/Templates/skel/Config/core.php b/web/api/lib/Cake/Console/Templates/skel/Config/core.php index 18d645a33..864777666 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Config/core.php +++ b/web/api/lib/Cake/Console/Templates/skel/Config/core.php @@ -4,7 +4,7 @@ * * Use it to configure core behavior of Cake. * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 0.2.9 */ @@ -104,7 +104,7 @@ * will override the automatic detection of full base URL and can be * useful when generating links from the CLI (e.g. sending emails) */ - //Configure::write('App.fullBaseUrl', 'http://example.com'); + //Configure::write('App.fullBaseUrl', 'https://example.com'); /** * Web path to the public images directory under webroot. @@ -273,7 +273,7 @@ * 'mask' => 0664, //[optional] * )); * - * APC (http://pecl.php.net/package/APC) + * APC (https://pecl.php.net/package/APC) * * Cache::config('default', array( * 'engine' => 'Apc', //[required] @@ -282,7 +282,7 @@ * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string * )); * - * Xcache (http://xcache.lighttpd.net/) + * Xcache (https://xcache.lighttpd.net/) * * Cache::config('default', array( * 'engine' => 'Xcache', //[required] @@ -307,7 +307,7 @@ * 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory) * )); * - * Wincache (http://php.net/wincache) + * Wincache (https://secure.php.net/wincache) * * Cache::config('default', array( * 'engine' => 'Wincache', //[required] diff --git a/web/api/lib/Cake/Console/Templates/skel/Config/database.php.default b/web/api/lib/Cake/Console/Templates/skel/Config/database.php.default index cc549a5f6..202b821e7 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Config/database.php.default +++ b/web/api/lib/Cake/Console/Templates/skel/Config/database.php.default @@ -1,6 +1,6 @@ * Array of key/value pairs, on connection it executes SET statements for each pair - * For MySQL : http://dev.mysql.com/doc/refman/5.6/en/set-statement.html - * For Postgres : http://www.postgresql.org/docs/9.2/static/sql-set.html - * For Sql Server : http://msdn.microsoft.com/en-us/library/ms190356.aspx + * For MySQL : https://dev.mysql.com/doc/refman/5.6/en/set-statement.html + * For Postgres : https://www.postgresql.org/docs/9.2/static/sql-set.html + * For Sql Server : https://msdn.microsoft.com/en-us/library/ms190356.aspx * * flags => * A key/value array of driver specific connection options. diff --git a/web/api/lib/Cake/Console/Templates/skel/Config/email.php.default b/web/api/lib/Cake/Console/Templates/skel/Config/email.php.default index 0a01e38d0..aadb515d9 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Config/email.php.default +++ b/web/api/lib/Cake/Console/Templates/skel/Config/email.php.default @@ -4,7 +4,7 @@ * * Use it to configure email transports of Cake. * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 2.0.0 */ diff --git a/web/api/lib/Cake/Console/Templates/skel/Config/routes.php b/web/api/lib/Cake/Console/Templates/skel/Config/routes.php index 2562ebed6..ac19d9f51 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Config/routes.php +++ b/web/api/lib/Cake/Console/Templates/skel/Config/routes.php @@ -6,7 +6,7 @@ * Routes are very important mechanism that allows you to freely connect * different URLs to chosen controllers and their actions (functions). * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 0.2.9 */ diff --git a/web/api/lib/Cake/Console/Templates/skel/Console/Command/AppShell.php b/web/api/lib/Cake/Console/Templates/skel/Console/Command/AppShell.php index 04a3430f0..f73c35afe 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Console/Command/AppShell.php +++ b/web/api/lib/Cake/Console/Templates/skel/Console/Command/AppShell.php @@ -2,7 +2,7 @@ /** * AppShell file * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 2.0 */ diff --git a/web/api/lib/Cake/Console/Templates/skel/Console/Command/Task/empty b/web/api/lib/Cake/Console/Templates/skel/Console/Command/Task/empty new file mode 100644 index 000000000..e69de29bb diff --git a/web/api/lib/Cake/Console/Templates/skel/Console/Templates/empty b/web/api/lib/Cake/Console/Templates/skel/Console/Templates/empty new file mode 100644 index 000000000..e69de29bb diff --git a/web/api/lib/Cake/Console/Templates/skel/Console/cake b/web/api/lib/Cake/Console/Templates/skel/Console/cake index 67454513d..fee8e35a3 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Console/cake +++ b/web/api/lib/Cake/Console/Templates/skel/Console/cake @@ -3,18 +3,18 @@ # # Bake is a shell script for running CakePHP bake script # -# CakePHP(tm) : Rapid Development Framework (http://cakephp.org) -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +# CakePHP(tm) : Rapid Development Framework (https://cakephp.org) +# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) # # Licensed under The MIT License # For full copyright and license information, please see the LICENSE.txt # Redistributions of files must retain the above copyright notice. # -# @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -# @link http://cakephp.org CakePHP(tm) Project +# @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) +# @link https://cakephp.org CakePHP(tm) Project # @package app.Console # @since CakePHP(tm) v 1.2.0.5012 -# @license http://www.opensource.org/licenses/mit-license.php MIT License +# @license https://opensource.org/licenses/mit-license.php MIT License # ################################################################################ diff --git a/web/api/lib/Cake/Console/Templates/skel/Console/cake.bat b/web/api/lib/Cake/Console/Templates/skel/Console/cake.bat index e37d4a524..722febf10 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Console/cake.bat +++ b/web/api/lib/Cake/Console/Templates/skel/Console/cake.bat @@ -1,30 +1,30 @@ -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: -:: Bake is a shell script for running CakePHP bake script -:: -:: CakePHP(tm) : Rapid Development Framework (http://cakephp.org) -:: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -:: -:: Licensed under The MIT License -:: Redistributions of files must retain the above copyright notice. -:: -:: @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -:: @link http://cakephp.org CakePHP(tm) Project -:: @package app.Console -:: @since CakePHP(tm) v 2.0 -:: -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: In order for this script to work as intended, the cake\console\ folder must be in your PATH - -@echo. -@echo off - -SET app=%0 -SET lib=%~dp0 - -php -q "%lib%cake.php" -working "%CD% " %* - -echo. - -exit /B %ERRORLEVEL% +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Bake is a shell script for running CakePHP bake script +:: +:: CakePHP(tm) : Rapid Development Framework (https://cakephp.org) +:: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) +:: +:: Licensed under The MIT License +:: Redistributions of files must retain the above copyright notice. +:: +:: @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) +:: @link https://cakephp.org CakePHP(tm) Project +:: @package app.Console +:: @since CakePHP(tm) v 2.0 +:: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +:: In order for this script to work as intended, the cake\console\ folder must be in your PATH + +@echo. +@echo off + +SET app=%0 +SET lib=%~dp0 + +php -q "%lib%cake.php" -working "%CD% " %* + +echo. + +exit /B %ERRORLEVEL% diff --git a/web/api/lib/Cake/Console/Templates/skel/Console/cake.php b/web/api/lib/Cake/Console/Templates/skel/Console/cake.php index f5b262a2a..280613a27 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Console/cake.php +++ b/web/api/lib/Cake/Console/Templates/skel/Console/cake.php @@ -3,15 +3,15 @@ /** * Command-line code generation utility to automate programmer chores. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Console * @since CakePHP(tm) v 2.0 */ diff --git a/web/api/lib/Cake/Console/Templates/skel/Controller/AppController.php b/web/api/lib/Cake/Console/Templates/skel/Controller/AppController.php index db4b9e2c3..4e927f693 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Controller/AppController.php +++ b/web/api/lib/Cake/Console/Templates/skel/Controller/AppController.php @@ -5,7 +5,7 @@ * This file is application-wide controller file. You can put all * application-wide controller-related methods here. * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Controller * @since CakePHP(tm) v 0.2.9 */ @@ -19,7 +19,7 @@ App::uses('Controller', 'Controller'); * will inherit them. * * @package app.Controller - * @link http://book.cakephp.org/2.0/en/controllers.html#the-app-controller + * @link https://book.cakephp.org/2.0/en/controllers.html#the-app-controller */ class AppController extends Controller { } diff --git a/web/api/lib/Cake/Console/Templates/skel/Controller/Component/empty b/web/api/lib/Cake/Console/Templates/skel/Controller/Component/empty new file mode 100644 index 000000000..e69de29bb diff --git a/web/api/lib/Cake/Console/Templates/skel/Controller/PagesController.php b/web/api/lib/Cake/Console/Templates/skel/Controller/PagesController.php index eb023a573..75df741de 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Controller/PagesController.php +++ b/web/api/lib/Cake/Console/Templates/skel/Controller/PagesController.php @@ -4,7 +4,7 @@ * * This file will render views from views/pages/ * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Controller * @since CakePHP(tm) v 0.2.9 */ @@ -17,7 +17,7 @@ App::uses('AppController', 'Controller'); * Override this controller by placing a copy in controllers directory of an application * * @package app.Controller - * @link http://book.cakephp.org/2.0/en/controllers/pages-controller.html + * @link https://book.cakephp.org/2.0/en/controllers/pages-controller.html */ class PagesController extends AppController { @@ -32,6 +32,7 @@ class PagesController extends AppController { * Displays a view * * @return void + * @throws ForbiddenException When a directory traversal attempt. * @throws NotFoundException When the view file could not be found * or MissingViewException in debug mode. */ @@ -42,6 +43,9 @@ class PagesController extends AppController { if (!$count) { return $this->redirect('/'); } + if (in_array('..', $path, true) || in_array('.', $path, true)) { + throw new ForbiddenException(); + } $page = $subpage = $title_for_layout = null; if (!empty($path[0])) { diff --git a/web/api/lib/Cake/Console/Templates/skel/Lib/empty b/web/api/lib/Cake/Console/Templates/skel/Lib/empty new file mode 100644 index 000000000..e69de29bb diff --git a/web/api/lib/Cake/Console/Templates/skel/Locale/eng/LC_MESSAGES/empty b/web/api/lib/Cake/Console/Templates/skel/Locale/eng/LC_MESSAGES/empty new file mode 100644 index 000000000..e69de29bb diff --git a/web/api/lib/Cake/Console/Templates/skel/Model/AppModel.php b/web/api/lib/Cake/Console/Templates/skel/Model/AppModel.php index eef715013..cc5ca8fb5 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Model/AppModel.php +++ b/web/api/lib/Cake/Console/Templates/skel/Model/AppModel.php @@ -5,7 +5,7 @@ * This file is application-wide model file. You can put all * application-wide model-related methods here. * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Model * @since CakePHP(tm) v 0.2.9 */ diff --git a/web/api/lib/Cake/Console/Templates/skel/Model/Behavior/empty b/web/api/lib/Cake/Console/Templates/skel/Model/Behavior/empty new file mode 100644 index 000000000..e69de29bb diff --git a/web/api/lib/Cake/Console/Templates/skel/Model/Datasource/empty b/web/api/lib/Cake/Console/Templates/skel/Model/Datasource/empty new file mode 100644 index 000000000..e69de29bb diff --git a/web/api/lib/Cake/Console/Templates/skel/Plugin/empty b/web/api/lib/Cake/Console/Templates/skel/Plugin/empty new file mode 100644 index 000000000..e69de29bb diff --git a/web/api/lib/Cake/Console/Templates/skel/Test/Case/AllTestsTest.php b/web/api/lib/Cake/Console/Templates/skel/Test/Case/AllTestsTest.php index 9929fa582..98b803cc1 100644 --- a/web/api/lib/Cake/Console/Templates/skel/Test/Case/AllTestsTest.php +++ b/web/api/lib/Cake/Console/Templates/skel/Test/Case/AllTestsTest.php @@ -2,18 +2,18 @@ /** * AllTests file * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Test.Case * @since CakePHP(tm) v 2.5 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ class AllTestsTest extends CakeTestSuite { diff --git a/web/api/lib/Cake/Console/Templates/skel/Test/Case/Controller/Component/empty b/web/api/lib/Cake/Console/Templates/skel/Test/Case/Controller/Component/empty new file mode 100644 index 000000000..e69de29bb diff --git a/web/api/lib/Cake/Console/Templates/skel/Test/Case/Model/Behavior/empty b/web/api/lib/Cake/Console/Templates/skel/Test/Case/Model/Behavior/empty new file mode 100644 index 000000000..e69de29bb diff --git a/web/api/lib/Cake/Console/Templates/skel/Test/Case/View/Helper/empty b/web/api/lib/Cake/Console/Templates/skel/Test/Case/View/Helper/empty new file mode 100644 index 000000000..e69de29bb diff --git a/web/api/lib/Cake/Console/Templates/skel/Test/Fixture/empty b/web/api/lib/Cake/Console/Templates/skel/Test/Fixture/empty new file mode 100644 index 000000000..e69de29bb diff --git a/web/api/lib/Cake/Console/Templates/skel/Vendor/empty b/web/api/lib/Cake/Console/Templates/skel/Vendor/empty new file mode 100644 index 000000000..e69de29bb diff --git a/web/api/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp b/web/api/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp index a1333dc19..f4dd9e6ae 100644 --- a/web/api/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp +++ b/web/api/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp @@ -1,17 +1,17 @@ \ No newline at end of file diff --git a/web/api/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp b/web/api/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp index 6c84d88fa..ff6730d08 100644 --- a/web/api/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp +++ b/web/api/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp @@ -1,6 +1,6 @@ fetch('content'); ?> -

This email was sent using the CakePHP Framework

+

This email was sent using the CakePHP Framework

\ No newline at end of file diff --git a/web/api/lib/Cake/Console/Templates/skel/View/Layouts/Emails/text/default.ctp b/web/api/lib/Cake/Console/Templates/skel/View/Layouts/Emails/text/default.ctp index 539615895..82a1e195b 100644 --- a/web/api/lib/Cake/Console/Templates/skel/View/Layouts/Emails/text/default.ctp +++ b/web/api/lib/Cake/Console/Templates/skel/View/Layouts/Emails/text/default.ctp @@ -1,19 +1,19 @@ fetch('content'); ?> -This email was sent using the CakePHP Framework, http://cakephp.org. +This email was sent using the CakePHP Framework, https://cakephp.org. diff --git a/web/api/lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp b/web/api/lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp index f2338e66e..950d4d9e7 100644 --- a/web/api/lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp +++ b/web/api/lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp @@ -1,6 +1,6 @@
@@ -39,7 +39,7 @@ $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework