http examples: don't write NULs to sockets
Thanks @pfalcon for the heads-up.
This commit is contained in:
parent
c09167715e
commit
6a5866aa55
2 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue