Commit 26a84eb4 authored by jan.koester's avatar jan.koester
Browse files

test

parent 9e99b3ca
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -3464,7 +3464,17 @@ libhttppp::HttpResponse::HttpResponse() : HttpHeader(){
  _TransferEncoding=nullptr;
}

libhttppp::HttpResponse::HttpResponse(const HttpResponse &src) : HttpResponse(){
libhttppp::HttpResponse::HttpResponse(const HttpResponse &src) : HttpHeader(){
  // Deliberately does NOT delegate to HttpResponse() -- that default ctor
  // unconditionally seeds "content-length: 0"/"connection: keep-alive"
  // placeholders and leaves _ContentType null, on the assumption a fresh
  // response is about to be built up via the setters below. Delegating to
  // it here meant copying a source that defines its own Content-Length or
  // Connection appended a second value onto that placeholder's HeaderData
  // instead of replacing it, and _ContentType was never pointed at the
  // copy's own copied node at all -- getContentType() on any copied
  // HttpResponse (e.g. HttpClient::_lastResponse, see _h1ReadResponse)
  // returned "" even when the header list it held had the real value.
  _State = src._State;
  _Version = src._Version;
  _StatusCode = src._StatusCode;
@@ -3474,6 +3484,10 @@ libhttppp::HttpResponse::HttpResponse(const HttpResponse &src) : HttpResponse(){
      newdat->push_back(curval->getvalue());
    }
  }
  _ContentLength    = getHeaderData("content-length");
  _Connection       = getHeaderData("connection");
  _ContentType      = getHeaderData("content-type");
  _TransferEncoding = getHeaderData("transfer-encoding");
}

void libhttppp::HttpResponse::setState(const std ::string &httpstate){