Rename get_file_from_url to get_file_from_Uri
parent
cda1b1ae29
commit
bb9c6e8afe
|
@ -106,7 +106,7 @@ void free_request_line_items(struct request_line *parsed_line) {
|
|||
*
|
||||
* @return -1 For an I/O error, 0 if successful.
|
||||
*/
|
||||
int get_file_from_url(const char *uri, struct requested_file *req_file) {
|
||||
int get_file_from_uri(const char *uri, struct requested_file *req_file) {
|
||||
// If our uri starts with a slash, we can ignore it.
|
||||
if (*uri == '/') {
|
||||
uri++;
|
||||
|
|
|
@ -16,6 +16,6 @@ struct requested_file {
|
|||
|
||||
int parse_request_line(const char *line, struct request_line *parsed_line);
|
||||
void free_request_line_items(struct request_line *parsed_line);
|
||||
int get_file_from_url(const char *uri, struct requested_file *req_file);
|
||||
int get_file_from_uri(const char *uri, struct requested_file *req_file);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -246,7 +246,7 @@ 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_url(parsed_request_line.uri, &file);
|
||||
int file_result = get_file_from_uri(parsed_request_line.uri, &file);
|
||||
if (file_result == -1) {
|
||||
int send_result = 0;
|
||||
if (errno == ENOENT) {
|
||||
|
|
Loading…
Reference in New Issue