Skip to content

Commit

Permalink
Fix managing properly map_header on static file callback, backport fr…
Browse files Browse the repository at this point in the history
…om branch 2.6, fixes #123
  • Loading branch information
babelouest committed Jun 25, 2019
1 parent dfd450b commit 846a6df
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions example_programs/websocket_example/websocket_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ int main(int argc, char ** argv) {
u_map_put(file_config.mime_types, "*", "application/octet-stream");
file_config.files_path = "static";
file_config.url_prefix = PREFIX_STATIC;
file_config.map_header = o_malloc(sizeof(struct _u_map));
u_map_init(file_config.map_header);

if (ulfius_init_instance(&instance, PORT, NULL, NULL) != U_OK) {
y_log_message(Y_LOG_LEVEL_ERROR, "Error ulfius_init_instance, abort");
Expand Down Expand Up @@ -131,6 +133,7 @@ int main(int argc, char ** argv) {
ulfius_stop_framework(&instance);
ulfius_clean_instance(&instance);
u_map_clean_full(file_config.mime_types);
u_map_clean_full(file_config.map_header);
y_close_logs();

return 0;
Expand Down

0 comments on commit 846a6df

Please sign in to comment.