Skip to content

Commit

Permalink
Added comment about the change in source code
Browse files Browse the repository at this point in the history
  • Loading branch information
franciszek-koltuniuk-red committed Jun 5, 2023
1 parent d750779 commit 590d23f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/node_http_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,11 @@ void ConnectionsList::Expired(const FunctionCallbackInfo<Value>& args) {
std::swap(headers_timeout, request_timeout);
}

// On IoT or embedded devices the uv_hrtime() may return the timestamp
// that is smaller than configured timeout for headers or request
// to prevent subtracting two unsigned integers
// that can yield incorrect results we should check
// if the 'now' is bigger than the timeout for headers or request
const uint64_t now = uv_hrtime();
const uint64_t headers_deadline =
(headers_timeout > 0 && now > headers_timeout) ? now - headers_timeout
Expand Down

0 comments on commit 590d23f

Please sign in to comment.