Binary content do not need to be modified, so we don't need to copy it.
We can directly serve it from the internal zim (cluster) buffer.
The handle_content function now getArticleObjectByDecodedUrl instead of
getContentByDecodedUrl.
This is to get the mimetype of the article and copy the content only when
needed (getContentByDecodedUrl always copy the content).
Thus, handle_content is a bit more complex as it need to do some
manipulation previously made in getContentByDecodedUrl.
The main change is that if the content is binary, we serve the content
with a callback response who will get the content chunks directly from
the blob buffer.
Instead of having a big callback function doing almost everything to
handle a request, we split the code into several functions.
There are two new helper functions :
- build_response that create a response object with correct headers set.
- compress_content who compress the content if necessary.
All the different cases are handle by different functions :
- handle_suggest
- handle_skin
- handle_search
- handle_random
- handle_content
- handle_default
accesHandlerCallback now handle common stuff, delegate to the handle_*
functions everything else.
There is no special optimization made here. Only splitting code.
- kiwix-search will try the embedded ft-index if no indexPath is specified
in the library.xml or command argument.
- kiwix-search also uses xapianSearcher and xapianSearcher needs zimlib,
so add zimlib in compilation flag for searcher.
- kiwix-serve already depends on zimlib.
* origin/master:
Reformat project
Remove html-inverting js
Organize files in packages
The actionbar title is now clickable
Added persistent fullscreen
Added persistent fullscreen
Add 'sc' and 'lki' UI languages
Update of the UI translations
Update meta data of custom Android apps
Add VAR HTTP-HEADER if necessary
Make the app movable to the sd card
Update UI translations
Windows FSJ-Lite ZIM file splitter is not available anymore, replace it in the help with 'JS-SplitD'
Beautify bookmark XML file
Fix selection color problem with library buttons
Revised the instructions for OS X
Bump up Android version