From 7f031811956fad81fe1890aa4bc11271a67ad872 Mon Sep 17 00:00:00 2001 From: kelson42 Date: Tue, 19 Jan 2010 10:52:19 +0000 Subject: [PATCH] + small imp --- src/server/kiwix-serve.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/server/kiwix-serve.cpp b/src/server/kiwix-serve.cpp index 1a0a2e6..bc3b76b 100644 --- a/src/server/kiwix-serve.cpp +++ b/src/server/kiwix-serve.cpp @@ -77,7 +77,7 @@ static int accessHandlerCallback(void *cls, } title[titleOffset] = 0; - /* Mutext lock */ + /* Mutex lock */ pthread_mutex_lock(&lock); /* Load the article from the ZIM file */ @@ -106,17 +106,18 @@ static int accessHandlerCallback(void *cls, /* Get the content mime-type */ mimeType = article.getMimeType(); cout << "mimeType: " << mimeType << endl; + } else { /* The found article is not the good one */ content=""; contentLength = 0; - cout << ns << "/" << title << "not found." << endl; + cout << ns << "/" << title << "not found." << endl; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } - /* Mutext unlock */ + /* Mutex unlock */ pthread_mutex_unlock(&lock); /* clear context pointer */ @@ -151,7 +152,7 @@ int main(int argc, char **argv) { string zimPath = (argv[1]); int port = atoi(argv[2]); - void *page = strdup("42222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222"); + void *page; /* Start the HTTP daemon */ daemon = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION, @@ -175,7 +176,7 @@ int main(int argc, char **argv) { exit(1); } - /* Mutext init */ + /* Mutex init */ pthread_mutex_init(&lock, NULL); /* Run endless */ @@ -184,7 +185,7 @@ int main(int argc, char **argv) { /* Stop the daemon */ MHD_stop_daemon(daemon); - /* Mutext destroy */ + /* Mutex destroy */ pthread_mutex_destroy(&lock); exit(0);