1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

added test case for non-blocking sockets.

git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@199 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
cameronrich
2011-01-19 22:41:03 +00:00
parent 2c092baa28
commit 18c3faf4a8
2 changed files with 135 additions and 1 deletions

View File

@ -1165,13 +1165,15 @@ int basic_read(SSL *ssl, uint8_t **in_data)
read_len = SOCKET_READ(ssl->client_fd, &buf[ssl->bm_read_index],
ssl->need_bytes-ssl->got_bytes);
if (ret < 0)
if (read_len < 0)
{
#ifdef WIN32
if (GetLastError() == WSAEWOULDBLOCK)
#else
if (errno == EAGAIN || errno == EWOULDBLOCK)
#endif
return 0;
}
/* connection has gone, so die */
if (read_len <= 0)