MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / set_curl_next_options

Method set_curl_next_options

src/runtime.cpp:183–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183void runtime::set_curl_next_options()
184{
185 // lambda freezes the container when no further tasks are available. The freezing period could be longer than the
186 // request timeout, which causes the following get_next request to fail with a timeout error.
187 curl_easy_reset(m_curl_handle);
188 curl_easy_setopt(m_curl_handle, CURLOPT_TIMEOUT, 0L);
189 curl_easy_setopt(m_curl_handle, CURLOPT_CONNECTTIMEOUT, 1L);
190 curl_easy_setopt(m_curl_handle, CURLOPT_NOSIGNAL, 1L);
191 curl_easy_setopt(m_curl_handle, CURLOPT_TCP_NODELAY, 1L);
192 curl_easy_setopt(m_curl_handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
193
194 curl_easy_setopt(m_curl_handle, CURLOPT_HTTPGET, 1L);
195 curl_easy_setopt(m_curl_handle, CURLOPT_URL, m_endpoints[Endpoints::NEXT].c_str());
196
197 curl_easy_setopt(m_curl_handle, CURLOPT_WRITEFUNCTION, write_data);
198 curl_easy_setopt(m_curl_handle, CURLOPT_HEADERFUNCTION, write_header);
199
200 curl_easy_setopt(m_curl_handle, CURLOPT_PROXY, "");
201
202#ifndef NDEBUG
203 curl_easy_setopt(m_curl_handle, CURLOPT_VERBOSE, 1);
204 curl_easy_setopt(m_curl_handle, CURLOPT_DEBUGFUNCTION, rt_curl_debug_callback);
205#endif
206}
207
208void runtime::set_curl_post_result_options()
209{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected