sipcapture / heplify

Portable and Lightweight HEP Capture Agent for HOMER
https://sipcapture.org
GNU Affero General Public License v3.0
188 stars 67 forks source link

Improve Heplify error messages for TCP connections #304

Closed Dletta closed 1 month ago

Dletta commented 1 month ago

Some error messages can be confusing or with little detail for example:

Sep 30 13:47:27 WGC-HEP-PXY-01 /usr/local/bin/heplify[22187]: sniffer.go:717: closed tcp connection [1]: EOF Sep 30 13:46:29 WGC-HEP-PXY-02 /usr/local/bin/heplify[16282]: sniffer.go:717: closed tcp connection [1]: EOF

The errors should be more indicative to what this connection is for troubleshooting the cause of early socket termination.

For example, is it an incoming connection to heplify, or is it an outgoing connection from Heplify to Homer?

The error is thrown here for incoming connections: https://github.com/sipcapture/heplify/blob/9d102bb0ebd714b035f5c4de4a7aefc13aac18f0/sniffer/sniffer.go#L717

We should consider amending the error to something like below:

Sep 30 13:47:27 WGC-HEP-PXY-01 /usr/local/bin/heplify[22187]: sniffer.go:717: Incoming client closed tcp connection improperly [1]: EOF

kYroL01 commented 1 month ago

Fixed by https://github.com/sipcapture/heplify/pull/305