Skip to content

Commit

Permalink
Remove some unused functions in NO_FILES build
Browse files Browse the repository at this point in the history
  • Loading branch information
bel2125 committed Aug 6, 2015
1 parent 7820068 commit 3730522
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/civetweb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3827,7 +3827,7 @@ interpret_uri(struct mg_connection *conn, /* in: request */
int *is_put_or_delete_request /* out: put/delete a file? */
)
{
/* TODO: Restructure this function */
/* TODO: Restructure this function */
if (conn && conn->ctx) {

#if !defined(NO_FILES)
Expand All @@ -3841,7 +3841,7 @@ interpret_uri(struct mg_connection *conn, /* in: request */
char const *accept_encoding;
int truncated;
#else
(void)filename_buf_len; /* unused if NO_FILES is defined */
(void)filename_buf_len; /* unused if NO_FILES is defined */
#endif

memset(filep, 0, sizeof(*filep));
Expand All @@ -3857,7 +3857,7 @@ interpret_uri(struct mg_connection *conn, /* in: request */
root = conn->ctx->config[WEBSOCKET_ROOT];
}
#endif /* !NO_FILES */
#else /* USE_WEBSOCKET */
#else /* USE_WEBSOCKET */
*is_websocket_request = 0;
#endif /* USE_WEBSOCKET */

Expand Down Expand Up @@ -4045,6 +4045,8 @@ static int get_request_len(const char *buf, int buflen)
return len;
}


#if !defined(NO_FILES)
/* Convert month to the month number. Return -1 on error, or month number */
static int get_month_index(const char *s)
{
Expand All @@ -4059,13 +4061,13 @@ static int get_month_index(const char *s)
return -1;
}


static int num_leap_years(int year)
{
return year / 4 - year / 100 + year / 400;
}


#if !defined(NO_FILES)
/* Parse UTC date-time string, and return the corresponding time_t value. */
static time_t parse_date_string(const char *datetime)
{
Expand Down Expand Up @@ -6708,6 +6710,8 @@ static void delete_file(struct mg_connection *conn, const char *path)
strerror(ERRNO));
}
}
#endif /* !NO_FILES */


static void
send_ssi_file(struct mg_connection *, const char *, struct file *, int);
Expand Down Expand Up @@ -6814,7 +6818,6 @@ static void do_ssi_exec(struct mg_connection *conn, char *tag)
}
}
#endif /* !NO_POPEN */
#endif /* !NO_FILES */


static int mg_fgetc(struct file *filep, int offset)
Expand Down Expand Up @@ -8289,15 +8292,15 @@ static void handle_request(struct mg_connection *conn)
int is_found = 0, is_script_resource = 0, is_websocket_request = 0,
is_put_or_delete_request = 0, is_callback_resource = 0;
int i;
struct file file = STRUCT_FILE_INITIALIZER;
struct file file = STRUCT_FILE_INITIALIZER;
mg_request_handler callback_handler = NULL;
mg_websocket_connect_handler ws_connect_handler = NULL;
mg_websocket_ready_handler ws_ready_handler = NULL;
mg_websocket_data_handler ws_data_handler = NULL;
mg_websocket_close_handler ws_close_handler = NULL;
void *callback_data = NULL;
#if !defined(NO_FILES)
time_t curtime = time(NULL);
time_t curtime = time(NULL);
char date[64];
#endif

Expand Down

0 comments on commit 3730522

Please sign in to comment.