mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-21 11:30:01 +00:00
Add extraconnsize
This commit is contained in:
1 parent
38557aac7f
commit
b5fc0d30a8
4 files changed
+6
-2
No files matched your search
+2
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user