2023-09-23 20:46:06 +02:00
|
|
|
src/session.c | 4 +++-
|
|
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/src/session.c b/src/session.c
|
2024-11-12 20:25:25 +01:00
|
|
|
index 2d77b05..79809cc 100644
|
2023-09-23 20:46:06 +02:00
|
|
|
--- a/src/session.c
|
|
|
|
+++ b/src/session.c
|
2024-11-12 20:25:25 +01:00
|
|
|
@@ -68,6 +68,8 @@
|
2023-09-23 20:46:06 +02:00
|
|
|
#undef libssh2_usec_t
|
|
|
|
#endif
|
2021-06-13 21:58:25 +02:00
|
|
|
|
2021-06-13 22:11:08 +02:00
|
|
|
+#define DIFFTIME(_b,_a) ((double)((_b) - (_a)))
|
2021-06-13 21:58:25 +02:00
|
|
|
+
|
|
|
|
/* libssh2_default_alloc
|
|
|
|
*/
|
|
|
|
static
|
2024-11-12 20:25:25 +01:00
|
|
|
@@ -628,7 +630,7 @@ int _libssh2_wait_socket(LIBSSH2_SESSION *session, time_t start_time)
|
2021-06-13 21:58:25 +02:00
|
|
|
(seconds_to_next == 0 ||
|
|
|
|
ms_to_next > session->api_timeout)) {
|
|
|
|
time_t now = time(NULL);
|
|
|
|
- elapsed_ms = (long)(1000*difftime(now, start_time));
|
|
|
|
+ elapsed_ms = (long)(1000*DIFFTIME(now, start_time));
|
|
|
|
if(elapsed_ms > session->api_timeout) {
|
|
|
|
return _libssh2_error(session, LIBSSH2_ERROR_TIMEOUT,
|
2023-09-24 16:27:44 +02:00
|
|
|
"API timeout expired");
|