From 6a5866aa55c425da323c4a214860a71a009c6fe4 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Tue, 9 Jun 2015 09:03:56 +1000 Subject: [PATCH] http examples: don't write NULs to sockets Thanks @pfalcon for the heads-up. --- examples/http_get/main.c | 2 +- examples/http_get_ssl/main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/http_get/main.c b/examples/http_get/main.c index 6d13622..2e68901 100644 --- a/examples/http_get/main.c +++ b/examples/http_get/main.c @@ -78,7 +78,7 @@ void http_get_task(void *pvParameters) "GET "WEB_URL"\r\n" "User-Agent: esp-open-rtos/0.1 esp8266\r\n" "\r\n"; - if (write(s, req, strlen(req) + 1) < 0) { + if (write(s, req, strlen(req)) < 0) { printf("... socket send failed\r\n"); close(s); vTaskDelay(4000 / portTICK_RATE_MS); diff --git a/examples/http_get_ssl/main.c b/examples/http_get_ssl/main.c index aaac5b5..7dfbc97 100644 --- a/examples/http_get_ssl/main.c +++ b/examples/http_get_ssl/main.c @@ -119,7 +119,7 @@ void http_get_task(void *pvParameters) "GET "WEB_URL"\r\n" "User-Agent: esp-open-rtos/0.1 esp8266\r\n" "\r\n"; - if (ssl_write(ssl, (uint8_t *)req, strlen(req) + 1) < 0) { + if (ssl_write(ssl, (uint8_t *)req, strlen(req)) < 0) { printf("... socket send failed\r\n"); ssl_free(ssl); close(s);