mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
getaddrinfo with localhost does not necessarily read files
This commit is contained in:
parent
096c5fe584
commit
c923a184c6
@ -1679,6 +1679,10 @@ test_bufferevent_connect_hostname(void *arg)
|
|||||||
tt_int_op(be_outcome[2].what, ==, !emfile ? BEV_EVENT_CONNECTED : BEV_EVENT_ERROR);
|
tt_int_op(be_outcome[2].what, ==, !emfile ? BEV_EVENT_CONNECTED : BEV_EVENT_ERROR);
|
||||||
tt_int_op(be_outcome[2].dnserr, ==, 0);
|
tt_int_op(be_outcome[2].dnserr, ==, 0);
|
||||||
tt_int_op(be_outcome[3].what, ==, !emfile ? BEV_EVENT_CONNECTED : BEV_EVENT_ERROR);
|
tt_int_op(be_outcome[3].what, ==, !emfile ? BEV_EVENT_CONNECTED : BEV_EVENT_ERROR);
|
||||||
|
/*
|
||||||
|
* Some platforms check for localhost explicitly, and therefore may succeed without opening any files *
|
||||||
|
* e.g. https://github.com/openbsd/src/blob/53e0023678f73561cc0c0c07e49830be23d94673/lib/libc/asr/getaddrinfo_async.c#L234
|
||||||
|
*/
|
||||||
if (!emfile) {
|
if (!emfile) {
|
||||||
tt_int_op(be_outcome[3].dnserr, ==, 0);
|
tt_int_op(be_outcome[3].dnserr, ==, 0);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user