From e53dfcbdbed04cad690823ce5def521fea7b5483 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 12 Mar 2018 15:28:33 +0100 Subject: 4s timeout when connecting to server; send error to client on failure --- proxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'proxy.c') diff --git a/proxy.c b/proxy.c index 36f7cac..afb1bd8 100644 --- a/proxy.c +++ b/proxy.c @@ -809,7 +809,6 @@ static void response_replaceAttribute(server_t *server, const struct string * co */ static BOOL response_filterHomeDir(struct PartialAttributeList *pal) { - helper_printpal(pal); for (struct AttributeDescriptionList *adl = pal->values; adl != NULL; adl = pal->values /* sic */) { if (adl->a.s != NULL) { if (adl->a.l > 0 && adl->a.s[0] == '\\') { @@ -904,6 +903,7 @@ static BOOL proxy_clientSearchRequest(epoll_client_t *client, const unsigned lon if (pending == NULL) { plog(DEBUG_WARNING, "Cannot handle incoming client request; too many pending requests on the wire."); free_ldapsearchrequest(&req); + client_searchResultError(client, messageId, busy, "I'm busy!"); return FALSE; } // In case of anonymous bind: Narrow down list of what the user can see to protect private data @@ -935,7 +935,7 @@ static BOOL proxy_clientSearchRequest(epoll_client_t *client, const unsigned lon pending->serverMessageId = server_searchRequestOnConnection(client->fixedServer, &req); } if (pending->serverMessageId == 0) { - // Failed to forward.. TODO: Fail client + client_searchResultError(client, messageId, unavailable, "Cannot contact upstream server."); plog(DEBUG_WARNING, "Failed to forward a search request to server."); pending->client = NULL; } -- cgit v1.2.3-55-g7522