httpserver.h icon indicating copy to clipboard operation
httpserver.h copied to clipboard

Option to break the epoll main loop

Open david20160 opened this issue 4 years ago • 1 comments

Hello,

In order to exit from the server cleaning the way, may be doing this change in the line 1700:

while (1) {

change to

int nev = 0;
while (1) {
    if (nev != -1) break;
    [delete int from the next line]

To quit the loop only it is needed:

int res = epoll_ctl (server->loop, EPOLL_CTL_DEL, 1, NULL);
close (server->loop);

It can be more stylished but works.

david20160 avatar Aug 16 '21 16:08 david20160

How do you handle memory leaks after the close ?

Yasha-ops avatar Dec 03 '23 02:12 Yasha-ops