| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <curl/curl.h> | ||
| 4 | |||
| 5 | #include "SysSocket.h" | ||
| 6 | |||
| 7 | // libcurl opens its connections without close-on-exec, so every shell and tool | ||
| 8 | // fppd ran inherited the ones it had open, and held them past fppd's exit. | ||
| 9 | // Each easy handle opens them through OpenSocket() instead. | ||
| 10 | 1412 | inline curl_socket_t CurlOpenSocket(void*, curlsocktype, struct curl_sockaddr* address) { | |
| 11 | 1412 | return OpenSocket(address->family, address->socktype, address->protocol); | |
| 12 | } | ||
| 13 | |||
| 14 | 1443 | inline void SetCurlCloseOnExec(CURL* curl) { | |
| 15 | 1443 | curl_easy_setopt(curl, CURLOPT_OPENSOCKETFUNCTION, static_cast<curl_opensocket_callback>(CurlOpenSocket)); | |
| 16 | 1443 | } | |
| 17 |