MCPcopy Create free account
hub / github.com/catboost/catboost / BuildOutputStream

Method BuildOutputStream

library/cpp/http/io/stream.cpp:764–789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

762 }
763
764 inline void BuildOutputStream() {
765 if (CanBeKeepAlive()) {
766 AddOrReplaceHeader(THttpInputHeader("Connection", "Keep-Alive"));
767 } else {
768 AddOrReplaceHeader(THttpInputHeader("Connection", "Close"));
769 }
770
771 if (IsHttpResponse()) {
772 if (Request_ && IsCompressionEnabled() && HasResponseBody()) {
773 TString scheme = Request_->BestCompressionScheme(ComprSchemas_);
774 if (scheme != "identity") {
775 AddOrReplaceHeader(THttpInputHeader("Content-Encoding", scheme));
776 RemoveHeader("Content-Length");
777 }
778 }
779
780 RebuildStream();
781 } else {
782 if (IsCompressionEnabled()) {
783 AddOrReplaceHeader(THttpInputHeader("Accept-Encoding", BuildAcceptEncoding()));
784 }
785 if (HasRequestBody()) {
786 RebuildStream();
787 }
788 }
789 }
790
791 inline TString BuildAcceptEncoding() const {
792 TString ret;

Callers

nothing calls this directly

Calls 2

THttpInputHeaderClass · 0.85
BestCompressionSchemeMethod · 0.80

Tested by

no test coverage detected