[OpenSRF-GIT] OpenSRF branch rel_3_1 updated. osrf_rel_3_1_1-1-g3384b63
Evergreen Git
git at git.evergreen-ils.org
Mon May 11 15:50:41 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_1 has been updated
via 3384b6340eaecd7f8983eb94dc7647fb82ad972d (commit)
from 48479af283041cd5ba99c3bca0c5f6865be4538a (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 3384b6340eaecd7f8983eb94dc7647fb82ad972d
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