mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-13 06:29:11 +00:00
redbean: return early from LuaWSWrite if upgrade fails
This commit is contained in:
parent
4a10293f84
commit
a0429ccf05
1 changed files with 5 additions and 2 deletions
|
@ -5342,13 +5342,16 @@ close:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int LuaWSWrite(lua_State *L) {
|
static int LuaWSWrite(lua_State *L) {
|
||||||
int type;
|
int type, retval;
|
||||||
size_t size;
|
size_t size;
|
||||||
const char *data;
|
const char *data;
|
||||||
|
|
||||||
OnlyCallDuringRequest(L, "ws.Write");
|
OnlyCallDuringRequest(L, "ws.Write");
|
||||||
if (!cpm.wstype) {
|
if (!cpm.wstype) {
|
||||||
LuaWSUpgrade(L);
|
retval = LuaWSUpgrade(L);
|
||||||
|
if (retval != 0) {
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type = luaL_optinteger(L, 2, -1);
|
type = luaL_optinteger(L, 2, -1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue