mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-16 10:39:49 +00:00
Give more time for unit test to detect conn refused on windows
This commit is contained in:
1 parent
543b4a132b
commit
2c01893bb1
3 files changed
+6
-3
No files matched your search
+2
-1
@@ -4214,7 +4214,8 @@ void mg_connect_resolved(struct mg_connection *c) {
|
||||
if ((rc = connect(FD(c), &usa.sa, slen)) == 0) {
|
||||
mg_call(c, MG_EV_CONNECT, NULL);
|
||||
} else if (mg_sock_would_block()) {
|
||||
MG_DEBUG(("%lu %p -> %x:%hu pend", c->id, c->fd, c->rem.ip, c->rem.port));
|
||||
MG_DEBUG(("%lu %p -> %x:%hu pend", c->id, c->fd, mg_ntohl(c->rem.ip),
|
||||
mg_ntohs(c->rem.port)));
|
||||
c->is_connecting = 1;
|
||||
} else {
|
||||
mg_error(c, "connect: %d", MG_SOCK_ERRNO);
|
||||
|
||||
+2
-1
@@ -369,7 +369,8 @@ void mg_connect_resolved(struct mg_connection *c) {
|
||||
if ((rc = connect(FD(c), &usa.sa, slen)) == 0) {
|
||||
mg_call(c, MG_EV_CONNECT, NULL);
|
||||
} else if (mg_sock_would_block()) {
|
||||
MG_DEBUG(("%lu %p -> %x:%hu pend", c->id, c->fd, c->rem.ip, c->rem.port));
|
||||
MG_DEBUG(("%lu %p -> %x:%hu pend", c->id, c->fd, mg_ntohl(c->rem.ip),
|
||||
mg_ntohs(c->rem.port)));
|
||||
c->is_connecting = 1;
|
||||
} else {
|
||||
mg_error(c, "connect: %d", MG_SOCK_ERRNO);
|
||||
|
||||
+2
-1
@@ -739,7 +739,8 @@ static void test_http_server(void) {
|
||||
// Test connection refused
|
||||
int i, errored = 0;
|
||||
mg_connect(&mgr, "tcp://127.0.0.1:55117", eh9, &errored);
|
||||
for (i = 0; i < 10 && errored == 0; i++) mg_mgr_poll(&mgr, 1);
|
||||
// Give it a couple of seconds, see #1605
|
||||
for (i = 0; i < 200 && errored == 0; i++) mg_mgr_poll(&mgr, 10);
|
||||
MG_INFO(("errored: %d, expected: 7", errored));
|
||||
ASSERT(errored == 7);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user