pike.git
/
lib
/
modules
/
SSL.pmod
/
https.pike
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/SSL.pmod/https.pike:43:
SSL.Constants.fmt_version(version), level, description, message); } return ::alert_factory(con, level, description, version, message); } } #ifndef HTTPS_CLIENT SSL.Port port;
-
void my_accept_callback(
object
f)
+
void my_accept_callback(
SSL.File
f)
{ Conn(port->accept()); } #endif
-
class Conn
{
-
-
object
sslfile
;
-
+
class Conn
(SSL.File
sslfile
)
+
{
string message = "HTTP/1.0 200 Ok\r\n" "Connection: close\r\n" "Content-Length: 132\r\n" "Content-Type: text/html; charset=ISO-8859-1\r\n" "Date: Thu, 01 Jan 1970 00:00:01 GMT\r\n" "Server: Bare-Bones\r\n" "\r\n" "<html><head><title>SSL-3 server</title></head>\n" "<body><h1>This is a minimal SSL-3 http server</h1>\n"
pike.git/lib/modules/SSL.pmod/https.pike:86:
if (index == sizeof(message)) sslfile->close(); } void read_callback(mixed id, string data) { SSL3_DEBUG_MSG("Received: '" + data + "'\n"); sslfile->set_write_callback(write_callback); }
-
protected void create(
object f
)
+
protected void create()
{
-
sslfile = f;
+
sslfile->set_nonblocking(read_callback, 0, 0); } } class Client { constant request = "HEAD / HTTP/1.0\r\n" "Host: " HOST ":" + PORT + "\r\n" "\r\n";