mirror of
https://github.com/cesanta/mongoose.git
synced 2025-06-07 09:27:05 +08:00
commit
39392b3690
@ -4127,6 +4127,9 @@ void mg_mgr_free(struct mg_mgr *mgr) {
|
||||
if (mgr->epoll_fd >= 0) close(mgr->epoll_fd), mgr->epoll_fd = -1;
|
||||
#endif
|
||||
mg_tls_ctx_free(mgr);
|
||||
#if MG_ENABLE_TCPIP
|
||||
if (mgr->ifp) mg_tcpip_free(mgr->ifp);
|
||||
#endif
|
||||
}
|
||||
|
||||
void mg_mgr_init(struct mg_mgr *mgr) {
|
||||
@ -4162,7 +4165,7 @@ void mg_mgr_init(struct mg_mgr *mgr) {
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(MG_ENABLE_TCPIP) && MG_ENABLE_TCPIP
|
||||
#if MG_ENABLE_TCPIP
|
||||
#define MG_EPHEMERAL_PORT_BASE 32768
|
||||
#define PDIFF(a, b) ((size_t) (((char *) (b)) - ((char *) (a))))
|
||||
|
||||
|
@ -247,6 +247,9 @@ void mg_mgr_free(struct mg_mgr *mgr) {
|
||||
if (mgr->epoll_fd >= 0) close(mgr->epoll_fd), mgr->epoll_fd = -1;
|
||||
#endif
|
||||
mg_tls_ctx_free(mgr);
|
||||
#if MG_ENABLE_TCPIP
|
||||
if (mgr->ifp) mg_tcpip_free(mgr->ifp);
|
||||
#endif
|
||||
}
|
||||
|
||||
void mg_mgr_init(struct mg_mgr *mgr) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "net_builtin.h"
|
||||
|
||||
#if defined(MG_ENABLE_TCPIP) && MG_ENABLE_TCPIP
|
||||
#if MG_ENABLE_TCPIP
|
||||
#define MG_EPHEMERAL_PORT_BASE 32768
|
||||
#define PDIFF(a, b) ((size_t) (((char *) (b)) - ((char *) (a))))
|
||||
|
||||
|
@ -145,9 +145,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
mg_iobuf_add(&c->recv, 0, data, size);
|
||||
c->pfn(c, MG_EV_READ, NULL); // manually invoke protocol event handler
|
||||
|
||||
mg_mgr_free(&mgr);
|
||||
free(pkt);
|
||||
mg_tcpip_free(&mif);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -471,7 +471,6 @@ int main(void) {
|
||||
|
||||
// Clear
|
||||
mg_mgr_free(&mgr);
|
||||
mg_tcpip_free(&mif); // Release after mg_mgr
|
||||
ASSERT(mgr.conns == NULL); // Deconstruction OK
|
||||
close(fd);
|
||||
return 0;
|
||||
|
@ -80,7 +80,6 @@ static void test_poll(void) {
|
||||
mg_http_listen(&mgr, "http://127.0.0.1:12346", ph, &count);
|
||||
for (i = 0; i < 10; i++) mg_mgr_poll(&mgr, 0);
|
||||
ASSERT(count == 10);
|
||||
mg_tcpip_free(&mif);
|
||||
mg_mgr_free(&mgr);
|
||||
}
|
||||
|
||||
@ -240,7 +239,6 @@ static void test_retransmit(void) {
|
||||
|
||||
s_driver_data.len = 0;
|
||||
mg_mgr_free(&mgr);
|
||||
mg_tcpip_free(&mif);
|
||||
}
|
||||
|
||||
static void test_frag_recv_path(void) {
|
||||
@ -284,7 +282,6 @@ static void test_frag_recv_path(void) {
|
||||
|
||||
s_driver_data.len = 0;
|
||||
mg_mgr_free(&mgr);
|
||||
mg_tcpip_free(&mif);
|
||||
}
|
||||
|
||||
static void test_frag_send_path(void) {
|
||||
@ -307,7 +304,6 @@ static void test_frag_send_path(void) {
|
||||
ASSERT(s_seg_sent == 3);
|
||||
s_driver_data.len = 0;
|
||||
mg_mgr_free(&mgr);
|
||||
mg_tcpip_free(&mif);
|
||||
}
|
||||
|
||||
static void test_fragmentation(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user