blob: 51447430239e07f0d4e116c6979cf1cecb759c72 [file] [log] [blame]
Andreea Costinase45d54b2020-03-10 09:21:14 +01001// Copyright 2020 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "system-proxy/curl_socket.h"
6
7#include <memory>
8#include <utility>
9
10namespace system_proxy {
11
12CurlSocket::CurlSocket(base::ScopedFD fd, ScopedCurlEasyhandle curl_easyhandle)
13 : arc_networkd::Socket(std::move(fd)),
14 curl_easyhandle_(std::move(curl_easyhandle)) {}
15
Andreea Costinas12414962020-04-12 21:59:29 +020016CurlSocket::~CurlSocket() {
17 // TODO(acostinas,https://crbug.com/1070732) Allow SocketForwarder creation
18 // with raw sockets and defer closing the socket to libcurl via a callback
19 // instead of releaing the socket in the destructor.
20 int fd = release();
21 VLOG(1) << "Released " << fd << " to be closed by the curl handler";
22}
Andreea Costinase45d54b2020-03-10 09:21:14 +010023
24} // namespace system_proxy