--- a/src/nexus.c Sun Feb 22 08:48:21 2009 +0200
+++ b/src/nexus.c Sun Feb 22 10:16:28 2009 +0200
@@ -20,7 +20,7 @@
struct event_base *ev_base;
struct sock_stream *sock;
struct line_proto *lp;
- char line_buf[LINE_LENGTH + 1];
+ char *line;
struct error_info _err;
// initialize libevent
@@ -36,17 +36,17 @@
errx(1, "sock_gnutls_connect: %s", error_msg(&_err));
// line protocol
- if (line_proto_create(&lp, sock, &_err))
+ if (line_proto_create(&lp, sock, LINE_LENGTH, NULL, NULL, &_err))
errx(1, "line_proto_create: %s", error_msg(&_err));
// read lines and dump them out
do {
// recv
- if (line_proto_read(lp, line_buf, sizeof(line_buf)))
+ if (line_proto_read(lp, &line))
errx(1, "line_proto_read: %s", error_msg(line_proto_error(lp)));
// printf
- printf("<<< %s\n", line_buf);
+ printf("<<< %s\n", line);
} while (1);