mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-26 22:41:03 +08:00
Add extraconnsize
This commit is contained in:
parent
38557aac7f
commit
b5fc0d30a8
@ -2687,7 +2687,8 @@ bool mg_aton(struct mg_str str, struct mg_addr *addr) {
|
||||
}
|
||||
|
||||
struct mg_connection *mg_alloc_conn(struct mg_mgr *mgr) {
|
||||
struct mg_connection *c = (struct mg_connection *) calloc(1, sizeof(*c));
|
||||
struct mg_connection *c =
|
||||
(struct mg_connection *) calloc(1, sizeof(*c) + mgr->extraconnsize);
|
||||
if (c != NULL) {
|
||||
c->mgr = mgr;
|
||||
c->id = ++mgr->nextid;
|
||||
|
@ -910,6 +910,7 @@ struct mg_mgr {
|
||||
void *active_dns_requests; // DNS requests in progress
|
||||
struct mg_timer *timers; // Active timers
|
||||
void *priv; // Used by the experimental stack
|
||||
size_t extraconnsize; // Used by the experimental stack
|
||||
#if MG_ARCH == MG_ARCH_FREERTOS_TCP
|
||||
SocketSet_t ss; // NOTE(lsm): referenced from socket struct
|
||||
#endif
|
||||
|
@ -139,7 +139,8 @@ bool mg_aton(struct mg_str str, struct mg_addr *addr) {
|
||||
}
|
||||
|
||||
struct mg_connection *mg_alloc_conn(struct mg_mgr *mgr) {
|
||||
struct mg_connection *c = (struct mg_connection *) calloc(1, sizeof(*c));
|
||||
struct mg_connection *c =
|
||||
(struct mg_connection *) calloc(1, sizeof(*c) + mgr->extraconnsize);
|
||||
if (c != NULL) {
|
||||
c->mgr = mgr;
|
||||
c->id = ++mgr->nextid;
|
||||
|
@ -30,6 +30,7 @@ struct mg_mgr {
|
||||
void *active_dns_requests; // DNS requests in progress
|
||||
struct mg_timer *timers; // Active timers
|
||||
void *priv; // Used by the experimental stack
|
||||
size_t extraconnsize; // Used by the experimental stack
|
||||
#if MG_ARCH == MG_ARCH_FREERTOS_TCP
|
||||
SocketSet_t ss; // NOTE(lsm): referenced from socket struct
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user