mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-14 09:48:01 +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 *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) {
|
if (c != NULL) {
|
||||||
c->mgr = mgr;
|
c->mgr = mgr;
|
||||||
c->id = ++mgr->nextid;
|
c->id = ++mgr->nextid;
|
||||||
|
@ -910,6 +910,7 @@ struct mg_mgr {
|
|||||||
void *active_dns_requests; // DNS requests in progress
|
void *active_dns_requests; // DNS requests in progress
|
||||||
struct mg_timer *timers; // Active timers
|
struct mg_timer *timers; // Active timers
|
||||||
void *priv; // Used by the experimental stack
|
void *priv; // Used by the experimental stack
|
||||||
|
size_t extraconnsize; // Used by the experimental stack
|
||||||
#if MG_ARCH == MG_ARCH_FREERTOS_TCP
|
#if MG_ARCH == MG_ARCH_FREERTOS_TCP
|
||||||
SocketSet_t ss; // NOTE(lsm): referenced from socket struct
|
SocketSet_t ss; // NOTE(lsm): referenced from socket struct
|
||||||
#endif
|
#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 *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) {
|
if (c != NULL) {
|
||||||
c->mgr = mgr;
|
c->mgr = mgr;
|
||||||
c->id = ++mgr->nextid;
|
c->id = ++mgr->nextid;
|
||||||
|
@ -30,6 +30,7 @@ struct mg_mgr {
|
|||||||
void *active_dns_requests; // DNS requests in progress
|
void *active_dns_requests; // DNS requests in progress
|
||||||
struct mg_timer *timers; // Active timers
|
struct mg_timer *timers; // Active timers
|
||||||
void *priv; // Used by the experimental stack
|
void *priv; // Used by the experimental stack
|
||||||
|
size_t extraconnsize; // Used by the experimental stack
|
||||||
#if MG_ARCH == MG_ARCH_FREERTOS_TCP
|
#if MG_ARCH == MG_ARCH_FREERTOS_TCP
|
||||||
SocketSet_t ss; // NOTE(lsm): referenced from socket struct
|
SocketSet_t ss; // NOTE(lsm): referenced from socket struct
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user