Skip to content

Commit 8ea1b17

Browse files
committed
FIX: PORT! state binary appears empty when it is not
fixes: metaeducation/rebol-issues#2314 I believe that the size setting was commented out to hide the state, so I added series protection so it cannot be modified from Rebol layer
1 parent 5c5241c commit 8ea1b17

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/c-port.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@
101101
REBREQ *req = (REBREQ*)STR_HEAD(data);
102102
req->clen = size;
103103
CLEAR(STR_HEAD(data), size);
104-
//data->tail = size; // makes it easier for ACCEPT to clone the port
104+
data->tail = size; // makes it easier for ACCEPT to clone the port
105105
SET_FLAG(req->flags, RRF_ALLOC); // not on stack
106106
req->port = port;
107107
req->device = device;
108108
Set_Binary(state, data);
109+
PROTECT_SERIES(data); // protect state from modification...
110+
LOCK_SERIES(data); // ... permanently
109111
}
110112

111113
return (void *)VAL_BIN(state);

0 commit comments

Comments
 (0)