* FIXED: kiwix-serve crahs if really long URL (#400)

This commit is contained in:
kelson42 2013-02-12 18:55:09 +00:00
parent a861e378af
commit 581362a43a

View File

@ -211,6 +211,7 @@ static int accessHandlerCallback(void *cls,
/* Display the search restults */ /* Display the search restults */
else if (!strcmp(url, "/search")) { else if (!strcmp(url, "/search")) {
/* Retrieve the pattern to search */ /* Retrieve the pattern to search */
const char* pattern = MHD_lookup_connection_value(connection, MHD_GET_ARGUMENT_KIND, "pattern"); const char* pattern = MHD_lookup_connection_value(connection, MHD_GET_ARGUMENT_KIND, "pattern");
if (pattern == NULL) if (pattern == NULL)
@ -264,7 +265,6 @@ static int accessHandlerCallback(void *cls,
pthread_mutex_lock(&readerLock); pthread_mutex_lock(&readerLock);
try { try {
found = reader->getContentByUrl(urlStr, content, contentLength, mimeType); found = reader->getContentByUrl(urlStr, content, contentLength, mimeType);
if (found) { if (found) {
if (isVerbose()) { if (isVerbose()) {
cout << "Found " << urlStr << endl; cout << "Found " << urlStr << endl;