[OpenSRF-GIT] OpenSRF branch master updated. deee3d88a38c53d3750f4cca44fc1920421c1907
Evergreen Git
git at git.evergreen-ils.org
Mon May 11 15:51:06 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, master has been updated
via deee3d88a38c53d3750f4cca44fc1920421c1907 (commit)
from 79acb2f5c3a99320e337791df255714ace3dc3dc (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 deee3d88a38c53d3750f4cca44fc1920421c1907
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