Listen: Allow tilde paths for socket.

This commit is contained in:
Maarten de Vries
2013-08-25 15:51:41 +02:00
committed by Max Kellermann
parent cf98b0e261
commit 08e6d222a2
5 changed files with 23 additions and 4 deletions

View File

@@ -27,6 +27,7 @@
#include "ConfigOption.hxx"
#include "event/ServerSocket.hxx"
#include "util/Error.hxx"
#include "fs/Path.hxx"
#include <string.h>
#include <assert.h>
@@ -64,8 +65,9 @@ listen_add_config_param(unsigned int port,
if (0 == strcmp(param->value, "any")) {
return listen_socket->AddPort(port, error_r);
} else if (param->value[0] == '/') {
return listen_socket->AddPath(param->value, error_r);
} else if (param->value[0] == '/' || param->value[0] == '~') {
Path path = config_parse_path(param, error_r);
return !path.IsNull() && listen_socket->AddPath(path.c_str(), error_r);
} else {
return listen_socket->AddHost(param->value, port, error_r);
}