return;
}
- debugs(33, 4, "Received " << receivedData.length <<
- " object data, offset: " << receivedData.offset <<
- " error flag:" << receivedData.flags.error);
+ const int64_t existingContent = reply ? reply->content_length : 0;
+ const size_t maxSize = MaxObjectSize > SBuf::maxSize ? SBuf::maxSize : MaxObjectSize;
+ const bool tooLarge = (existingContent > -1 && existingContent > static_cast<int64_t>(maxSize)) ||
+ (maxSize < object_.length()) ||
+ ((maxSize - object_.length()) < receivedData.length);
- if (receivedData.length > 0) {
- object.append(receivedData.data, receivedData.length);
- http->out.size += receivedData.length;
- http->out.offset += receivedData.length;
+ if (tooLarge) {
+ callBack(Http::scInternalServerError);
+ return;
}
- switch (clientStreamStatus (node, http)) {
- if (receivedData.length) {
- object_.append(receivedData.data, receivedData.length);
- http->out.size += receivedData.length;
- http->out.offset += receivedData.length;
- }
++ object_.append(receivedData.data, receivedData.length);
++ http->out.size += receivedData.length;
++ http->out.offset += receivedData.length;
+
+ switch (clientStreamStatus(node, http)) {
case STREAM_NONE: {
- debugs(33, 3, HERE << "Get more data");
+ debugs(33, 3, "Get more data");
StoreIOBuffer tempBuffer;
tempBuffer.offset = http->out.offset;
tempBuffer.data = context_->requestBuffer;
Ssl::ServerBio *srvBio = static_cast<Ssl::ServerBio *>(b->ptr);
// Parse Certificate. Assume that it is in DER format.
++ // According to RFC 4325:
++ // The server must provide a DER encoded certificate or a collection
++ // collection of certificates in a "certs-only" CMS message.
++ // The applications MUST accept DER encoded certificates and SHOULD
++ // be able to accept collection of certificates.
++ // TODO: support collection of certificates
const unsigned char *raw = (const unsigned char*)obj.rawContent();
if (X509 *cert = d2i_X509(NULL, &raw, obj.length())) {
char buffer[1024];