summaryrefslogtreecommitdiff
path: root/proxy_await.c
diff options
context:
space:
mode:
Diffstat (limited to 'proxy_await.c')
-rw-r--r--proxy_await.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/proxy_await.c b/proxy_await.c
index d60f380..8eb5aa6 100644
--- a/proxy_await.c
+++ b/proxy_await.c
@@ -49,6 +49,7 @@ int mcplib_await(lua_State *L) {
case AWAIT_ANY:
case AWAIT_OK:
case AWAIT_FIRST:
+ case AWAIT_FASTGOOD:
break;
default:
proxy_lua_error(L, "invalid type argument tp mcp.await");
@@ -286,6 +287,16 @@ int mcplib_await_return(io_pending_proxy_t *p) {
valid = false;
}
break;
+ case AWAIT_FASTGOOD:
+ if (p->client_resp->status == MCMC_OK) {
+ // End early on a hit.
+ if (p->client_resp->resp.code != MCMC_CODE_END) {
+ aw->wait_for = 0;
+ } else {
+ is_good = true;
+ }
+ }
+ break;
}
if (is_good) {