Emit isLast onData cb if we have no data
This commit is contained in:
@@ -174,10 +174,14 @@ private:
|
|||||||
std::terminate();
|
std::terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we have not responded and we have a data handler, we need to timeout to enfore client sending the data */
|
||||||
|
|
||||||
|
|
||||||
/* Continue parsing */
|
/* Continue parsing */
|
||||||
return s;
|
return s;
|
||||||
|
|
||||||
}, [httpResponseData](void *user, std::string_view data, bool fin) -> void * {
|
}, [httpResponseData](void *user, std::string_view data, bool fin) -> void * {
|
||||||
|
/* We always get an empty chunk even if there is no data */
|
||||||
if (httpResponseData->inStream) {
|
if (httpResponseData->inStream) {
|
||||||
httpResponseData->inStream(data, fin);
|
httpResponseData->inStream(data, fin);
|
||||||
|
|
||||||
|
|||||||
@@ -174,6 +174,9 @@ private:
|
|||||||
length -= emittable;
|
length -= emittable;
|
||||||
consumedTotal += emittable;
|
consumedTotal += emittable;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
/* Still emit an empty data chunk to signal no data */
|
||||||
|
dataHandler(user, {}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CONSUME_MINIMALLY) {
|
if (CONSUME_MINIMALLY) {
|
||||||
|
|||||||
Reference in New Issue
Block a user