Index: tests/standalone/io/https_server_test.dart |
diff --git a/tests/standalone/io/https_server_test.dart b/tests/standalone/io/https_server_test.dart |
index 082950e70eda04012c8ca533ac471788840e3972..fca7ab46868af14b6656cef999cd4d445e7a1b6c 100644 |
--- a/tests/standalone/io/https_server_test.dart |
+++ b/tests/standalone/io/https_server_test.dart |
@@ -63,7 +63,39 @@ void InitializeSSL() { |
password: 'dartdart'); |
} |
+void testEarlyClientClose() { |
+ HttpServer.bindSecure(HOST_NAME, |
+ 0, |
+ certificateName: 'localhost_cert').then((server) { |
+ server.listen( |
+ (request) { |
+ String name = Platform.script.toFilePath(); |
+ new File(name).openRead().pipe(request.response) |
+ .catchError((e) { /* ignore */ }); |
+ }); |
+ |
+ var count = 0; |
+ makeRequest() { |
+ Socket.connect("127.0.0.1", server.port).then((socket) { |
+ var data = "Invalid TLS handshake"; |
+ socket.write(data); |
+ socket.close(); |
+ socket.done.then((_) { |
+ socket.destroy(); |
+ if (++count < 10) { |
+ makeRequest(); |
+ } else { |
+ server.close(); |
+ } |
+ }); |
+ }); |
+ } |
+ makeRequest(); |
+ }); |
+} |
+ |
void main() { |
InitializeSSL(); |
testListenOn(); |
+ testEarlyClientClose(); |
} |