| 210 | } |
| 211 | |
| 212 | int HttpClientConnection::onBody(const char* at, size_t length) |
| 213 | { |
| 214 | if(incomingRequest == nullptr) { |
| 215 | // nothing to process right now... |
| 216 | return 1; |
| 217 | } |
| 218 | |
| 219 | if(incomingRequest->requestBodyDelegate) { |
| 220 | return incomingRequest->requestBodyDelegate(*this, at, length); |
| 221 | } |
| 222 | |
| 223 | if(response.buffer != nullptr) { |
| 224 | auto res = response.buffer->write((const uint8_t*)at, length); |
| 225 | if(res != length) { |
| 226 | // unable to write the requested bytes - stop here... |
| 227 | response.freeStreams(); |
| 228 | return 1; |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | return 0; |
| 233 | } |
| 234 | |
| 235 | void HttpClientConnection::onReadyToSendData(TcpConnectionEvent sourceEvent) |
| 236 | { |
no test coverage detected