From 53bdec3ebea66153b320ee497871355eb526e0f2 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 2 Jan 2018 21:59:02 +0100 Subject: 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 --- methods/connect.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'methods') 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); -- cgit v1.2.3