Static files: comment says the server falls back to disk when the cache cannot be allocated, but it returns 500

Open Beginner friendly
#920 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c

Research direction

Read cwist_mem_init() and cwist_static_handler() in src/sys/app/app.c to compare the documented behavior with the NULL mem_manager handling. Decide whether the comment and log should describe the current 500 response or a disk fallback should be added. Done when the implementation and its comment and log agree.

Written by the indexing model from the issue text.

Description

bug

Location: src/sys/app/app.c, cwist_mem_init() and cwist_static_handler().

Found by code reading on dev at 04ada5ffa; not reproduced with a running program.

cwist_mem_init() says "Serving still works: static files are then read from disk per request instead of from the in-memory cache (#341)" when app->mem_manager cannot be allocated. There is no such path: cwist_static_handler() answers every static request with 500 "Server memory not initialized" when mem_manager is NULL.

Expected: the comment and log line describe what happens (or a disk fallback exists).

Dominant language
C
Stars
16
Forks
7
Avg merge
4h 56m
Merged PRs (30d)
194

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from c4punks/CWIST

All issues in c4punks/CWIST

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.