gamelinux / passivedns

A network sniffer that logs all DNS server replies for use in a passive DNS setup
http://gamelinux.org/
1.67k stars 372 forks source link

Reopening of files when printing records #31

Closed yunzheng closed 9 years ago

yunzheng commented 11 years ago

In the functions print_passet() and print_passet_err() the log files are constantly opened and closed when writing new records.

A much more efficient way would be to open the file handles once and keep using that for writing the log records. Maybe the global config object could be used for that.

Also a SIGHUP handler would be nice to have so passivedns can be signaled for closing and re-opening of the log files. (for log rotation purposes)

thus commented 9 years ago

Fixed in https://github.com/gamelinux/passivedns/pull/38.