Fix minor type thing

master
Nick Krichevsky 2018-09-11 15:17:27 -04:00
parent 67ce81fe03
commit 24d2ea04a2
1 changed files with 5 additions and 5 deletions

View File

@ -269,12 +269,12 @@ enum socket_result serve_one_request(int sock_fd) {
}
// Attempt to read the file and return it.
struct requested_file file = {};
int file_result = get_file_from_uri(parsed_request_line.uri, &file);
if (file_result != RESULT_FILE_OK) {
enum file_result file_get_result = get_file_from_uri(parsed_request_line.uri, &file);
if (file_get_result != RESULT_FILE_OK) {
int send_result = 0;
if (file_result == RESULT_NOT_FILE || (file_result == RESULT_IO_ERROR && errno == ENOENT)) {
if (file_get_result == RESULT_NOT_FILE || (file_get_result == RESULT_IO_ERROR && errno == ENOENT)) {
send_result = send_headers(404, client_fd, -1);
} else if (file_result == RESULT_IO_ERROR && errno == EACCES) {
} else if (file_get_result == RESULT_IO_ERROR && errno == EACCES) {
send_result = send_headers(403, client_fd, -1);
} else {
free_request_line_items(&parsed_request_line);
@ -298,7 +298,7 @@ enum socket_result serve_one_request(int sock_fd) {
}
free_request_line_items(&parsed_request_line);
free_request_items(message);
if (file_result == RESULT_FILE_OK) {
if (file_get_result == RESULT_FILE_OK) {
fclose(file.file);
}