diff options
author | Simon Rettberg | 2017-11-01 21:54:41 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-11-01 21:54:41 +0100 |
commit | da3ee11ff01afb58d7572dfbf7eda6e61a169986 (patch) | |
tree | 1b6882d2f459e2389628d789cd18b4a272d8e75d | |
parent | [SERVER] Since fuse client assumed no backwards compat before v3, lie to clients (diff) | |
download | dnbd3-da3ee11ff01afb58d7572dfbf7eda6e61a169986.tar.gz dnbd3-da3ee11ff01afb58d7572dfbf7eda6e61a169986.tar.xz dnbd3-da3ee11ff01afb58d7572dfbf7eda6e61a169986.zip |
[SERVER] rpc: Remove old TODO, set thread name for persistent connections
-rw-r--r-- | src/server/rpc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/rpc.c b/src/server/rpc.c index f01121c..3ad8369 100644 --- a/src/server/rpc.c +++ b/src/server/rpc.c @@ -94,7 +94,6 @@ void rpc_init() void rpc_sendStatsJson(int sock, dnbd3_host_t* host, const void* data, const int dataLen) { - // TODO Parse Connection-header sent by client to see if keep-alive is supported bool ok; int keepAlive = HTTP_KEEPALIVE; int permissions = getacl( host ); @@ -108,6 +107,7 @@ void rpc_sendStatsJson(int sock, dnbd3_host_t* host, const void* data, const int memcpy( headerBuf, data, dataLen ); } size_t hoff = dataLen; + bool hasName = false; do { // Read request from client struct phr_header headers[100]; @@ -180,6 +180,10 @@ void rpc_sendStatsJson(int sock, dnbd3_host_t* host, const void* data, const int memmove( headerBuf, headerBuf + consumed, extra ); } hoff = extra; + if ( !hasName ) { + hasName = true; + setThreadName( "HTTP" ); + } } while (true); } |