cs-3516-assignment-1/server/http_server.c

17 lines
423 B
C
Raw Normal View History

2018-09-03 22:54:02 +00:00
#include "http_server.h"
#include "../common/socket_helper.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[]) {
if (argc != 2) {
printf("%s", USAGE_STRING);
}
char *port = argv[1];
long port_num = strtol(port, NULL, 10);
if (port_num < MIN_PORT || port_num > MAX_PORT || errno == ERANGE || errno == EINVAL) {
printf("%s", PORT_ERROR);
}
}