MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / write

Method write

extensions/http-curl/client/HTTPStream.cpp:61–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59// data stream overrides
60
61int HttpStream::write(const uint8_t *value, int size) {
62 gsl_Expects(size >= 0);
63 if (size == 0) {
64 return 0;
65 }
66 if (!IsNullOrEmpty(value)) {
67 if (!started_) {
68 std::lock_guard<std::mutex> lock(mutex_);
69 if (!started_) {
70 callback_.ptr = &http_callback_;
71 callback_.pos = 0;
72 http_client_->setUploadCallback(&callback_);
73 http_client_future_ = std::async(std::launch::async, submit_client, http_client_);
74 started_ = true;
75 }
76 }
77 http_callback_.process(value, size);
78 return size;
79 } else {
80 return -1;
81 }
82}
83
84int HttpStream::read(uint8_t *buf, int buflen) {
85 gsl_Expects(buflen >= 0);

Callers 4

handleGetMethod · 0.45
processMethod · 0.45
sendPayloadMethod · 0.45

Calls 3

IsNullOrEmptyFunction · 0.85
setUploadCallbackMethod · 0.80
processMethod · 0.45

Tested by 2

handleGetMethod · 0.36
processMethod · 0.36