MCPcopy Create free account
hub / github.com/FastLED/FastLED / FetchRequest

Method FetchRequest

src/fl/net/http/fetch_request.cpp.hpp:70–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68namespace http {
69
70FetchRequest::FetchRequest(const fl::string& url, const FetchOptions& opts, fl::task::Promise<Response> prom)
71 : mState(DNS_LOOKUP)
72 , mPromise(prom)
73 , mParsedUrl(url)
74 , mHostname()
75 , mPort(80)
76 , mPath("/")
77 , mSocketFd(-1)
78 , mDnsResult(nullptr)
79 , mRequestBuffer()
80 , mResponseBuffer()
81 , mBytesSent(0)
82 , mStateStartTime(fl::millis())
83{
84 if (!mParsedUrl.isValid() || mParsedUrl.host().empty()) {
85 complete_error("Invalid URL");
86 return;
87 }
88 mHostname = fl::string(mParsedUrl.host().data(), mParsedUrl.host().size());
89 mPort = mParsedUrl.port();
90 fl::string_view p = mParsedUrl.path();
91 mPath = p.empty() ? fl::string("/") : fl::string(p.data(), p.size());
92}
93
94FetchRequest::~FetchRequest() FL_NOEXCEPT {
95 close_socket();

Callers

nothing calls this directly

Calls 9

hostMethod · 0.80
millisFunction · 0.50
stringClass · 0.50
isValidMethod · 0.45
emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
portMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected