From 3b2a5d1a1f28035baacc7f0fc9387f2a97b5f7cd Mon Sep 17 00:00:00 2001 From: Max Lv Date: Tue, 31 Jan 2017 18:41:57 +0800 Subject: [PATCH] Fix SNI parser --- .travis.yml | 2 +- src/local.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 13c0eb1f..54e5b7d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ before_install: - popd - wget https://tls.mbed.org/download/mbedtls-2.4.0-gpl.tgz - tar xvf mbedtls-2.4.0-gpl.tgz - - pushd mbedtls-2.4.0-gpl + - pushd mbedtls-2.4.0 - make - sudo make install - popd diff --git a/src/local.c b/src/local.c index 4299e083..37e9d551 100644 --- a/src/local.c +++ b/src/local.c @@ -532,6 +532,8 @@ server_recv_cb(EV_P_ ev_io *w, int revents) char host[257], ip[INET6_ADDRSTRLEN], port[16]; buffer_t *abuf = server->abuf; + abuf->idx = 0; + abuf->len = 0; abuf->data[abuf->len++] = request->atyp; int atyp = request->atyp;