mirror of
https://github.com/adulau/ssldump.git
synced 2024-11-22 01:17:04 +00:00
Close global pcap struct properly in case of SIGINT
This commit is contained in:
parent
1ca8db64ed
commit
8c8c97fcb0
1 changed files with 6 additions and 2 deletions
|
@ -126,10 +126,15 @@ int print_version()
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pcap_t *p;
|
||||||
void sig_handler(int sig)
|
void sig_handler(int sig)
|
||||||
{
|
{
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
if (logger) logger->vtbl->deinit();
|
if (logger)
|
||||||
|
logger->vtbl->deinit();
|
||||||
|
printf("Cleaning %d remaining connection(s) from connection pool\n", destroy_all_conn());
|
||||||
|
if(p)
|
||||||
|
pcap_close(p);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +281,6 @@ int main(argc,argv)
|
||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
{
|
{
|
||||||
pcap_t *p;
|
|
||||||
int r;
|
int r;
|
||||||
n_handler *n;
|
n_handler *n;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
Loading…
Reference in a new issue