A low-key HTTP micro-framework for people who hate web bloat
git clone git://soophie.de/tpee
531
http_binds = realloc(http_binds, sizeof(http_bind_t) * (http_binds_len + 1));532
http_bind_t *http_bind = &http_binds[http_binds_len];533
http_bind->sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);534
http_bind->port = port;535
if (http_bind->sockfd <= 0) {536
perror("cannot create socket");537
errno = HTTP_ERR_NO_SOCKET;
579
http_error = true;580
return;581
}581
if (SSL_CTX_use_certificate_file(http_host->ssl_ctx, http_host->certificate, SSL_FILETYPE_PEM) <= 0) {582
if (SSL_CTX_use_certificate_chain_file(http_host->ssl_ctx, http_host->certificate) <= 0) {583
perror("cannot use certificate file");584
errno = HTTP_ERR_INVALID_CERTIFICATE;585
http_error = true;
89
int sockfd;90
http_host_t *hosts;91
int hosts_len;92
int port;93
} http_bind_t;95
typedef struct {