MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / NonBlockingSSL_Accept

Function NonBlockingSSL_Accept

extra/yassl/examples/server/server.cpp:38–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

server_testFunction · 0.85

Calls 3

SSL_acceptFunction · 0.85
SSL_get_errorFunction · 0.85
ServerErrorFunction · 0.85

Tested by

no test coverage detected