Electroneum
Loading...
Searching...
No Matches
net::socks::client::completed Struct Reference
Collaboration diagram for net::socks::client::completed:

Public Member Functions

void operator() (const boost::system::error_code error, const std::size_t bytes) const

Public Attributes

std::shared_ptr< clientself_

Detailed Description

Definition at line 149 of file socks.cpp.

Member Function Documentation

◆ operator()()

void net::socks::client::completed::operator() ( const boost::system::error_code error,
const std::size_t bytes ) const
inline

Definition at line 153 of file socks.cpp.

154 {
155 static_assert(1 < sizeof(self_->buffer_), "buffer too small for v4 response");
156
157 if (self_)
158 {
159 client& self = *self_;
160 self.buffer_size_ = std::min(bytes, sizeof(self.buffer_));
161
162 if (error)
163 self.done(error, std::move(self_));
164 else if (self.buffer().size() < sizeof(v4_header))
165 self.done(socks::error::bad_read, std::move(self_));
166 else if (self.buffer_[0] != 0) // response version
167 self.done(socks::error::unexpected_version, std::move(self_));
168 else if (self.buffer_[1] != v4_request_granted)
169 self.done(socks::error(int(self.buffer_[1]) + 1), std::move(self_));
170 else
171 self.done(boost::system::error_code{}, std::move(self_));
172 }
173 }
client(stream_type::socket &&proxy, socks::version ver)
Definition socks.cpp:223
error
Possible errors with socks communication. Defined in https://www.openssh.com/txt/socks4....
Definition socks.h:66
std::shared_ptr< client > self_
Definition socks.cpp:151
Here is the call graph for this function:

Member Data Documentation

◆ self_

std::shared_ptr<client> net::socks::client::completed::self_

Definition at line 151 of file socks.cpp.


The documentation for this struct was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/src/net/socks.cpp