Lines Matching refs:path
20 int security_check(char *path) in security_check() argument
23 if (strstr(path, "..")) in security_check()
35 void send_header(int sockfd, int content_length, char *path) in send_header() argument
40 if (strstr(path, ".html")) in send_header()
44 else if (strstr(path, ".css")) in send_header()
48 else if (strstr(path, ".js")) in send_header()
52 else if (strstr(path, ".png")) in send_header()
56 else if (strstr(path, ".jpg")) in send_header()
60 else if (strstr(path, ".gif")) in send_header()
72 void send_file(int sockfd, char *path) in send_file() argument
74 printf("send_file: path: %s\n", path); in send_file()
76 int fd = open(path, 0); in send_file()
89 send_header(sockfd, content_length, path); in send_file()
121 char path[MAX_REQUEST_SIZE]; in handle_request() local
152 sprintf(path, "%s%s%s", WEB_ROOT, url, DEFAULT_PAGE); in handle_request()
156 sprintf(path, "%s%s", WEB_ROOT, url); in handle_request()
158 if (!security_check(path)) in handle_request()
165 send_file(sockfd, path); in handle_request()