A low-key HTTP micro-framework for people who hate web bloat
git clone git://soophie.de/tpee
332
}334
ssize_t http_read(http_conn_t *conn, char *buffer, size_t len) {335
if (conn->ssl != NULL) {336
return SSL_read(conn->ssl, buffer, len);335
struct pollfd fds[1];336
fds[0].fd = conn->sockfd;337
fds[0].events = POLLIN | POLLPRI;338
if (poll(fds, 1, 100) && fds[0].revents & POLLIN) {339
if (conn->ssl != NULL) {340
return SSL_read(conn->ssl, buffer, len);341
}342
return read(conn->sockfd, buffer, len);343
}338
return read(conn->sockfd, buffer, len);344
return 0;345
}347
ssize_t http_write(http_conn_t *conn, char *buffer, size_t len) {