Improve handleError error messages

The hangup and error handlers now have unique messages. Although the
behavior in the handlers is practically the same in both cases, the cause
of the error is not the same.

If a socket error is present, it is added to the error message. If an
error is present, it should clearly show the reason why the TCP socket was
closed.

The is_fake_event boolean helps distinguish fake events from real
ones. This makes figuring out the real source of hangup events easier.
This commit is contained in:
Markus Mäkelä
2019-12-12 21:12:11 +02:00
parent 44664132bc
commit e057c751cd
3 changed files with 30 additions and 4 deletions

View File

@ -229,7 +229,8 @@ typedef struct dcb
uint32_t n_close; /** How many times dcb_close has been called. */
char* path; /** If a Unix socket, the path it was bound to. */
uint64_t m_uid; /**< Unique identifier for this DCB */
uint64_t m_uid; /**< Unique identifier for this DCB */
bool is_fake_event;
} DCB;
/**