[cpp-sp] branch main updated: SPPCPP-952 - Improve error reporting for socket failures
Scott Cantor
cantor.2 at osu.edu
Mon Jul 18 16:25:00 UTC 2022
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository cpp-sp.
View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=9ed3d4f378c985054a56c29aa9b965d4103f80f7
The following commit(s) were added to refs/heads/main by this push:
new 9ed3d4f3 SPPCPP-952 - Improve error reporting for socket failures
9ed3d4f3 is described below
commit 9ed3d4f378c985054a56c29aa9b965d4103f80f7
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Jul 18 12:23:42 2022 -0400
SPPCPP-952 - Improve error reporting for socket failures
https://shibboleth.atlassian.net/browse/SSPCPP-952
---
shibsp/remoting/impl/SocketListener.cpp | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/shibsp/remoting/impl/SocketListener.cpp b/shibsp/remoting/impl/SocketListener.cpp
index 37c5c884..4c475376 100644
--- a/shibsp/remoting/impl/SocketListener.cpp
+++ b/shibsp/remoting/impl/SocketListener.cpp
@@ -339,16 +339,21 @@ DDF SocketListener::send(const DDF& in)
log->debug("send completed, reading response message");
// Read the message.
- while (recv(sock,(char*)&len,sizeof(len)) != sizeof(len)) {
+ int size_read;
+ while ((size_read = recv(sock,(char*)&len,sizeof(len))) != sizeof(len)) {
if (errno == EINTR) continue; // Apparently this happens when a signal interrupts the blocking call.
- log->error("error reading size of output message");
+ if (size_read == -1) {
+ log_error("reading size of output message");
+ }
+ else {
+ log->error("error reading size of output message (%d != %d)", size_read, sizeof(len));
+ }
this->close(sock);
throw ListenerException("Failure receiving response to remoted message ($1).", params(1,in.name()));
}
len = ntohl(len);
char buf[16384];
- int size_read;
stringstream is;
while (len) {
size_read = recv(sock, buf, sizeof(buf));
@@ -362,7 +367,7 @@ DDF SocketListener::send(const DDF& in)
}
if (len) {
- log->error("error reading output message from socket");
+ log_error("reading output message");
this->close(sock);
throw ListenerException("Failure receiving response to remoted message ($1).", params(1,in.name()));
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list