--- a/src/line_proto.c Sat Feb 28 23:48:34 2009 +0200
+++ b/src/line_proto.c Sun Mar 01 00:34:33 2009 +0200
@@ -95,6 +95,7 @@
struct sock_stream_callbacks line_proto_sock_stream_callbacks = {
.on_read = &line_proto_on_read,
+ .on_write = &line_proto_on_write,
};
err_t line_proto_create (struct line_proto **lp_ptr, struct sock_stream *sock, size_t buf_size,
@@ -121,7 +122,7 @@
sock_stream_event_init(sock, &line_proto_sock_stream_callbacks, lp)
|| line_proto_schedule_events(lp, EV_READ)
)
- return ERROR_CODE(&lp->err);
+ JUMP_SET_ERROR_INFO(err, &lp->err);
// return
*lp_ptr = lp;
@@ -132,9 +133,13 @@
if (lp) {
free(lp->in_buf);
free(lp->out_buf);
+
+ // XXX: handle sock init errors
}
free(lp);
+
+ return ERROR_CODE(err);
}
/*