Skip to content
Snippets Groups Projects
Commit 5f22e3f4 authored by Niels Möller's avatar Niels Möller
Browse files

Changed write_callback handling

Rev: lib/modules/SSL.pmod/https.pike:1.5
parent b1b57ae6
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,7 @@ class conn { ...@@ -40,7 +40,7 @@ class conn {
"<hr><it>/nisse</it></body></html>\n"; "<hr><it>/nisse</it></body></html>\n";
int index = 0; int index = 0;
void do_write() void write_callback()
{ {
if (index < strlen(message)) if (index < strlen(message))
{ {
...@@ -57,20 +57,15 @@ class conn { ...@@ -57,20 +57,15 @@ class conn {
void read_callback(mixed id, string data) void read_callback(mixed id, string data)
{ {
#ifdef SSL3_DEBUG #ifdef SSL3_DEBUG
werror("Recieved: '" + data + "'\n"); werror("Received: '" + data + "'\n");
#endif #endif
do_write(); sslfile->set_write_callback(write_callback);
}
void write_callback(mixed id)
{
do_write();
} }
void create(object f) void create(object f)
{ {
sslfile = f; sslfile = f;
sslfile->set_nonblocking(read_callback, write_callback, 0); sslfile->set_nonblocking(read_callback, 0, 0);
} }
} }
...@@ -161,7 +156,7 @@ Version ::= INTEGER ...@@ -161,7 +156,7 @@ Version ::= INTEGER
void my_accept_callback(object f) void my_accept_callback(object f)
{ {
werror("Accept!\n"); werror("Accept!\n");
conn(f->accept()); conn(accept());
} }
int main() int main()
...@@ -203,6 +198,6 @@ void create() ...@@ -203,6 +198,6 @@ void create()
{ {
#ifdef SSL3_DEBUG #ifdef SSL3_DEBUG
werror("https->create\n"); werror("https->create\n");
#ifdef SSL3_DEBUG #endif
sslport::create(); sslport::create();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment