Skip to content

Commit a82d736

Browse files
committed
CHANGE: not throwing an error when attempting to read the DNS of a non-existent host
resolves: Oldes/Rebol-issues#2498
1 parent 7bb6e7b commit a82d736

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/core/p-dns.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@
110110
if (!sock->net.host_info || !GET_FLAG(sock->flags, RRF_DONE)) return R_NONE;
111111
if (sock->error) {
112112
OS_DO_DEVICE(sock, RDC_CLOSE);
113-
Trap_Port(RE_READ_ERROR, port, sock->error);
113+
return R_NONE;
114+
//Trap_Port(RE_READ_ERROR, port, sock->error);
114115
}
115116
if (GET_FLAG(sock->modes, RST_REVERSE)) {
116117
Set_String(D_RET, Copy_Bytes(sock->data, LEN_BYTES(sock->data)));

src/tests/units/port-test.r3

+4
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,10 @@ if all [
698698
--test-- "query dns://"
699699
;@@ https://github.com/Oldes/rebol-issues/issues/1826
700700
--assert all [error? e: try [query dns://] e/id = 'no-port-action]
701+
702+
--test-- "read dns://not-exists"
703+
;@@ https://github.com/Oldes/Rebol-issues/issues/2498
704+
--assert none? try [read dns://not-exists]
701705
===end-group===
702706

703707

0 commit comments

Comments
 (0)