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

Method Process

library/cpp/http/server/http.cpp:728–778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726}
727
728void TClientRequest::Process(void* ThreadSpecificResource) {
729 THolder<TClientRequest> this_(this);
730
731 auto* serverImpl = Conn_->HttpServ_;
732
733 try {
734 if (!HttpConn_) {
735 const size_t outputBufferSize = HttpServ()->Options().OutputBufferSize;
736 if (outputBufferSize) {
737 HttpConn_.Reset(new THttpServerConn(Socket(), outputBufferSize));
738 } else {
739 HttpConn_.Reset(new THttpServerConn(Socket()));
740 }
741
742 auto maxRequestsPerConnection = HttpServ()->Options().MaxRequestsPerConnection;
743 HttpConn_->Output()->EnableKeepAlive(HttpServ()->Options().KeepAliveEnabled && (!maxRequestsPerConnection || Conn_->ReceivedRequests < maxRequestsPerConnection));
744 HttpConn_->Output()->EnableCompression(HttpServ()->Options().CompressionEnabled);
745 }
746
747 if (!BeforeParseRequestOk(ThreadSpecificResource)) {
748 ReleaseConnection();
749 return;
750 }
751
752 if (ParsedHeaders.empty()) {
753 RequestString = Input().FirstLine();
754
755 const THttpHeaders& h = Input().Headers();
756 ParsedHeaders.reserve(h.Count());
757 for (THttpHeaders::TConstIterator it = h.Begin(); it != h.End(); ++it) {
758 ParsedHeaders.emplace_back(it->Name(), it->Value());
759 }
760 }
761
762 if (Reply(ThreadSpecificResource)) {
763 ReleaseConnection();
764
765 /*
766 * *this will be destroyed...
767 */
768
769 return;
770 }
771 } catch (...) {
772 serverImpl->Cb_->OnException();
773
774 throw;
775 }
776
777 Y_UNUSED(this_.Release());
778}
779
780void TClientRequest::ProcessFailRequest(int failstate) {
781 Output() << "HTTP/1.1 503 Service Unavailable\r\n"

Callers 2

test_filelockFunction · 0.45

Calls 15

SocketFunction · 0.85
Y_UNUSEDFunction · 0.85
OnExceptionMethod · 0.80
OptionsMethod · 0.45
ResetMethod · 0.45
EnableKeepAliveMethod · 0.45
OutputMethod · 0.45
EnableCompressionMethod · 0.45
emptyMethod · 0.45
reserveMethod · 0.45
CountMethod · 0.45
BeginMethod · 0.45

Tested by 2

test_filelockFunction · 0.36