Skip to content

Commit

Permalink
feat: remove USE_UNIX_SOCKET
Browse files Browse the repository at this point in the history
  • Loading branch information
edmBernard committed Apr 21, 2020
1 parent 2192716 commit 1c8bfe5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 16 deletions.
6 changes: 0 additions & 6 deletions cpr/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ class Session::Impl {
void SetVerbose(const Verbose& verbose);
void SetVerifySsl(const VerifySsl& verify);
void SetLimitRate(const LimitRate& limit_rate);
#ifdef USE_UNIX_SOCKETS
void SetUnixSocket(const UnixSocket& unix_socket);
#endif

Response Delete();
Response Download(std::ofstream& file);
Expand Down Expand Up @@ -344,14 +342,12 @@ void Session::Impl::SetVerifySsl(const VerifySsl& verify) {
}
}

#ifdef USE_UNIX_SOCKETS
void Session::Impl::SetUnixSocket(const UnixSocket& unix_socket) {
auto curl = curl_->handle;
if (curl) {
curl_easy_setopt(curl, CURLOPT_UNIX_SOCKET_PATH, unix_socket.GetUnixSocketString());
}
}
#endif

Response Session::Impl::Delete() {
auto curl = curl_->handle;
Expand Down Expand Up @@ -591,9 +587,7 @@ void Session::SetOption(Body&& body) { pimpl_->SetBody(std::move(body)); }
void Session::SetOption(const LowSpeed& low_speed) { pimpl_->SetLowSpeed(low_speed); }
void Session::SetOption(const VerifySsl& verify) { pimpl_->SetVerifySsl(verify); }
void Session::SetOption(const Verbose& verbose) { pimpl_->SetVerbose(verbose); }
#ifdef USE_UNIX_SOCKETS
void Session::SetOption(const UnixSocket& unix_socket) { pimpl_->SetUnixSocket(unix_socket); }
#endif

Response Session::Delete() { return pimpl_->Delete(); }
Response Session::Download(std::ofstream& file) { return pimpl_->Download(file); }
Expand Down
2 changes: 0 additions & 2 deletions cpr/unix_socket.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#ifdef USE_UNIX_SOCKETS

#include "cpr/unix_socket.h"

Expand All @@ -9,4 +8,3 @@ const char* UnixSocket::GetUnixSocketString() const noexcept {
}

} // namespace cpr
#endif
4 changes: 0 additions & 4 deletions include/cpr/session.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ class Session {
void SetBody(const Body& body);
void SetLowSpeed(const LowSpeed& low_speed);
void SetVerifySsl(const VerifySsl& verify);
#ifdef USE_UNIX_SOCKETS
void SetUnixSocket(const UnixSocket& unix_socket);
#endif

// Used in templated functions
void SetOption(const Url& url);
Expand All @@ -86,9 +84,7 @@ class Session {
void SetOption(const LowSpeed& low_speed);
void SetOption(const VerifySsl& verify);
void SetOption(const Verbose& verbose);
#ifdef USE_UNIX_SOCKETS
void SetOption(const UnixSocket& unix_socket);
#endif

Response Delete();
Response Download(std::ofstream& file);
Expand Down
4 changes: 0 additions & 4 deletions include/cpr/unix_socket.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef CPR_UNIX_SOCKET_H
#define CPR_UNIX_SOCKET_H

#ifdef USE_UNIX_SOCKETS

#include <string>

#include "cpr/defines.h"
Expand All @@ -24,5 +22,3 @@ class UnixSocket {
} // namespace cpr

#endif

#endif

0 comments on commit 1c8bfe5

Please sign in to comment.