Make failure to resolve non fatal
This commit is contained in:
parent
2640791b89
commit
7c1c8482c6
|
@ -100,7 +100,8 @@ void RemoteCamera::Initialise() {
|
||||||
|
|
||||||
int ret = getaddrinfo(host.c_str(), port.c_str(), &hints, &hp);
|
int ret = getaddrinfo(host.c_str(), port.c_str(), &hints, &hp);
|
||||||
if ( ret != 0 ) {
|
if ( ret != 0 ) {
|
||||||
Fatal( "Can't getaddrinfo(%s port %s): %s", host.c_str(), port.c_str(), gai_strerror(ret) );
|
Error( "Can't getaddrinfo(%s port %s): %s", host.c_str(), port.c_str(), gai_strerror(ret) );
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
struct addrinfo *p = nullptr;
|
struct addrinfo *p = nullptr;
|
||||||
int addr_count = 0;
|
int addr_count = 0;
|
||||||
|
|
|
@ -144,6 +144,14 @@ void RemoteCameraHttp::Initialise() {
|
||||||
int RemoteCameraHttp::Connect() {
|
int RemoteCameraHttp::Connect() {
|
||||||
struct addrinfo *p = nullptr;
|
struct addrinfo *p = nullptr;
|
||||||
|
|
||||||
|
if (!hp) {
|
||||||
|
RemoteCamera::Initialise();
|
||||||
|
if (!hp) {
|
||||||
|
Error("Unable to resolve address for remote camera, aborting");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for ( p = hp; p != nullptr; p = p->ai_next ) {
|
for ( p = hp; p != nullptr; p = p->ai_next ) {
|
||||||
sd = socket( p->ai_family, p->ai_socktype, p->ai_protocol );
|
sd = socket( p->ai_family, p->ai_socktype, p->ai_protocol );
|
||||||
if ( sd < 0 ) {
|
if ( sd < 0 ) {
|
||||||
|
|
Loading…
Reference in New Issue