Commit Graph

23 Commits

Author SHA1 Message Date
71c0670d7f Enhance WebSocket handling: remove socket timeout, improve frame creation, and update test page UI 2025-12-11 21:08:15 +01:00
5d32e8c2e0 Fix potential buffer overflow in log_hexdump function 2025-12-11 20:17:52 +01:00
1b83097f00 Refactor logging system and enhance Dockerfile configuration
- Introduced a new logging system with configurable log levels and categories.
- Added support for different log formats: plain text, JSON, and syslog.
- Updated Dockerfile to use Alpine 3.19 and improved build process.
- Enhanced server configuration to replace verbose logging with log modes (off, classic, debug, advanced).
- Improved security measures in SSL context configuration.
- Added health checks and resource limits in docker-compose.yml.
- Refactored Makefile to include new logging source files.
- Updated server configuration to set default log file path and SSL certificate paths.
- Enhanced performance tracking and logging capabilities.
- Added hex dump utility for debugging binary data.
2025-12-11 20:04:54 +01:00
200cc8ad7f Implement dynamic rate limiting and ETag support for conditional requests 2025-11-25 17:10:14 +01:00
729844a13c Added gzip compression support to file caching mechanism (can be broken idk we will see) 2025-11-24 21:22:16 +01:00
88fee91088 Develop (#13)
* Refactor carbon-server service in docker-compose.yml to use pre-built image and remove unnecessary build context and volume mounts

* Enhance performance and security features:
- Update compiler flags for better optimization and security.
- Implement MIME type caching for improved response handling.
- Introduce worker thread pool for efficient connection management.
- Optimize socket settings for low latency and enhanced performance.
- Add support for CPU affinity in worker threads.
- Implement graceful shutdown for worker threads during cleanup.

* Optimize HTTP response handling and increase request limits for improved performance

* Add gzip compression support for HTTP responses

* Implement Keep-Alive support for HTTP connections with timeout handling
Why is it not merging like this huh
2025-11-24 20:03:01 +00:00
b9ffe8bd27 Develop (#12)
* Refactor carbon-server service in docker-compose.yml to use pre-built image and remove unnecessary build context and volume mounts

* Enhance performance and security features:
- Update compiler flags for better optimization and security.
- Implement MIME type caching for improved response handling.
- Introduce worker thread pool for efficient connection management.
- Optimize socket settings for low latency and enhanced performance.
- Add support for CPU affinity in worker threads.
- Implement graceful shutdown for worker threads during cleanup.

* Optimize HTTP response handling and increase request limits for improved performance

* Add gzip compression support for HTTP responses
2025-11-24 19:57:52 +00:00
00424ae05e Develop (#10)
* Refactor carbon-server service in docker-compose.yml to use pre-built image and remove unnecessary build context and volume mounts

* Enhance performance and security features:
- Update compiler flags for better optimization and security.
- Implement MIME type caching for improved response handling.
- Introduce worker thread pool for efficient connection management.
- Optimize socket settings for low latency and enhanced performance.
- Add support for CPU affinity in worker threads.
- Implement graceful shutdown for worker threads during cleanup.

* Optimize HTTP response handling and increase request limits for improved performance
2025-11-24 19:04:52 +00:00
9535e0d2c8 Develop (#9)
* Refactor carbon-server service in docker-compose.yml to use pre-built image and remove unnecessary build context and volume mounts

* Enhance performance and security features:
- Update compiler flags for better optimization and security.
- Implement MIME type caching for improved response handling.
- Introduce worker thread pool for efficient connection management.
- Optimize socket settings for low latency and enhanced performance.
- Add support for CPU affinity in worker threads.
- Implement graceful shutdown for worker threads during cleanup.
2025-11-24 18:10:38 +00:00
1c3c31a7b8 Add Dockerfile and docker-compose.yml for containerized setup; create .dockerignore (#6) 2025-11-03 14:32:17 +01:00
2c74ed2b0c Update Makefile to create bin directory and adjust object file paths; add initial Dockerfile 2025-11-03 11:38:35 +01:00
c588d560d7 fix: Add critical memory safety and error handling improvements
- Add NULL checks after malloc() calls in HTTP/HTTPS thread creation
- Add error checking for fcntl() calls to prevent silent failures
- Add integer overflow protection in WebSocket frame handling
- Improve socket option error handling with proper validation
- Add SIZE_MAX check in ws_send_frame to prevent overflow

These fixes address potential crashes and security issues in high-load
scenarios and improve overall robustness of the server.
2025-11-02 13:11:07 +01:00
01874b0e5a Enhance error handling for HTTP/2 file size, validate mmap cache entries, improve WebSocket connection handling, enforce maximum URI length, and limit WebSocket payload size. 2025-11-02 12:22:12 +01:00
636b221d62 Test verified commit" 2025-11-01 23:47:05 +01:00
301d408647 tst 2025-11-01 23:38:17 +01:00
7c555b5cb9 tst 2025-11-01 23:31:15 +01:00
2fc7edf37d Validate input parameters and enhance error handling in configuration loading, task queue management, SSL initialization, and WebSocket handshake processes. 2025-11-01 23:20:01 +01:00
72df6a73fc Enhance server ssl configuration
- Added SSL certificate and key paths to ServerConfig structure.
- Updated init_config function to initialize new SSL paths.
- Formated code for better readability.
2025-10-05 17:35:00 +00:00
46b653efe0 Enhance server configuration and performance optimizations
- Added max_connections option to server configuration
- Updated Makefile to include performance.c and related headers
- Implemented memory-mapped file caching and buffer pooling for improved performance
- Refactored config parser to handle new configuration options
- Increased maximum request size and optimized file handling
2025-10-03 22:08:55 +00:00
b5a30a5268 Add www_path configuration option and update related parsing logic 2025-10-03 21:10:16 +00:00
e93e65f882 Refactor config parsing to use a switch statement for improved readability and maintainability 2025-10-03 08:56:32 +00:00
a2c4617493 Implement HTTP/2 and WebSocket support; remove legacy JavaScript and CSS files
- Added HTTP/2 support in src/http2.c and src/http2.h, including session management, frame handling, and response sending.
- Introduced WebSocket functionality in src/websocket.c and src/websocket.h, covering handshake, frame parsing, and message sending.
- Created a WebSocket test page (www/websocket-test.html) for client-side interaction.
- Removed outdated JavaScript (www/script.js) and CSS (www/style.css) files.
2025-10-02 21:14:23 +00:00
c9ac352bb4 Refactor server configuration management
- Removed old server configuration files (server.json, server.log, server_config.c, server_config.h).
- Introduced a new configuration file (server.conf) with a more structured format.
- Implemented a configuration parser (config_parser.c) to read and apply settings from server.conf.
- Updated server logic to utilize the new configuration structure.
- Enhanced logging functionality and added rate limiting features.
- Improved error handling and security measures in request processing.
2025-10-02 18:57:05 +00:00