diff options
author | Simon Rettberg | 2019-08-22 16:14:27 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-08-22 16:14:27 +0200 |
commit | 5fb4ef278be86fb6bda487f65ec4855d830bf4e5 (patch) | |
tree | f06c1ce5466b14bb4ff47dbd2939e11b8eedf6d0 /src/server/server.c | |
parent | [SERVER] Put request handle into CMD_ERROR reply (diff) | |
download | dnbd3-5fb4ef278be86fb6bda487f65ec4855d830bf4e5.tar.gz dnbd3-5fb4ef278be86fb6bda487f65ec4855d830bf4e5.tar.xz dnbd3-5fb4ef278be86fb6bda487f65ec4855d830bf4e5.zip |
[SERVER] Get rid of alt-servers thread, per-uplink rtt history
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.
Diffstat (limited to 'src/server/server.c')
-rw-r--r-- | src/server/server.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server/server.c b/src/server/server.c index 838aec2..640048a 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -121,9 +121,6 @@ void dnbd3_cleanup() // Disable threadpool threadpool_close(); - // Terminate the altserver checking thread - altservers_shutdown(); - // Terminate all uplinks image_killUplinks(); @@ -198,6 +195,11 @@ int main(int argc, char *argv[]) case LONGOPT_CRC4: return image_generateCrcFile( optarg ) ? 0 : EXIT_FAILURE; case LONGOPT_ASSERT: + printf( "Testing use after free:\n" ); + volatile char * volatile test = malloc( 10 ); + test[0] = 1; + free( test ); + test[1] = 2; printf( "Testing a failing assertion:\n" ); assert( 4 == 5 ); printf( "Assertion 4 == 5 seems to hold. ;-)\n" ); |