[OpenSRF-GIT] OpenSRF branch rel_3_2 updated. osrf_rel_3_2_0-4-gcbf8374

Evergreen Git git at git.evergreen-ils.org
Mon May 11 15:50:51 EDT 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenSRF".

The branch, rel_3_2 has been updated
       via  cbf837440c96b4f767aaaed033478aa8c1aaab03 (commit)
      from  747a59e1c6e8e75d4cae579459b76ee792602a2e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cbf837440c96b4f767aaaed033478aa8c1aaab03
Author: Bill Erickson <berickxx at gmail.com>
Date:   Thu Apr 23 15:32:50 2020 -0400

    LP1874510 libopensrf recv timeout cal repair
    
    Fixes the message receive timeout calculation logic in OpenSRF C client
    code.  The calculation is performed when multiple calls to receive are
    needed to piece together a response message.
    
    The logic previously calculated the time remaining as the time remaining
    minus the total time taken for all iterations with each loop iteration,
    leading to exhausting the timeout too quickly.  Now it calculates the
    value as time remaining minus the time taken for the only most recent
    loop iteration.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Jason Stephenson <jason at sigio.com>

diff --git a/src/libopensrf/osrf_app_session.c b/src/libopensrf/osrf_app_session.c
index 28242e7..df83e3e 100644
--- a/src/libopensrf/osrf_app_session.c
+++ b/src/libopensrf/osrf_app_session.c
@@ -385,7 +385,11 @@ static osrfMessage* _osrf_app_request_recv( osrfAppRequest* req, int timeout ) {
 			req->reset_timeout = 0;
 			osrfLogDebug( OSRF_LOG_MARK, "Received a timeout reset");
 		} else {
-			remaining -= (int) (time(NULL) - start);
+			// Subtract the amount of time taken during this loop 
+			// iteration, not the combined time of all iterations.
+			time_t tmp = time(NULL);
+			remaining -= (int) (tmp - start);
+			start = tmp;
 		}
 	}
 

-----------------------------------------------------------------------

Summary of changes:
 src/libopensrf/osrf_app_session.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
OpenSRF


More information about the opensrf-commits mailing list