net.mbedtls: have shutdown close accepted connections too (#19164)

This commit is contained in:
James Kirkwood 2023-08-31 04:22:42 +09:30 committed by GitHub
parent d503435dd4
commit 7927583de9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,7 +180,6 @@ pub fn (mut l SSLListener) accept() !&SSLConn {
mut conn := &SSLConn{
config: l.config
opened: true
owns_socket: false
}
// TODO: save the client's IP address somewhere (maybe add a field to SSLConn ?)
@ -189,6 +188,8 @@ pub fn (mut l SSLListener) accept() !&SSLConn {
if ret != 0 {
return error_with_code("can't accept connection", ret)
}
conn.handle = conn.server_fd.fd
conn.owns_socket = true
C.mbedtls_ssl_init(&conn.ssl)
C.mbedtls_ssl_config_init(&conn.conf)