Comments (4)
Thanks to ferreting around, reading up, and some experimentation I think I've found a fix - to allocate memory from the relevant Apache memory pool and copy the contentType to it.
A very useful clue was found in https://lists.gt.net/apache/users/375588
I've extracted the following text below:
"We developed an Apache module. In the module, when we sent HTTP
response, Apache always changed the "Content-Type", sometimes this field
is correct, sometime it is truncated, sometimes with an invalid value.
We sent response back with the following function, and the response
header was always set properly.
int our_module_handler(request_rec *r)
{
// process requests
// prepare response
ap_set_content_type(r, "application/user-config+xml");
ap_send_http_header(r);
ap_rwrite(..);
return OK;
}
We added some logs before and after the above calls, and found the
content-type is always right. However, sometimes (not always), in the
response sent by Apache server, Content-Type will be changed to
something like "application/user-config"
or
"application/user-config+xm"
, or some other values."
Followed by Eric's response which unlocked the clue for me:
"I suspect its your modules own misuse of r->pool
. Completely gut all
of your actual logic from your module and see if it still truncates
the header.
Or start with a new module that just sets the content type and prints
a canned response.
--
Eric Covener
[email protected]"
from kiwix-apache.
@julianharty Please check the ZIM file is not basically wrong (with zimdump) before assuming something is wrong in your code or in the code of the kiwix lib.
from kiwix-apache.
My initial test is contained in the following commit 766838e This seems to do the trick I next want to review the overall code of the module and start tidying it up since it's starting to get too messy and insufficiently modular.
from kiwix-apache.
I confirm it solves the content-type issue for me : good work!
from kiwix-apache.
Related Issues (15)
- Gameplan for implementing a ZIM module for Apache HOT 3
- Engineering: Improve the CB/CI/Testing of this codebase HOT 4
- Add support so administrators can specify the location and name of the zim file HOT 1
- Engineering: Integrate travis-ci build HOT 7
- Add handling of title dump when the article is a redirect. HOT 1
- Engineering: Integrate a pre-built kiwix-lib HOT 1
- Engineering: Investigate a C++ unit test framework and write at least 1 test to run HOT 1
- Engineering: Testing performance and reliability of the module HOT 14
- Feature: Random articles HOT 1
- Engineering: Implement integration/system tests HOT 2
- TBC: Provide an externally callable way to track usage HOT 3
- Build a deb package HOT 5
- Resolving licensing and permissions for kiwix-apache HOT 5
- Searched term specific address opening HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kiwix-apache.