pike.git / src / modules / _Stdio / async_tls_close_test.pike

version» Context lines:

pike.git/src/modules/_Stdio/async_tls_close_test.pike:1:   // This test belongs in SSL.pmod, but it's here because there's   // currently no way to filter out test pike files from pmod dirs.      int main (int argc, array(string) argv)   {    string fail;    +  if (argc < 3) { +  werror("Expected at least two arguments.\n"); +  exit(1); +  } +     int clean_close = argv[1] == "1";    int block = argv[2] == "1";       Pike.Backend blocked_backend = Pike.Backend();    Stdio.Port blocked_server = Stdio.Port();    blocked_server->set_backend (blocked_backend);    blocked_server->bind (36565, lambda () {    fail = "Should never accept a connection.\n";    });       Stdio.File con = Stdio.File();    SSL.sslfile tlscon;    con->async_connect (    "127.0.0.1", 36565,    lambda (int success) {    if (success) {    tlscon = SSL.sslfile (con, SSL.Context()); -  +  tlscon->connect("localhost");    tlscon->set_write_callback (lambda () {    fail = "Handshake should not succeed.\n";    });    }    else    fail = "Failed to connect.";    });       call_out (    lambda () {