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

Method Write

library/cpp/http/io/stream.cpp:517–559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515 }
516
517 inline void Write(const void* buf, size_t len) {
518 if (Finished_) {
519 ythrow THttpException() << "can not write to finished stream";
520 }
521
522 if (State_ == HeadersSent) {
523 Output_->Write(buf, len);
524
525 return;
526 }
527
528 const char* b = (const char*)buf;
529 const char* e = b + len;
530 const char* c = b;
531
532 while (c != e) {
533 if (*c == '\n') {
534 Line_.append(b, c);
535
536 if (!Line_.empty() && Line_.back() == '\r') {
537 Line_.pop_back();
538 }
539
540 b = c + 1;
541
542 Process(Line_);
543
544 if (State_ == HeadersSent) {
545 Output_->Write(b, e - b);
546
547 return;
548 }
549
550 Line_.clear();
551 }
552
553 ++c;
554 }
555
556 if (b != c) {
557 Line_.append(b, c);
558 }
559 }
560
561 inline void Flush() {
562 TFlush f;

Callers 14

Y_UNIT_TESTFunction · 0.45
OutToMethod · 0.45
Y_UNIT_TESTFunction · 0.45
DoWriteMethod · 0.45
SendContinueMethod · 0.45
WriteCachedImplMethod · 0.45
DoWriteMethod · 0.45
SendMinimalHttpRequestFunction · 0.45
WriteTestDataFunction · 0.45
ReplyMethod · 0.45
Y_UNIT_TESTFunction · 0.45
OutToMethod · 0.45

Calls 6

ProcessFunction · 0.85
appendMethod · 0.45
emptyMethod · 0.45
backMethod · 0.45
pop_backMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected