src/irc_conn.c
changeset 32 ae66e9ae4afb
parent 29 3f0f2898fea3
child 33 e5139b339b18
equal deleted inserted replaced
31:98ea2bd59195 32:ae66e9ae4afb
    78             }
    78             }
    79         }
    79         }
    80     }
    80     }
    81 }
    81 }
    82 
    82 
       
    83 static struct line_proto_callbacks _lp_callbacks = {
       
    84     .on_line        = &irc_conn_on_line,
       
    85 };
       
    86 
    83 err_t irc_conn_create (struct irc_conn **conn_ptr, struct sock_stream *sock, const struct irc_conn_callbacks *callbacks, 
    87 err_t irc_conn_create (struct irc_conn **conn_ptr, struct sock_stream *sock, const struct irc_conn_callbacks *callbacks, 
    84         void *cb_arg, struct error_info *err)
    88         void *cb_arg, struct error_info *err)
    85 {
    89 {
    86     struct irc_conn *conn;
    90     struct irc_conn *conn;
    87 
    91 
    99     // add the core handlers 
   103     // add the core handlers 
   100     if ((ERROR_CODE(err) = irc_conn_register_handler_chain(conn, _cmd_handlers, NULL)))
   104     if ((ERROR_CODE(err) = irc_conn_register_handler_chain(conn, _cmd_handlers, NULL)))
   101         goto error;
   105         goto error;
   102 
   106 
   103     // create the line_proto, with our on_line handler
   107     // create the line_proto, with our on_line handler
   104     if (line_proto_create(&conn->lp, sock, IRC_LINE_MAX * 1.5, &irc_conn_on_line, conn, err))
   108     if (line_proto_create(&conn->lp, sock, IRC_LINE_MAX * 1.5, &_lp_callbacks, conn, err))
   105         goto error;
   109         goto error;
   106 
   110 
   107     // ok
   111     // ok
   108     *conn_ptr = conn;
   112     *conn_ptr = conn;
   109 
   113