Listen on all addresses

master
Nick Krichevsky 2018-09-09 19:59:07 -04:00
parent 5cca544e59
commit d25c063a04
2 changed files with 2 additions and 1 deletions

View File

@ -28,7 +28,7 @@ static int build_addr_info(int port, struct addrinfo **info) {
char *port_string = malloc((port_length + 1) * sizeof(char)); char *port_string = malloc((port_length + 1) * sizeof(char));
sprintf(port_string, "%d", port); sprintf(port_string, "%d", port);
int addr_status = getaddrinfo(NULL, port_string, &hints, info); int addr_status = getaddrinfo(LISTEN_ADDR, port_string, &hints, info);
free(port_string); free(port_string);
return addr_status; return addr_status;

View File

@ -3,6 +3,7 @@
#include "../common/socket_helper.h" #include "../common/socket_helper.h"
#define LISTEN_ADDR "::"
#define BACKLOG_SIZE 8 #define BACKLOG_SIZE 8
#define HTTP_VERSION "HTTP/1.1" #define HTTP_VERSION "HTTP/1.1"
#define FILE_BUFFER_SIZE 1024 #define FILE_BUFFER_SIZE 1024