From ef28dfd776cea9eef93e0a83efe20c57c19399e1 Mon Sep 17 00:00:00 2001 From: chenyong <1521761801@qq.com> Date: Tue, 6 Mar 2018 17:44:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webclient.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/webclient.c b/webclient.c index 6cc2b97..f2861e1 100644 --- a/webclient.c +++ b/webclient.c @@ -599,9 +599,9 @@ int webclient_connect(struct webclient_session *session, const char *URI) /* initialize the socket of session */ session->socket = -1; - - timeout.tv_sec = WEBCLIENT_SOCKET_TIMEO; - timeout.tv_usec = 0; + + timeout.tv_sec = WEBCLIENT_SOCKET_TIMEO; + timeout.tv_usec = 0; #ifdef WEBCLIENT_USING_TLS if(strncmp(URI, "https://", 8) == 0) @@ -645,11 +645,11 @@ int webclient_connect(struct webclient_session *session, const char *URI) } if((tls_ret = mbedtls_client_connect(session->tls_session)) < 0) - { - rt_kprintf("webclient mbedtls_client_connect err return : -0x%x\n", -tls_ret); + { + rt_kprintf("webclient mbedtls_client_connect err return : -0x%x\n", -tls_ret); rc = -WEBCLIENT_CONNECT_FAILED; goto _exit; - } + } socket_handle = session->tls_session->server_fd.fd; @@ -703,7 +703,7 @@ _exit: int webclient_open_tls(struct webclient_session * session, const char *URI) { int tls_ret = 0; - const char *pers = "wenclient"; + const char *pers = "webclient"; if(!session) return -RT_ERROR; @@ -820,11 +820,8 @@ struct webclient_session *webclient_open_position(const char *URI, int position) webclient_close(session); session = webclient_open_position(location, position); - if (range_header) - web_free(range_header); - - if(location) - web_free(location); + web_free(range_header); + web_free(location); return session; }