equal
deleted
inserted
replaced
54 // XXX: fail |
54 // XXX: fail |
55 errx(1, "line_proto_read: %s", error_msg(&lp->err)); |
55 errx(1, "line_proto_read: %s", error_msg(&lp->err)); |
56 |
56 |
57 // got a line? |
57 // got a line? |
58 if (line) |
58 if (line) |
59 lp->cb_read(lp, line, lp->cb_arg); |
59 lp->cb_read(line, lp->cb_arg); |
60 |
60 |
61 } while (line); |
61 } while (line); |
62 |
62 |
63 // reschedule |
63 // reschedule |
64 if (line_proto_schedule_events(lp, EV_READ)) |
64 if (line_proto_schedule_events(lp, EV_READ)) |
102 lp->cb_read = cb_func; |
102 lp->cb_read = cb_func; |
103 lp->cb_arg = cb_arg; |
103 lp->cb_arg = cb_arg; |
104 |
104 |
105 // initialize event-based stuff |
105 // initialize event-based stuff |
106 sock_stream_event_init(sock, &line_proto_sock_stream_callbacks, lp); |
106 sock_stream_event_init(sock, &line_proto_sock_stream_callbacks, lp); |
|
107 line_proto_schedule_events(lp, EV_READ); |
107 |
108 |
108 // return |
109 // return |
109 *lp_ptr = lp; |
110 *lp_ptr = lp; |
110 |
111 |
111 return SUCCESS; |
112 return SUCCESS; |