[shibboleth-sp2] 19/100: Better logging of RPC status code.

Ferenc Wágner wferi-guest at moszumanska.debian.org
Tue Jan 26 21:29:14 UTC 2016


This is an automated email from the git hooks/post-receive script.

wferi-guest pushed a commit to annotated tag 1.2.1
in repository shibboleth-sp2.

commit 7928b4f97003a1a1e985d7841f51c9c7b4821c8e
Author: Scott Cantor <cantor.2 at osu.edu>
Date:   Wed Oct 6 02:50:54 2004 +0000

    Better logging of RPC status code.
---
 shib-target/shib-rm.cpp    |  9 ++++-----
 shib-target/shib-shire.cpp | 22 ++++++++++------------
 2 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/shib-target/shib-rm.cpp b/shib-target/shib-rm.cpp
index ccbda1e..067417e 100644
--- a/shib-target/shib-rm.cpp
+++ b/shib-target/shib-rm.cpp
@@ -119,16 +119,15 @@ RPCError* RM::getAssertions(
   RPC rpc;
   do {
     clnt = rpc->connect();
-    if (shibrpc_get_assertions_1(&arg, &ret, clnt) != RPC_SUCCESS) {
+    clnt_stat status = shibrpc_get_assertions_1(&arg, &ret, clnt);
+    if (status != RPC_SUCCESS) {
       // FAILED.  Release, disconnect, and try again.
-      log.debug("RPC Failure: %p (%p): %s", this, clnt, clnt_spcreateerror (""));
+      log.debug("RPC Failure: %p (%p) (%d): %s", this, clnt, status, clnt_spcreateerror("shibrpc_get_assertions_1"));
       rpc->disconnect();
       if (retry)
         retry--;
-      else {
-        log.error("RPC Failure: %p, %p", this, clnt);
+      else
         return new RPCError(-1, "RPC Failure");
-      }
     }
     else {
       // SUCCESS.  Release back into pool
diff --git a/shib-target/shib-shire.cpp b/shib-target/shib-shire.cpp
index 52d8e9f..f2376d9 100644
--- a/shib-target/shib-shire.cpp
+++ b/shib-target/shib-shire.cpp
@@ -415,16 +415,15 @@ RPCError* SHIRE::sessionIsValid(const char* session_id, const char* ip) const
   RPC rpc;
   do {
     clnt = rpc->connect();
-    if (shibrpc_session_is_valid_1(&arg, &ret, clnt) != RPC_SUCCESS) {
+    clnt_stat status = shibrpc_session_is_valid_1(&arg, &ret, clnt);
+    if (status != RPC_SUCCESS) {
       // FAILED.  Release, disconnect, and try again...
-      log.debug("RPC Failure: %p (%p): %s", this, clnt, clnt_spcreateerror(""));
+      log.error("RPC Failure: %p (%p) (%d) %s", this, clnt, status, clnt_spcreateerror("shibrpc_session_is_valid_1"));
       rpc->disconnect();
       if (retry)
           retry--;
-      else {
-        log.error("RPC Failure: %p (%p)", this, clnt);
-        return new RPCError(-1, "RPC Failure");
-      }
+      else
+          return new RPCError(-1, "RPC Failure");
     }
     else {
       // SUCCESS.  Return to the pool.
@@ -487,16 +486,15 @@ RPCError* SHIRE::sessionCreate(const char* response, const char* ip, string& coo
   RPC rpc;
   do {
     clnt = rpc->connect();
-    if (shibrpc_new_session_1 (&arg, &ret, clnt) != RPC_SUCCESS) {
+    clnt_stat status = shibrpc_new_session_1 (&arg, &ret, clnt);
+    if (status != RPC_SUCCESS) {
       // FAILED.  Release, disconnect, and retry
-      log.debug("RPC Failure: %p (%p): %s", this, clnt, clnt_spcreateerror (""));
+      log.error("RPC Failure: %p (%p) (%d): %s", this, clnt, status, clnt_spcreateerror("shibrpc_new_session_1"));
       rpc->disconnect();
       if (retry)
-       retry--;
-      else {
-        log.error("RPC Failure: %p (%p)", this, clnt);
+        retry--;
+      else
         return new RPCError(-1, "RPC Failure");
-      }
     }
     else {
       // SUCCESS.  Pool and continue

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-shibboleth/shibboleth-sp2.git



More information about the Pkg-shibboleth-devel mailing list