From 69cde1cdeea0940598283758c6f099203f4d9d1d Mon Sep 17 00:00:00 2001 From: kelson42 Date: Fri, 29 Aug 2014 02:51:20 -0600 Subject: [PATCH] Small simplification of the code --- src/server/kiwix-serve.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/server/kiwix-serve.cpp b/src/server/kiwix-serve.cpp index 096ecb8..395af3f 100644 --- a/src/server/kiwix-serve.cpp +++ b/src/server/kiwix-serve.cpp @@ -305,8 +305,8 @@ static int accessHandlerCallback(void *cls, if (patternCorrespondingUrl.empty() && searcher != NULL) { const char* start = MHD_lookup_connection_value(connection, MHD_GET_ARGUMENT_KIND, "start"); const char* end = MHD_lookup_connection_value(connection, MHD_GET_ARGUMENT_KIND, "end"); - unsigned int startNumber = (start != NULL ? atoi(start) : 0); - unsigned int endNumber = (end != NULL ? atoi(end) : 25); + unsigned int startNumber = start != NULL ? atoi(start) : 0; + unsigned int endNumber = end != NULL ? atoi(end) : 25; /* Get the results */ pthread_mutex_lock(&searcherLock); @@ -317,13 +317,12 @@ static int accessHandlerCallback(void *cls, std::cerr << e.what() << std::endl; } pthread_mutex_unlock(&searcherLock); - - mimeType = "text/html; charset=utf-8"; } else { content = "\nFulltext search unavailable

Not Found

There is no article with the title \"" + patternString + "\" and the fulltext search engine is not available for this content.

"; - mimeType = "text/html"; httpResponseCode = MHD_HTTP_NOT_FOUND; } + + mimeType = "text/html; charset=utf-8"; } /* Display a random article */