MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / close

Method close

Libraries/HttpClient/HttpClientAsync.h:126–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124 }
125
126 Result close()
127 {
128 if (not initialized)
129 {
130 return Result(true);
131 }
132
133 if (wakeUpStarted and eventLoop != nullptr)
134 {
135 (void)wakeUp.stop(*eventLoop);
136 wakeUpStarted = false;
137 }
138
139 if (requestBodySink.isStillWriting() or not requestBodySink.hasBeenDestroyed())
140 {
141 requestBodySink.destroy();
142 }
143 responseBodyStream.destroy();
144 resetRequestBodyState();
145
146 SC_TRY(operation.close());
147 operation.setNotifier(nullptr);
148
149 eventLoop = nullptr;
150 requestBodyBuffersPool = nullptr;
151 initialized = false;
152 return Result(true);
153 }
154
155 Result cancel() { return operation.cancel(); }
156

Callers

nothing calls this directly

Calls 3

ResultClass · 0.50
stopMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected