Skip to content

Commit

Permalink
Retry if response via tls1.3 is still not received.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Aug 27, 2020
1 parent 9063724 commit cf2d235
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- Add separators for a new (ip address) field in ERRMSG and DEADHOST messages. [#376](https://github.com/greenbone/gvm-libs/pull/376)
- Continuously send dead hosts to ospd-openvas to enable a smooth progess bar if only ICMP is chosen as alive test. [#389](https://github.com/greenbone/gvm-libs/pull/389)
- Retry if response via tls1.3 is still not received. [#394](https://github.com/greenbone/gvm-libs/pull/394)

### Removed
- Remove version from the nvticache name. [#386](https://github.com/greenbone/gvm-libs/pull/386)
Expand Down
13 changes: 13 additions & 0 deletions util/xmlutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ try_read_entity_and_string (gnutls_session_t *session, int timeout,
while (1)
{
ssize_t count;
int retries = 10;
while (1)
{
g_debug (" asking for %i\n", BUFFER_SIZE);
Expand All @@ -611,6 +612,18 @@ try_read_entity_and_string (gnutls_session_t *session, int timeout,
}
continue;
}
else if ((timeout == 0) && (count == GNUTLS_E_AGAIN))
{
/* Server still busy, try read again.
If there is no timeout set and the server is still not ready,
it will try up to 10 times before closing the socket.*/
if (retries > 0)
{
retries = retries - 1;
continue;
}
}

if (count == GNUTLS_E_REHANDSHAKE)
/* Try again. TODO Rehandshake. */
continue;
Expand Down

0 comments on commit cf2d235

Please sign in to comment.