File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -469,6 +469,9 @@ class Validator {
469469 Validator () : m_now(std::chrono::system_clock::now()) {}
470470
471471 void set_now (std::chrono::system_clock::time_point now) { m_now = now; }
472+
473+ // Maximum timeout for select() in microseconds for periodic checks
474+ static constexpr long MAX_SELECT_TIMEOUT_US = 50000 ; // 50ms
472475
473476 std::unique_ptr<AsyncStatus> verify_async (const SciToken &scitoken) {
474477 const jwt::decoded_jwt<jwt::traits::kazuho_picojson> *jwt_decoded =
@@ -496,10 +499,10 @@ class Validator {
496499
497500 while (!result->m_done ) {
498501 auto timeout_val = result->get_timeout_val (expiry_time);
499- // Limit select to 50ms for periodic checks
500- if (timeout_val.tv_sec > 0 || timeout_val.tv_usec > 50000 ) {
502+ // Limit select to MAX_SELECT_TIMEOUT_US for periodic checks
503+ if (timeout_val.tv_sec > 0 || timeout_val.tv_usec > MAX_SELECT_TIMEOUT_US ) {
501504 timeout_val.tv_sec = 0 ;
502- timeout_val.tv_usec = 50000 ;
505+ timeout_val.tv_usec = MAX_SELECT_TIMEOUT_US ;
503506 }
504507
505508 select (result->get_max_fd () + 1 , result->get_read_fd_set (),
You can’t perform that action at this time.
0 commit comments