Common code base for all Kiwix ports
Go to file
Matthieu Gautier 82cba79179 Do not make unnecessary copy when serving binary content.
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.
2016-10-07 18:23:47 +02:00
src/common Do not make unnecessary copy when serving binary content. 2016-10-07 18:23:47 +02:00
static give some margin (ahah) for the margin to be eaten up 2015-03-02 15:03:30 +00:00