CpEpEngine.cpp
branchENGINE-187
changeset 244 8c258e7d10f4
parent 240 ea67031c573f
child 245 ffcbcf8934a1
     1.1 --- a/CpEpEngine.cpp	Tue Apr 18 21:25:41 2017 +0200
     1.2 +++ b/CpEpEngine.cpp	Thu Apr 20 16:40:42 2017 +0200
     1.3 @@ -1277,6 +1277,19 @@
     1.4              {
     1.5                  *timeout = 1; // Signal timeout
     1.6                  return NULL;
     1.7 +            } 
     1.8 +            else 
     1.9 +            {
    1.10 +                auto now = std::chrono::steady_clock::now()
    1.11 +                if (now < end_time) 
    1.12 +                {
    1.13 +                    std::chrono::duration<time_t> remaining_seconds = end_time - now;
    1.14 +                    *timeout = remaining_seconds.count();
    1.15 +                } 
    1.16 +                else 
    1.17 +                {
    1.18 +                    *timeout = 0;
    1.19 +                }
    1.20              }
    1.21          }
    1.22      }
    1.23 @@ -1598,4 +1611,4 @@
    1.24      // notify the keysync thread.
    1.25      self->notify_handshake_finished = true;
    1.26      self->keysync_condition.notify_all();
    1.27 -}
    1.28 \ No newline at end of file
    1.29 +}