* Add HTTP-parser lib to support ESP32 WebServer * Add WebServer from ESP32. Only supports HTTP * Separate HTTP server from the network server Instead of managing the WiFiServer/WiFiServerSecure in the same object as the HTTP handling, split them into separate objects. This lets HTTP and HTTPS servers work without templates or duplicating code. The HTTP block just gets a `WiFiClient*` and works with that to only do HTTP processing, while the upper object handles the appropriate server and client types. * Add HTTPS server * Clean up some THandlerFunction refs * Refactor into a template-ized WebServer/WebServerSecure * Add DNSServer examples which need WebServer * Fix CoreMutex infinite recursion crash Core could crash while Serial debugging was going on and prints were happening from LWIP/IRQ land and the main app. * Add HTTPUpdateServer(Secure) * Add MIME include, optimize WebServer::send(size,len) When send()ing a large buffer, the WebServer::send() call would actually convert that buffer into a String (i.e. duplicate it, and potential issues with embedded \0s in binary data). Make a simple override to send(size, len) to allow writing from the source buffer instead. * Fix WiFiClient::send(Stream), add FSBrowser example
35 lines
826 B
C
Executable file
35 lines
826 B
C
Executable file
/*
|
|
cdecode.h - c header for a base64 decoding algorithm
|
|
|
|
This is part of the libb64 project, and has been placed in the public domain.
|
|
For details, see http://sourceforge.net/projects/libb64
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#define base64_decode_expected_len(n) ((n * 3) / 4)
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
step_a, step_b, step_c, step_d
|
|
} base64_decodestep;
|
|
|
|
typedef struct {
|
|
base64_decodestep step;
|
|
char plainchar;
|
|
} base64_decodestate;
|
|
|
|
void base64_init_decodestate(base64_decodestate* state_in);
|
|
|
|
int base64_decode_value(char value_in);
|
|
|
|
int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in);
|
|
|
|
int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out);
|
|
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
#endif
|