Skip to content

Commit f6c6763

Browse files
committed
more
1 parent c537d98 commit f6c6763

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/bun-uws/src/HttpContext.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,14 @@ struct HttpContext {
314314
us_socket_close(SSL, s, 0, nullptr);
315315
}
316316

317+
auto returnedData = result.returnedData;
317318
/* We need to uncork in all cases, except for nullptr (closed socket, or upgraded socket) */
318-
if (result.returnedData != nullptr) {
319+
if (returnedData != nullptr) {
319320
/* We don't want open sockets to keep the event loop alive between HTTP requests */
320-
us_socket_unref((us_socket_t *) result.returnedData);
321+
us_socket_unref((us_socket_t *) returnedData);
321322

322323
/* Timeout on uncork failure */
323-
auto [written, failed] = ((AsyncSocket<SSL> *) result.returnedData)->uncork();
324+
auto [written, failed] = ((AsyncSocket<SSL> *) returnedData)->uncork();
324325
if (written > 0 || failed) {
325326
/* All Http sockets timeout by this, and this behavior match the one in HttpResponse::cork */
326327
((HttpResponse<SSL> *) s)->resetTimeout();
@@ -337,7 +338,7 @@ struct HttpContext {
337338
}
338339
}
339340
}
340-
return (us_socket_t *) result.returnedData;
341+
return (us_socket_t *) returnedData;
341342
}
342343

343344
/* If we upgraded, check here (differ between nullptr close and nullptr upgrade) */

0 commit comments

Comments
 (0)