summaryrefslogtreecommitdiff
path: root/methods/connect.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2018-01-02 21:59:02 +0100
committerJulian Andres Klode <jak@debian.org>2018-01-03 15:26:51 +0100
commit53bdec3ebea66153b320ee497871355eb526e0f2 (patch)
tree991afb41f4842c04dd1fe4533c9f8cbb863c5de8 /methods/connect.cc
parentc9a5a6f2140758c0ed08764a07dd454a8f3ff986 (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
Diffstat (limited to 'methods/connect.cc')
-rw-r--r--methods/connect.cc6
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);