Guenter Knauf submitted code to detect on windows if the socket is
blocking or not
Этот коммит содержится в:
родитель
639b29631a
Коммит
25adcc150e
@ -1,10 +1,14 @@
|
||||
2007-07-15 James Housley <jim@thehousleys.net>
|
||||
2007-06-22 James Housley <jim@thehousleys.net>
|
||||
* Guenter Knauf submitted code for windows to detect
|
||||
if the socket is blocking or not.
|
||||
|
||||
2007-06-15 James Housley <jim@thehousleys.net>
|
||||
* Add libssh2_sftp_readdir_ex(), this function if passed the
|
||||
extra parameters will be used to store the full directory
|
||||
entry as provided by the server. Updated LIBSSH2_APINO to
|
||||
200706151200 for this change.
|
||||
|
||||
2007-07-12 James Housley <jim@thehousleys.net>
|
||||
2007-06-12 James Housley <jim@thehousleys.net>
|
||||
|
||||
* libssh2_publickey_shutdown(), libssh2_session_free() changed
|
||||
to return an "int" to allow signaling of LIBSSH2_ERROR_EAGAIN.
|
||||
|
@ -318,6 +318,20 @@ static int _libssh2_get_socket_nonblocking(int sockfd) /* operate on this */
|
||||
#define GETBLOCK 1
|
||||
#endif
|
||||
|
||||
#if defined(WSAEWOULDBLOCK) && (GETBLOCK == 0)
|
||||
/* Windows? */
|
||||
unsigned int option_value;
|
||||
socklen_t option_len = sizeof(option_value);
|
||||
|
||||
if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void*)&option_value, &option_len)) {
|
||||
/* Assume blocking on error */
|
||||
return 1;
|
||||
}
|
||||
return (int)option_value;
|
||||
#undef GETBLOCK
|
||||
#define GETBLOCK 2
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SO_NONBLOCK) && (GETBLOCK == 0)
|
||||
/* BeOS */
|
||||
long b;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user