diff --git a/src/jconf.c b/src/jconf.c index 510a55c6..dbe5352e 100644 --- a/src/jconf.c +++ b/src/jconf.c @@ -55,7 +55,8 @@ void parse_addr(const char *str, addr_t *addr) pch = strchr(pch + 1, ':'); } if (n > 1) { - if (strcmp(str+ret, "]") != 0) { + if (strcmp(str+ret, "]") != 0) + { ret = -1; } } diff --git a/src/udprelay.c b/src/udprelay.c index 40a536db..9f2a26cb 100644 --- a/src/udprelay.c +++ b/src/udprelay.c @@ -279,7 +279,7 @@ struct query_ctx *new_query_ctx(asyncns_query_t *query, ctx->buf_len = buf_len; memcpy(ctx->buf, buf, buf_len); ctx->query = query; - ev_timer_init(&ctx->watcher, query_resolve_cb, 0.2, 0.5); + ev_timer_init(&ctx->watcher, query_resolve_cb, 0.1, 0.2); return ctx; } @@ -610,6 +610,7 @@ static void server_recv_cb (EV_P_ ev_io *w, int revents) memcpy(tmp + addr_header_len, buf, buf_len); free(buf); buf = tmp; + buf_len += addr_header_len; #else char host[256] = {0};