Skip to content
This repository was archived by the owner on Aug 29, 2024. It is now read-only.

Commit f95e31f

Browse files
committed
Fix SSLSocket#close_write and related tests.
1 parent fe6f197 commit f95e31f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/async/io/ssl_socket.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,12 @@ def remote_address
8989
end
9090

9191
def close_write
92-
self.shutdown(Socket::SHUT_WR)
92+
# Invokes SSL_shutdown, which sends a close_notify message to the peer.
93+
@io.__send__(:stop)
9394
end
9495

9596
def close_read
96-
self.shutdown(Socket::SHUT_RD)
97+
@io.to_io.shutdown(Socket::SHUT_RD)
9798
end
9899

99100
def shutdown(how)

spec/async/io/ssl_server_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
end
7474

7575
server_task.stop
76-
end
76+
end.wait
7777
end
7878
end
7979

@@ -123,7 +123,7 @@
123123
end
124124

125125
server_task.stop
126-
end
126+
end.wait
127127
end
128128

129129
it 'it fails with invalid host' do

0 commit comments

Comments
 (0)