This seems to be safe to do, since libuv handles tcp write in
a very similar way.
if (!req || !pkt || !handle || !handle->data || stream_id < 0)
return kr_error(EINVAL);
+ req->handle = (uv_stream_t *)handle;
session = handle->data;
if (session_flags(session)->outgoing)
if (!ctx || !ctx->h2)
return kr_error(EINVAL);
- req->handle = (uv_stream_t *)handle; // TODO does this have side effects when write fails?
ret = http_write_pkt(ctx->h2, pkt, stream_id, req, on_write);
if (ret < 0)
return ret;