Fossil SCM

Fix the socket_open() routine so that it returns a non-zero error code if it fails to connect.

drh 2015-02-08 22:26 trunk
Commit aee65577cbaab3932c03cc0558331994d7211025
1 file changed +1
--- src/http_socket.c
+++ src/http_socket.c
@@ -173,10 +173,11 @@
173173
break;
174174
}
175175
if( p==0 ){
176176
socket_set_errmsg("cannot connect to host %s:%d", pUrlData->name,
177177
pUrlData->port);
178
+ rc = 1;
178179
}
179180
#if !defined(_WIN32)
180181
signal(SIGPIPE, SIG_IGN);
181182
#endif
182183
end_socket_open:
183184
--- src/http_socket.c
+++ src/http_socket.c
@@ -173,10 +173,11 @@
173 break;
174 }
175 if( p==0 ){
176 socket_set_errmsg("cannot connect to host %s:%d", pUrlData->name,
177 pUrlData->port);
 
178 }
179 #if !defined(_WIN32)
180 signal(SIGPIPE, SIG_IGN);
181 #endif
182 end_socket_open:
183
--- src/http_socket.c
+++ src/http_socket.c
@@ -173,10 +173,11 @@
173 break;
174 }
175 if( p==0 ){
176 socket_set_errmsg("cannot connect to host %s:%d", pUrlData->name,
177 pUrlData->port);
178 rc = 1;
179 }
180 #if !defined(_WIN32)
181 signal(SIGPIPE, SIG_IGN);
182 #endif
183 end_socket_open:
184

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button