mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 20:41:14 +00:00
httpd_resp_send: use HTTPD_RESP_USE_STRLEN
when possible
This commit is contained in:

committed by
bot

parent
f29370b02c
commit
6673407f98
@@ -30,7 +30,7 @@ static const char *TAG = "example";
|
||||
static esp_err_t root_get_handler(httpd_req_t *req)
|
||||
{
|
||||
httpd_resp_set_type(req, "text/html");
|
||||
httpd_resp_send(req, "<h1>Hello Secure World!</h1>", -1); // -1 = use strlen()
|
||||
httpd_resp_send(req, "<h1>Hello Secure World!</h1>", HTTPD_RESP_USE_STRLEN);
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
@@ -79,7 +79,7 @@ static void stop_webserver(httpd_handle_t server)
|
||||
httpd_ssl_stop(server);
|
||||
}
|
||||
|
||||
static void disconnect_handler(void* arg, esp_event_base_t event_base,
|
||||
static void disconnect_handler(void* arg, esp_event_base_t event_base,
|
||||
int32_t event_id, void* event_data)
|
||||
{
|
||||
httpd_handle_t* server = (httpd_handle_t*) arg;
|
||||
@@ -89,7 +89,7 @@ static void disconnect_handler(void* arg, esp_event_base_t event_base,
|
||||
}
|
||||
}
|
||||
|
||||
static void connect_handler(void* arg, esp_event_base_t event_base,
|
||||
static void connect_handler(void* arg, esp_event_base_t event_base,
|
||||
int32_t event_id, void* event_data)
|
||||
{
|
||||
httpd_handle_t* server = (httpd_handle_t*) arg;
|
||||
|
Reference in New Issue
Block a user