27 #include <openssl/ssl.h>
38 char remoteAddr[16] =
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
42 if (this->nfds >= this->max_fds) {
46 acc =
socketAccept((0 == i)? this->sock : this->sockSSL, &remoteAddr);
48 if (NULL != acc && -1 != acc->handle) {
60 SSL * ssl = SSL_new(this->ctx);
61 SSL_set_fd(ssl, acc->handle);
73 (this->
conns)[acc->handle].sock = acc;
76 (this->conns)[acc->handle].worker =
clone(this->worker);
77 (this->
conns)[acc->handle].stream = st;
79 (this->fds)[this->nfds].fd = acc->handle;
80 (this->fds)[this->nfds].events = POLLIN;
86 case EAGAIN|EWOULDBLOCK:
90 "server accept blocks");
97 "server accept error");
103 if (0 == this->nfds%200) {
int serverHandleAccept(Server this, unsigned int i)
Sock socketAccept(Sock this, char(*remoteAddr)[16])
void socketNonblock(Sock this)
void loggerLog(void *, logger_level, const char *const,...)