| 36 | |
| 37 | #ifdef NON_BLOCKING |
| 38 | void NonBlockingSSL_Accept(SSL* ssl, SSL_CTX* ctx, SOCKET_T& clientfd) |
| 39 | { |
| 40 | int ret = SSL_accept(ssl); |
| 41 | int err = SSL_get_error(ssl, 0); |
| 42 | while (ret != SSL_SUCCESS && (err == SSL_ERROR_WANT_READ || |
| 43 | err == SSL_ERROR_WANT_WRITE)) { |
| 44 | if (err == SSL_ERROR_WANT_READ) |
| 45 | printf("... server would read block\n"); |
| 46 | else |
| 47 | printf("... server would write block\n"); |
| 48 | #ifdef _WIN32 |
| 49 | Sleep(1000); |
| 50 | #else |
| 51 | sleep(1); |
| 52 | #endif |
| 53 | ret = SSL_accept(ssl); |
| 54 | err = SSL_get_error(ssl, 0); |
| 55 | } |
| 56 | if (ret != SSL_SUCCESS) |
| 57 | ServerError(ctx, ssl, clientfd, "SSL_accept failed"); |
| 58 | } |
| 59 | #endif |
| 60 | |
| 61 |
no test coverage detected