mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-24 04:20:56 -04:00
+ small simplification of the code
This commit is contained in:
parent
ce0fe47daf
commit
965968e38f
@ -239,7 +239,6 @@ static int accessHandlerCallback(void *cls,
|
|||||||
if (reader == NULL) {
|
if (reader == NULL) {
|
||||||
humanReadableBookId="";
|
humanReadableBookId="";
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_mutex_unlock(&mapLock);
|
pthread_mutex_unlock(&mapLock);
|
||||||
|
|
||||||
/* Get suggestions */
|
/* Get suggestions */
|
||||||
@ -330,10 +329,9 @@ static int accessHandlerCallback(void *cls,
|
|||||||
/* Display a random article */
|
/* Display a random article */
|
||||||
else if (!strcmp(url, "/random")) {
|
else if (!strcmp(url, "/random")) {
|
||||||
cacheEnabled = false;
|
cacheEnabled = false;
|
||||||
std::string randomUrl;
|
|
||||||
if (reader != NULL) {
|
if (reader != NULL) {
|
||||||
pthread_mutex_lock(&readerLock);
|
pthread_mutex_lock(&readerLock);
|
||||||
randomUrl = reader->getRandomPageUrl();
|
std::string randomUrl = reader->getRandomPageUrl();
|
||||||
pthread_mutex_unlock(&readerLock);
|
pthread_mutex_unlock(&readerLock);
|
||||||
httpRedirection = "/" + humanReadableBookId + "/" + randomUrl;
|
httpRedirection = "/" + humanReadableBookId + "/" + randomUrl;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user