loentar / ngrest

Fast and easy C++ RESTful WebServices framework
Apache License 2.0
465 stars 94 forks source link

Incomplete response via Apache #77

Closed MG-Sika closed 2 years ago

MG-Sika commented 2 years ago

Hi, I am using ngrest with apache2, and I've the following problem. One GET call response, a huge string (354222 byte) but only 313755 bytes are returned to the response. I am not sure where the issues come from, ngrest or apache2 or hardware.

Do you have any hint for me to solve the problem?

API definition: // location: /getData // inlineResult: true // *method: GET
std::string getData();

API implementation: std::string ngrest::getData(){ std::string data = "Big data"; return data; }

Br Maurice

loentar commented 2 years ago

The problem could be in apache module. I tried to send 500kb string using ngrest script. works fine

MG-Sika commented 2 years ago

Thank you very much. Now it works sometimes. Without known changes. I'll report the solution if it is solved.

MG-Sika commented 2 years ago

I have found the issue. I have build a preSend function to modify the response. In the function there was a bug by handling the chunks, if more than one chunk was transmitted the function fail.