Small POSIX server/client project that computes the SHA-256 digest of files on request.
- Communication via named pipes (FIFOs)
- Server uses a master thread and a worker thread pool (pthreads)
- Duplicate requests for the same file are aggregated and served together
- Results are cached to avoid recomputation when the file has not changed
- Client sends a pathname and receives the SHA-256 hex string
mkdir build && cd build
cmake ..
makeRequires OpenSSL development headers.
Start the server (creates /tmp/fifo_server_SHA256):
./serverIn another shell run a client:
./client /path/to/fileThe client creates a FIFO /tmp/fifo_client_SHA256.<PID> and receives a Response struct containing the hash (or an error code).
$ ./client test.bin
SHA-256(/home/user/test.bin) = 7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069
src/server.c— server implementationsrc/client.c— client implementationsrc/request_response.c— error helpersrc/errExit.c— error exit helperinclude/request_response.h— shared structs and error codes
See docs/Architecture.md for details on design, synchronization, and caching.
This project is licensed under the MIT License — see the LICENSE file for details.