Skip to content

Commit

Permalink
fix(fetch) fix lifecycle of SSL Proxy, fix lifecycle of tls_props, fi…
Browse files Browse the repository at this point in the history
…x handling chunked encoded redirects when proxing. (#13752)
  • Loading branch information
cirospaciari authored Sep 6, 2024
1 parent 6010c33 commit d8e2c24
Show file tree
Hide file tree
Showing 3 changed files with 339 additions and 184 deletions.
6 changes: 3 additions & 3 deletions src/bun.js/api/bun/ssl_wrapper.zig
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,16 @@ pub fn SSLWrapper(comptime T: type) type {

// we sent the shutdown
this.flags.sent_ssl_shutdown = ret >= 0;
defer if (ret < 0) {
if (ret < 0) {
const err = BoringSSL.SSL_get_error(ssl, ret);
BoringSSL.ERR_clear_error();

if (err == BoringSSL.SSL_ERROR_SSL or err == BoringSSL.SSL_ERROR_SYSCALL) {
this.flags.fatal_error = true;
this.triggerCloseCallback();
return false;
}
};
}
return ret == 1; // truly closed
}

Expand Down Expand Up @@ -424,7 +425,6 @@ pub fn SSLWrapper(comptime T: type) type {
if (read > 0) {
this.triggerDataCallback(buffer[0..read]);
}

this.triggerCloseCallback();
return false;
} else {
Expand Down
Loading

0 comments on commit d8e2c24

Please sign in to comment.