Skip to content

Commit

Permalink
Update xkcp_spy.c
Browse files Browse the repository at this point in the history
  • Loading branch information
liudf0716 authored Apr 18, 2017
1 parent 25d82c6 commit 33bf9ab
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions xkcp_spy.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,13 @@ static void readcb(struct bufferevent *bev, void *ctx)
struct event_base *base = ctx;
struct evbuffer *input = bufferevent_get_input(bev);
int len = evbuffer_get_length(input);

printf("read [%d] ================\n", len);

if (len > 0) {
char *buf = malloc(len+1);
memset(buf, 0, len+1);
evbuffer_remove(input, buf, len);
printf("%s\n", buf);
printf("%s", buf);
}

event_base_loopexit(base, NULL);
}

static void usage(const char *prog)
Expand Down

0 comments on commit 33bf9ab

Please sign in to comment.