1
1

Guenter Knauf submitted code to detect on windows if the socket is

blocking or not
Этот коммит содержится в:
James Housley 2007-06-22 16:46:36 +00:00
родитель 639b29631a
Коммит 25adcc150e
2 изменённых файлов: 20 добавлений и 2 удалений

Просмотреть файл

@ -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 * Add libssh2_sftp_readdir_ex(), this function if passed the
extra parameters will be used to store the full directory extra parameters will be used to store the full directory
entry as provided by the server. Updated LIBSSH2_APINO to entry as provided by the server. Updated LIBSSH2_APINO to
200706151200 for this change. 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 * libssh2_publickey_shutdown(), libssh2_session_free() changed
to return an "int" to allow signaling of LIBSSH2_ERROR_EAGAIN. 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 #define GETBLOCK 1
#endif #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) #if defined(HAVE_SO_NONBLOCK) && (GETBLOCK == 0)
/* BeOS */ /* BeOS */
long b; long b;