summaryrefslogtreecommitdiffstats
path: root/src/server/server.c
Commit message (Collapse)AuthorAgeFilesLines
* [SERVER] Make signal handling more POSIXSimon Rettberg2019-08-281-5/+17
| | | | | | | | | | | | | | | According to POSIX, a signal sent to a PID can be delivered to an arbitrary thread of that process that hasn't the signal blocked. This seens to never happen on Linux, but would mess things up since the code expected the main signal handler to only be executed by the main thread. This should now be fixed by examining the destination PID of the signal as well as the ID of the thread currently running the signal handler. If we notice the signal wasn't sent by our own PID and the handler is not currently run by the main thread, we re-send the signal to the main thread. Otherwise, if the signal was sent by our own PID but the handler is not run in the main thread, do nothing. This way we can use pthread_kill() to wake up threads that might be stuck in a blocking syscall when it's time to shut down.
* [SERVER] Add timer infrastructureSimon Rettberg2019-08-271-9/+133
| | | | To be used by "close unused fd" checks, and others...
* [SERVER] Fix warnings, simplify lockingSimon Rettberg2019-08-261-1/+1
|
* [SERVER] Get rid of alt-servers thread, per-uplink rtt historySimon Rettberg2019-08-221-3/+5
| | | | | | | | | | Alt-Server checks are now run using the threadpool, so we don't need a queue and dedicated thread anymore. The rtt history is now kept per uplink, so many uplinks won't overwhelm the history, making its time window very short. Also the fail counter is now split up; a global one for when the server actually isn't reachable, a local (per-uplink) one for when the server is reachable but doesn't serve the requested image.
* [SERVER] Better lock debugging: Always check lock orderSimon Rettberg2019-08-071-7/+0Star
| | | | | | Lock order is predefined in locks.h. Immediately bail out if a lock with lower priority is obtained while the same thread already holds one with higher priority.
* [SERVER] Reload server config on SIGHUPSimon Rettberg2018-07-101-0/+1
| | | | | | | Most config settings can now be changed at runtime using SIGHUP. This currently excludes the basePath, listenPort, and the client and image count limits, as well as vmdkLegacyMode.
* [SERVER] Refactor uplink/cache handling, improve crc checkingSimon Rettberg2018-07-041-1/+1
| | | | | | | | | | | | | The cacheFd is now moved to the uplink data structure and will only be handled by the uplink thread. The integrity checker now supports checking all blocks of an image. This will be triggered automatically whenever a check for a single block failed. Also, if a crc check on startup fails, the image won't be discarded anymore, but rather a full check will be initiated. Furthermore, when calling image_updateCacheMap() on an image that was previously complete, the cache map will now be re-initialized, and a new uplink connection created.
* [SERVER] Print info about signal senderSimon Rettberg2018-05-031-5/+46
|
* [SERVER] Proper exit code and message when shutting down due to error or signalSimon Rettberg2018-04-271-2/+6
|
* [SERVER] Ignore SIGPIPESimon Rettberg2018-04-101-0/+1
|
* [SERVER] Add --errormsg to only serve HTTP-JSON error codeSimon Rettberg2017-11-021-29/+51
| | | | | This could have been an external tool, but this didn't add much code and has the benefit of honoring the config file for port and bind address.
* [SERVER] Clean up arguments, show version on startupSimon Rettberg2017-11-021-13/+8Star
|
* [SERVER] Add AFL supportSimon Rettberg2017-10-301-3/+36
| | | | | | | | | | | AFL is an instrumenting fuzzer. It expects to pass input to the program to be tested via command line (file name) or via stdin. This adds support for reading messages that normally would arrive via network directly from stdin. In this mode, the server is pretty useless otherwise. http://lcamtuf.coredump.cx/afl/
* [SERVER] Missed occurence of AF_INET(6) -> HOST_IP[46]Simon Rettberg2017-10-301-3/+6
|
* [SERVER] Fix types or add explicit casts everywhere we might have type ↵Simon Rettberg2017-10-241-1/+1
| | | | conversion problems
* [SERVER] Use monotonic clock for measuring timeSimon Rettberg2017-10-191-4/+8
| | | | | Introduces new shared source unit timing.[ch] Closes #3214
* [SERVER] Refactor: Move client list to net.* and isolateSimon Rettberg2017-09-071-125/+15Star
|
* [SERVER] Fix formattingSimon Rettberg2016-03-221-15/+15
|
* dnbd3server build success on freebsd :)Sebastian2016-02-111-10/+15
|
* cleanup commitsSebastian2016-02-111-18/+10Star
|
* [SERVER] Fix a lot of (mostly harmless) data racesSimon Rettberg2016-01-111-7/+6Star
|
* [SERVER] Cancel scanning of image dir if _shutdown is setSimon Rettberg2015-12-161-2/+4
| | | | So you can cancel image loading on startup via Ctrl-C
* [SERVER] More fine grained locking for RPC; better error loggingSimon Rettberg2015-12-161-1/+6
|
* [SERVER] Make listen port configurableSimon Rettberg2015-12-141-1/+1
|
* [SERVER] Free memory on exit to get new valgrind high scoreSimon Rettberg2015-12-141-1/+4
|
* [SERVER] Update includes for moved log.hSimon Rettberg2015-12-021-1/+1
|
* [FUSE] Mid-refactoring, does not compileSimon Rettberg2015-11-241-1/+1
|
* [SERVER] Reload images in another thread when triggered by signalSimon Rettberg2015-05-121-6/+12
| | | | | | | The server used to reload all images on the main thread, which is also responsible for accepting connections. While reloading the list, no new connections were accepted, which lead to clients marking the server as bad during their RTT measurements, then switching away from it.
* [Server] Added statistics of images and uptime to json.Stephan Schwaer2015-05-051-1/+0Star
|
* Removed dnbd3_printClients, added clients to statistics json in rpc.Stephan Schwaer2015-05-041-15/+0Star
|
* [SERVER] Added counters for received and sent bytes.Stephan Schwaer2015-04-271-1/+3
|
* [SERVER] printf -> logadd, make USR2 trigger a log cycle, remove old fake ↵Simon Rettberg2015-02-231-34/+20Star
| | | | delay feature
* [SERVER] Overhauled loggingSimon Rettberg2015-02-221-21/+18Star
| | | | | | - Added message type parameter - Log to file and stdout, no more logging in memory - Added options to server.conf to filter which messages show up where
* [SERVER] Set client connection timeout in client threadSimon Rettberg2015-01-071-2/+0Star
|
* [SERVER] Big code cleanup, refactoring, minor bugfixingSimon Rettberg2015-01-061-52/+51Star
|
* [SERVER] Use a thread pool for client connectionsSimon Rettberg2015-01-051-7/+7
|
* [SERVER] Use stdbool.h for booleans; minor refactoring of variable and ↵Simon Rettberg2014-12-311-15/+15
| | | | function names
* [SERVER] Minor tweaks and improvementsSimon Rettberg2014-12-311-2/+2
|
* [SERVER] Configurable client timeout, adaptive replication speed (to be ↵Simon Rettberg2014-12-221-2/+2
| | | | tested against varying bw/latency), retry sendfile call if ret <= len
* Improve uplink handling, add code to debug thread creation/destruction, ↵Simon Rettberg2014-06-161-5/+6
| | | | change stupid convention of freeDiskSpace returning 0 on error, which is ambiguous to the disk simply being full...
* [SERVER] Thread and uplink handlingSimon Rettberg2014-02-131-4/+3Star
|
* [*] Add automatic version string generationv2.0Simon Rettberg2014-01-131-0/+1
|
* [SERVER] Don't wait forever on shutdownSimon Rettberg2014-01-131-1/+2
|
* [SERVER] SIGHUP triggers reload aswell. Some changes to server shutdown ↵Simon Rettberg2014-01-021-21/+18Star
| | | | function.
* [SERVER] Fix possible deadlock through printf usage in signal handlerSimon Rettberg2013-12-101-15/+21
|
* [SERVER] Once again rework locking in uplink and freeing of resources to ↵Simon Rettberg2013-11-151-1/+1
| | | | fight messups when the uplink is shut down
* [SERVER] Create client threads detached instead of detaching them after ↵Simon Rettberg2013-11-141-5/+4Star
| | | | creation to prevent a race condition where a thread dies faster than we can call pthread_detach, which leads to a use-after-free
* [SERVER] Shut down altservers finder properlySimon Rettberg2013-11-121-0/+2
|
* Joey style commitSimon Rettberg2013-11-071-1/+1
|
* [SERVER] Add --bind parameter to specify bind interface (currently IPv4 only)Simon Rettberg2013-11-071-2/+8
|