|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The page server's request headers, as the guard (wa_guard.h) and the access code check read them. More...
#include <stdbool.h>#include <stddef.h>#include "esp_err.h"#include "esp_http_server.h"#include "wa_guard.h"Go to the source code of this file.
Data Structures | |
| struct | wifi_req_bufs_t |
| Where wifi_req_guard() reads a request's headers into. More... | |
Functions | |
| const char * | wifi_req_hdr (httpd_req_t *r, const char *key, char *out, size_t cap) |
Header key of r into out. | |
| bool | wifi_req_guard (httpd_req_t *r, wa_req_kind_t kind, const char *name, wifi_req_bufs_t *bufs, esp_err_t *e) |
wa_guard() over r: the Host, the body's size, a write's Origin or Referer and the upload's header. | |
The page server's request headers, as the guard (wa_guard.h) and the access code check read them.
SPDX-License-Identifier: MIT
| bool wifi_req_guard | ( | httpd_req_t * | r, |
| wa_req_kind_t | kind, | ||
| const char * | name, | ||
| wifi_req_bufs_t * | bufs, | ||
| esp_err_t * | e ) |
wa_guard() over r: the Host, the body's size, a write's Origin or Referer and the upload's header.
The panel's address is the IPv4 address the connection came in on: the access point's in AP, the station's in JOIN. A refusal is answered here, with no body and the connection closed, so a body not read is never read: httpd_req_delete() would read one to its end, a receive timeout at a time.
| r | the request |
| kind | what it is |
| name | the panel's name, "rcbench-1A2B" |
| bufs | the header buffers |
| e | takes the handler's return on a refusal |
| const char * wifi_req_hdr | ( | httpd_req_t * | r, |
| const char * | key, | ||
| char * | out, | ||
| size_t | cap ) |
Header key of r into out.
| r | the request |
| key | the header's name |
| out | takes the value |
| cap | bytes of out |
out; out holding "" for a value of cap bytes or more, which matches nothing; NULL for a header not sent or empty