Add source IP and port to syslog for upnp_event_send() error.

Adds the IP and port of requesting host when a send error is logged to syslog so that it is possible to identify the application causing the problem.  Copied the syntax used for Connect() errors in same file.
This commit is contained in:
David Kerr 2017-08-06 10:33:28 -04:00 committed by GitHub
parent e24d7eca28
commit 7befb60ab0
1 changed files with 2 additions and 1 deletions

View File

@ -473,7 +473,8 @@ static void upnp_event_send(struct upnp_event_notify * obj)
i = send(obj->s, obj->buffer + obj->sent, obj->tosend - obj->sent, 0);
if(i<0) {
if(errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR) {
syslog(LOG_NOTICE, "%s: send(): %m", "upnp_event_send");
syslog(LOG_NOTICE, "%s: send(%s%s): %m", "upnp_event_send",
obj->addrstr, obj->portstr);
obj->state = EError;
return;
} else {