pike.git / lib / modules / SSL.pmod / https.pike

version» Context lines:

pike.git/lib/modules/SSL.pmod/https.pike:113:       SSL.File ssl;    int sent;       void write_cb()    {    int bytes = ssl->write(request[sent..]);    if (bytes > 0) {    sent += bytes;    } else if (sent < 0) { -  exit(17, "Failed to write data: %s\n", strerror(ssl->errno())); +  exit(1, "Failed to write data: %s\n", strerror(ssl->errno()));    }    if (sent == sizeof(request)) {    ssl->set_write_callback(UNDEFINED);    }    }       void got_data(mixed ignored, string data)    {    werror("Data: %O\n", data);    }
pike.git/lib/modules/SSL.pmod/https.pike:157:    "commonName" : common_name,    ]);    string cert = Standards.X509.make_selfsigned_certificate(key, 3600*24, attrs, 0, hash);    ctx->add_cert(key, ({ cert }), ({ "*" }));   }      int main()   {   #ifdef HTTPS_CLIENT    Stdio.File con = Stdio.File(); -  if (!con->connect(HOST, PORT)) { -  werror("Failed to connect to server: %s\n", strerror(con->errno())); -  return 17; -  } +  if (!con->connect(HOST, PORT)) +  exit(1, "Failed to connect to server: %s\n", strerror(con->errno())); +     Client(con); -  return -17; +  return -1;   #else    SSL.Context ctx = MyContext();       Crypto.Sign key;       common_name = gethostname();    common_name = (gethostbyname(common_name) || ({ common_name }))[0];    werror("Common name: %O\n", common_name);       werror("Generating RSA certificate (%d bits)...\n", RSA_BITS);
pike.git/lib/modules/SSL.pmod/https.pike:217:    ctx->preferred_suites = ctx->get_suites(CIPHER_BITS, KE_MODE);    SSL3_DEBUG_MSG("Cipher suites:\n%s",    .Constants.fmt_cipher_suites(ctx->preferred_suites));       SSL3_DEBUG_MSG("Certs:\n%O\n", ctx->get_certificates());       port = SSL.Port(ctx);       werror("Starting\n");    if (!port->bind(PORT, my_accept_callback)) -  { -  Stdio.perror(""); -  return 17; -  } -  else { +  exit(1, "Failed to bind port %d.\n", PORT); +     werror("Listening on port %d.\n", PORT); -  return -17; -  } +  return -1;   #endif   }