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

Method ProcessFailRequest

library/cpp/http/server/http.cpp:780–819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

778}
779
780void TClientRequest::ProcessFailRequest(int failstate) {
781 Output() << "HTTP/1.1 503 Service Unavailable\r\n"
782 "Content-Type: text/plain\r\n"
783 "Content-Length: 21\r\n"
784 "\r\n"
785 "Service Unavailable\r\n";
786
787 TString url;
788
789 if (!strnicmp(RequestString.data(), "GET ", 4)) {
790 // Trying to extract url...
791 const char* str = RequestString.data();
792
793 // Skipping spaces before url...
794 size_t start = 3;
795 while (str[start] == ' ') {
796 ++start;
797 }
798
799 if (str[start]) {
800 // Traversing url...
801 size_t idx = start;
802
803 while (str[idx] != ' ' && str[idx]) {
804 ++idx;
805 }
806
807 url = RequestString.substr(start, idx - start);
808 }
809 }
810
811 const THttpServer::ICallBack::TFailLogData d = {
812 failstate,
813 url,
814 };
815
816 // Handling failure...
817 Conn_->HttpServ_->Cb_->OnFailRequestEx(d);
818 Output().Flush();
819}
820
821THttpServer* TClientRequest::HttpServ() const noexcept {
822 return Conn_->HttpServ_->Parent_;

Callers

nothing calls this directly

Calls 4

OnFailRequestExMethod · 0.80
dataMethod · 0.45
substrMethod · 0.45
FlushMethod · 0.45

Tested by

no test coverage detected