mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 15:53:55 +00:00
Fixed uncaught exception that can happen if you pause a stream with no upstream piped object.
This commit is contained in:
@@ -3740,11 +3740,14 @@ void ILibDuktape_httpStream_webSocket_EncodedPauseSink_Chain(void *chain, void *
|
|||||||
ILibDuktape_WebSocket_State *state = (ILibDuktape_WebSocket_State*)user;
|
ILibDuktape_WebSocket_State *state = (ILibDuktape_WebSocket_State*)user;
|
||||||
duk_context *ctx = state->decodedStream->writableStream->ctx;
|
duk_context *ctx = state->decodedStream->writableStream->ctx;
|
||||||
|
|
||||||
duk_push_heapptr(ctx, state->decodedStream->writableStream->pipedReadable); // [readable]
|
if (state->decodedStream->writableStream->pipedReadable != NULL)
|
||||||
duk_get_prop_string(ctx, -1, "pause"); // [readable][pause]
|
{
|
||||||
duk_swap_top(ctx, -2); // [pause][this]
|
duk_push_heapptr(ctx, state->decodedStream->writableStream->pipedReadable); // [readable]
|
||||||
if (duk_pcall_method(ctx, 0) != 0) { ILibDuktape_Process_UncaughtExceptionEx(ctx, "http.webSocketStream.Encoded_Pause(): Error pausing upstream "); }
|
duk_get_prop_string(ctx, -1, "pause"); // [readable][pause]
|
||||||
duk_pop(ctx); // ...
|
duk_swap_top(ctx, -2); // [pause][this]
|
||||||
|
if (duk_pcall_method(ctx, 0) != 0) { ILibDuktape_Process_UncaughtExceptionEx(ctx, "http.webSocketStream.Encoded_Pause(): Error pausing upstream "); }
|
||||||
|
duk_pop(ctx); // ...
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void ILibDuktape_httpStream_webSocket_EncodedPauseSink(ILibDuktape_DuplexStream *sender, void *user)
|
void ILibDuktape_httpStream_webSocket_EncodedPauseSink(ILibDuktape_DuplexStream *sender, void *user)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user