mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-20 19:41:58 +00:00
fix IO_WAIT on send for builtin TLS and MbedTLS
This commit is contained in:
1 parent
4eadf3699f
commit
c1849c2b19
6 files changed
+142
-96
No files matched your search
+38
-34
@@ -2224,40 +2224,41 @@ struct mg_mgr {
|
||||
};
|
||||
|
||||
struct mg_connection {
|
||||
struct mg_connection *next; // Linkage in struct mg_mgr :: connections
|
||||
struct mg_mgr *mgr; // Our container
|
||||
struct mg_addr loc; // Local address
|
||||
struct mg_addr rem; // Remote address
|
||||
void *fd; // Connected socket, or LWIP data
|
||||
unsigned long id; // Auto-incrementing unique connection ID
|
||||
struct mg_iobuf recv; // Incoming data
|
||||
struct mg_iobuf send; // Outgoing data
|
||||
struct mg_iobuf prof; // Profile data enabled by MG_ENABLE_PROFILE
|
||||
struct mg_iobuf rtls; // TLS only. Incoming encrypted data
|
||||
mg_event_handler_t fn; // User-specified event handler function
|
||||
void *fn_data; // User-specified function parameter
|
||||
mg_event_handler_t pfn; // Protocol-specific handler function
|
||||
void *pfn_data; // Protocol-specific function parameter
|
||||
char data[MG_DATA_SIZE]; // Arbitrary connection data
|
||||
void *tls; // TLS specific data
|
||||
unsigned is_listening : 1; // Listening connection
|
||||
unsigned is_client : 1; // Outbound (client) connection
|
||||
unsigned is_accepted : 1; // Accepted (server) connection
|
||||
unsigned is_resolving : 1; // Non-blocking DNS resolution is in progress
|
||||
unsigned is_arplooking : 1; // Non-blocking ARP resolution is in progress
|
||||
unsigned is_connecting : 1; // Non-blocking connect is in progress
|
||||
unsigned is_tls : 1; // TLS-enabled connection
|
||||
unsigned is_tls_hs : 1; // TLS handshake is in progress
|
||||
unsigned is_udp : 1; // UDP connection
|
||||
unsigned is_websocket : 1; // WebSocket connection
|
||||
unsigned is_mqtt5 : 1; // For MQTT connection, v5 indicator
|
||||
unsigned is_hexdumping : 1; // Hexdump in/out traffic
|
||||
unsigned is_draining : 1; // Send remaining data, then close and free
|
||||
unsigned is_closing : 1; // Close and free the connection immediately
|
||||
unsigned is_full : 1; // Stop reads, until cleared
|
||||
unsigned is_resp : 1; // Response is still being generated
|
||||
unsigned is_readable : 1; // Connection is ready to read
|
||||
unsigned is_writable : 1; // Connection is ready to write
|
||||
struct mg_connection *next; // Linkage in struct mg_mgr :: connections
|
||||
struct mg_mgr *mgr; // Our container
|
||||
struct mg_addr loc; // Local address
|
||||
struct mg_addr rem; // Remote address
|
||||
void *fd; // Connected socket, or LWIP data
|
||||
unsigned long id; // Auto-incrementing unique connection ID
|
||||
struct mg_iobuf recv; // Incoming data
|
||||
struct mg_iobuf send; // Outgoing data
|
||||
struct mg_iobuf prof; // Profile data enabled by MG_ENABLE_PROFILE
|
||||
struct mg_iobuf rtls; // TLS only. Incoming encrypted data
|
||||
mg_event_handler_t fn; // User-specified event handler function
|
||||
void *fn_data; // User-specified function parameter
|
||||
mg_event_handler_t pfn; // Protocol-specific handler function
|
||||
void *pfn_data; // Protocol-specific function parameter
|
||||
char data[MG_DATA_SIZE]; // Arbitrary connection data
|
||||
void *tls; // TLS specific data
|
||||
unsigned is_listening : 1; // Listening connection
|
||||
unsigned is_client : 1; // Outbound (client) connection
|
||||
unsigned is_accepted : 1; // Accepted (server) connection
|
||||
unsigned is_resolving : 1; // Non-blocking DNS resolution is in progress
|
||||
unsigned is_arplooking : 1; // Non-blocking ARP resolution is in progress
|
||||
unsigned is_connecting : 1; // Non-blocking connect is in progress
|
||||
unsigned is_tls : 1; // TLS-enabled connection
|
||||
unsigned is_tls_hs : 1; // TLS handshake is in progress
|
||||
unsigned is_udp : 1; // UDP connection
|
||||
unsigned is_websocket : 1; // WebSocket connection
|
||||
unsigned is_mqtt5 : 1; // For MQTT connection, v5 indicator
|
||||
unsigned is_hexdumping : 1; // Hexdump in/out traffic
|
||||
unsigned is_draining : 1; // Send remaining data, then close and free
|
||||
unsigned is_closing : 1; // Close and free the connection immediately
|
||||
unsigned is_full : 1; // Stop reads, until cleared
|
||||
unsigned is_tls_throttled : 1; // Last TLS write: MG_SOCK_PENDING() was true
|
||||
unsigned is_resp : 1; // Response is still being generated
|
||||
unsigned is_readable : 1; // Connection is ready to read
|
||||
unsigned is_writable : 1; // Connection is ready to write
|
||||
};
|
||||
|
||||
void mg_mgr_poll(struct mg_mgr *, int ms);
|
||||
@@ -2425,6 +2426,9 @@ struct mg_tls {
|
||||
#ifdef MBEDTLS_SSL_SESSION_TICKETS
|
||||
mbedtls_ssl_ticket_context ticket; // Session tickets context
|
||||
#endif
|
||||
// https://github.com/Mbed-TLS/mbedtls/blob/3b3c652d/include/mbedtls/ssl.h#L5071C18-L5076C29
|
||||
unsigned char *throttled_buf; // see #3074
|
||||
size_t throttled_len;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user