mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +03:00
Configurable session read timeout (#892)
This set of changes provides a mechanism to runtime-configure the previously #define'd timeout for reading packets from a session. The intention here is to also extend libcurl to be able to use this interface so that when fetching from sftp servers which are very slow to return directory listings, connections do not time-out so much. * Add new field to session to hold configurable read timeout * Updated `_libssh2_packet_require()`, `_libssh2_packet_requirev()`, and `sftp_packet_requirev()` to use new field in session structure * Updated docs for API functions to set/get read timeout field in session structure * Updated `libssh2.h` to declare the get/set read timeout functions Co-authored-by: Jon Axtell <jon.axtell@codethink.co.uk> Credit: Daniel Silverstone
This commit is contained in:
committed by
GitHub
parent
a7d60c62ab
commit
c20c81ab10
20
docs/libssh2_session_set_read_timeout.3
Normal file
20
docs/libssh2_session_set_read_timeout.3
Normal file
@ -0,0 +1,20 @@
|
||||
.TH libssh2_session_set_read_timeout 3 "13 Jan 2023" "libssh2 1.10.1" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_session_set_read_timeout - set timeout for packet read functions
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
.nf
|
||||
void libssh2_session_set_read_timeout(LIBSSH2_SESSION *session, long timeout);
|
||||
.SH DESCRIPTION
|
||||
Set the \fBtimeout\fP in seconds for how long libssh2 packet read
|
||||
function calls may wait until they consider the situation an error and return
|
||||
LIBSSH2_ERROR_TIMEOUT.
|
||||
|
||||
By default or if you set the timeout to zero, the timeout will be set to
|
||||
60 seconds.
|
||||
.SH RETURN VALUE
|
||||
Nothing
|
||||
.SH AVAILABILITY
|
||||
Added in 1.10.1
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_session_get_read_timeout(3)
|
Reference in New Issue
Block a user