pike.git / lib / modules / Protocols.pmod / Line.pmod

version» Context lines:

pike.git/lib/modules/Protocols.pmod/Line.pmod:1:   /* -  * $Id: Line.pmod,v 1.6 1998/10/16 00:08:11 nisse Exp $ +  * $Id: Line.pmod,v 1.7 1998/10/16 15:34:58 grubba Exp $    *    * Line-buffered protocol handling.    *    * Henrik Grubbström 1998-05-27    */      class simple   {    static object con;   
pike.git/lib/modules/Protocols.pmod/Line.pmod:19:    static void send(string s)    {    send_q->put(s);    con->set_write_callback(write_callback);    }       static void do_timeout()    {    if (con) {    catch { +  con->set_nonblocking(0,0,0); // Make sure all callbacks are cleared. +  }; +  catch {    con->close();    };    catch {    // FIXME: Don't do this. It will break SSL connections. /nisse    destruct(con);    };    }    }       static void _timeout_cb()
pike.git/lib/modules/Protocols.pmod/Line.pmod:160:    send_q->put(0);    con->set_write_callback(write_callback);    con->set_read_callback(0);    }       static void close_callback()    {    if (handle_data || sizeof(read_buffer) || sizeof(multi_line_buffer)) {    werror("close_callback(): Unexpected close!\n");    } +  con->set_nonblocking(0,0,0); // Make sure all callbacks are cleared.    con->close();    con = 0;    }       void create(object con_, int|void timeout_)    {    con = con_;    timeout = timeout_;       // Start the timeout handler.