diff options
author | Julian Andres Klode <jak@debian.org> | 2018-01-02 21:59:02 +0100 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2018-01-03 15:26:51 +0100 |
commit | 53bdec3ebea66153b320ee497871355eb526e0f2 (patch) | |
tree | 991afb41f4842c04dd1fe4533c9f8cbb863c5de8 | |
parent | c9a5a6f2140758c0ed08764a07dd454a8f3ff986 (diff) |
connect: Extract Connection::CheckError() method
Extracting the error checking method allows us to reuse it
in different places, so we can move the waiting and checking
out of DoConnect() eventually.
Gbp-Dch: ignore
-rw-r--r-- | methods/connect.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/methods/connect.cc b/methods/connect.cc index 07427c651..160491d96 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -150,6 +150,7 @@ struct Connection } ResultState DoConnect(unsigned long TimeOut); + ResultState CheckError(); }; ResultState Connection::DoConnect(unsigned long TimeOut) @@ -194,6 +195,11 @@ ResultState Connection::DoConnect(unsigned long TimeOut) return ResultState::TRANSIENT_ERROR; } + return CheckError(); +} + +ResultState Connection::CheckError() +{ // Check the socket for an error condition unsigned int Err; unsigned int Len = sizeof(Err); |