Merge branch 'storageareas' of github.com:ConnorTechnology/ZoneMinder into storageareas

pull/2077/head
Isaac Connor 2018-02-05 15:47:05 -05:00
commit 88f8cee9f6
2 changed files with 12 additions and 15 deletions

View File

@ -121,21 +121,17 @@ void RemoteCameraHttp::Initialise()
state = HEADER;
}
int RemoteCameraHttp::Connect()
{
int RemoteCameraHttp::Connect() {
struct addrinfo *p;
for(p = hp; p != NULL; p = p->ai_next)
{
for ( p = hp; p != NULL; p = p->ai_next ) {
sd = socket( p->ai_family, p->ai_socktype, p->ai_protocol );
if ( sd < 0 )
{
if ( sd < 0 ) {
Warning("Can't create socket: %s", strerror(errno) );
continue;
}
if ( connect( sd, p->ai_addr, p->ai_addrlen ) < 0 )
{
if ( connect( sd, p->ai_addr, p->ai_addrlen ) < 0 ) {
close(sd);
sd = -1;
char buf[sizeof(struct in6_addr)];
@ -151,14 +147,14 @@ int RemoteCameraHttp::Connect()
break;
}
if(p == NULL) {
if ( p == NULL ) {
Error("Unable to connect to the remote camera, aborting");
return( -1 );
return -1;
}
Debug( 3, "Connected to host, socket = %d", sd );
return( sd );
}
Debug(3, "Connected to host, socket = %d", sd);
return sd;
} // end int RemoteCameraHttp::Connect()
int RemoteCameraHttp::Disconnect()
{
@ -1063,8 +1059,8 @@ int RemoteCameraHttp::PreCapture() {
if ( sd < 0 ) {
Connect();
if ( sd < 0 ) {
Error( "Unable to connect to camera" );
return( -1 );
Error("Unable to connect to camera");
return -1;
}
mode = SINGLE_IMAGE;
buffer.clear();

View File

@ -342,6 +342,7 @@ int main(int argc, char *argv[]) {
delete [] capture_delays;
delete [] next_delays;
delete [] last_capture_times;
sleep(10);
} // end while ! zm_terminate outer connection loop
for ( int i = 0; i < n_monitors; i++ ) {