Added global variables in sitefiles to allow for https support

This commit is contained in:
Nate Choe
2022-01-29 13:21:35 -06:00
parent db645b0bf5
commit c46ed581c3
18 changed files with 430 additions and 58 deletions

View File

@@ -21,7 +21,7 @@
#include <stdarg.h>
#include <string.h>
#include <limits.h>
#include <unistd.h>
#include <sys/stat.h>
#include <responseutil.h>
@@ -40,7 +40,7 @@ static int sendConnection(Connection *conn, char *format, ...) {
va_start(ap, format);
vsprintf(data, format, ap);
if (write(conn->fd, data, len) < len) {
if (sendStream(conn->stream, data, len) < len) {
free(data);
return 1;
}
@@ -83,5 +83,5 @@ int sendBinaryResponse(Connection *conn, char *status,
, status, len)
)
return 1;
return write(conn->fd, data, len) < len;
return sendStream(conn->stream, data, len) < len;
}