mirror of
https://github.com/janet-lang/janet
synced 2024-12-23 15:00:27 +00:00
Fix #1342
This commit is contained in:
parent
9eeefbd79a
commit
be11a2a1ad
@ -821,6 +821,7 @@ JANET_CORE_FN(cfun_stream_accept_loop,
|
||||
JanetStream *stream = janet_getabstract(argv, 0, &janet_stream_type);
|
||||
janet_stream_flags(stream, JANET_STREAM_ACCEPTABLE | JANET_STREAM_SOCKET);
|
||||
JanetFunction *fun = janet_getfunction(argv, 1);
|
||||
if (fun->def->min_arity < 1) janet_panic("handler function must take at least 1 argument");
|
||||
janet_sched_accept(stream, fun);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user