diff options
| author | agri <[email protected]> | 2022-02-10 16:48:12 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:48:12 +0300 | 
| commit | d3530b2692e400bd4d29bd4f07cafaee139164e7 (patch) | |
| tree | b7ae636a74490e649a2ed0fdd5361f1bec83b9f9 /library/cpp/http/io | |
| parent | 0f4c5d1e8c0672bf0a1f2f2d8acac5ba24772435 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/http/io')
| -rw-r--r-- | library/cpp/http/io/stream.cpp | 52 | ||||
| -rw-r--r-- | library/cpp/http/io/stream.h | 8 | 
2 files changed, 30 insertions, 30 deletions
| diff --git a/library/cpp/http/io/stream.cpp b/library/cpp/http/io/stream.cpp index 6689be684fc..083a531b317 100644 --- a/library/cpp/http/io/stream.cpp +++ b/library/cpp/http/io/stream.cpp @@ -145,7 +145,7 @@ public:          , HasContentLength_(false)          , ContentLength_(0)          , ContentEncoded_(false) -        , Expect100Continue_(false) +        , Expect100Continue_(false)       {          BuildInputChain();          Y_ASSERT(Input_); @@ -204,10 +204,10 @@ public:          return HasContentLength_ || ChunkedInput_;      } -    inline bool HasExpect100Continue() const noexcept { -        return Expect100Continue_; -    } - +    inline bool HasExpect100Continue() const noexcept {  +        return Expect100Continue_;  +    }  +   private:      template <class Operation>      inline size_t Perform(size_t len, const Operation& operation) { @@ -324,14 +324,14 @@ private:                      }                  }                  [[fallthrough]]; -                HEADERCMP(header, "expect") { -                    auto findContinue = [&](const TStringBuf& s) { +                HEADERCMP(header, "expect") {  +                    auto findContinue = [&](const TStringBuf& s) {                           if (strnicmp(s.data(), "100-continue", 13) == 0) { -                            Expect100Continue_ = true; -                        } -                    }; -                    ForEach(header.Value(), findContinue); -                } +                            Expect100Continue_ = true;  +                        }  +                    };  +                    ForEach(header.Value(), findContinue);  +                }                   break;              }          } @@ -386,7 +386,7 @@ private:      ui64 ContentLength_;      bool ContentEncoded_; -    bool Expect100Continue_; +    bool Expect100Continue_;   };  THttpInput::THttpInput(IInputStream* slave) @@ -452,10 +452,10 @@ bool THttpInput::HasContent() const noexcept {      return Impl_->HasContent();  } -bool THttpInput::HasExpect100Continue() const noexcept { -    return Impl_->HasExpect100Continue(); -} - +bool THttpInput::HasExpect100Continue() const noexcept {  +    return Impl_->HasExpect100Continue();  +}  +   class THttpOutput::TImpl {      class TSizeCalculator: public IOutputStream {      public: @@ -512,11 +512,11 @@ public:      inline ~TImpl() {      } -    inline void SendContinue() { -        Output_->Write("HTTP/1.1 100 Continue\r\n\r\n"); -        Output_->Flush(); -    } - +    inline void SendContinue() {  +        Output_->Write("HTTP/1.1 100 Continue\r\n\r\n");  +        Output_->Flush();  +    }  +       inline void Write(const void* buf, size_t len) {          if (Finished_) {              ythrow THttpException() << "can not write to finished stream"; @@ -954,10 +954,10 @@ bool THttpOutput::CanBeKeepAlive() const noexcept {      return Impl_->CanBeKeepAlive();  } -void THttpOutput::SendContinue() { -    Impl_->SendContinue(); -} - +void THttpOutput::SendContinue() {  +    Impl_->SendContinue();  +}  +   const TString& THttpOutput::FirstLine() const noexcept {      return Impl_->FirstLine();  } diff --git a/library/cpp/http/io/stream.h b/library/cpp/http/io/stream.h index 78ca4fc814c..e0846ef107e 100644 --- a/library/cpp/http/io/stream.h +++ b/library/cpp/http/io/stream.h @@ -84,8 +84,8 @@ public:      /// Returns true if Content-Length or Transfer-Encoding header received      bool HasContent() const noexcept; -    bool HasExpect100Continue() const noexcept; - +    bool HasExpect100Continue() const noexcept;  +   private:      size_t DoRead(void* buf, size_t len) override;      size_t DoSkip(size_t len) override; @@ -145,8 +145,8 @@ public:      /// не завершается после окончания транзакции.      bool CanBeKeepAlive() const noexcept; -    void SendContinue(); - +    void SendContinue();  +       /*       * first line - response or request       */ | 
