Skip to content

Commit

Permalink
Merge pull request #7019 from kozlovsky/fix/unknown_network_error_99
Browse files Browse the repository at this point in the history
An attempt to fix QNetworkReply.UnknownNetworkError (99) when connecting to Core
  • Loading branch information
kozlovsky authored Aug 29, 2022
2 parents 97a1166 + 53344be commit e7756c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tribler/gui/event_request_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ def connect(self, reschedule_on_err=True):
self._logger.info(f"Connecting to events endpoint ({'with' if reschedule_on_err else 'without'} retrying)")
if self.reply is not None:
self.reply.deleteLater()

# A workaround for Qt5 bug. See https://github.com/Tribler/tribler/issues/7018
self.setNetworkAccessible(QNetworkAccessManager.Accessible)

self.reply = self.get(self.request)

connect(self.reply.readyRead, self.on_read_data)
Expand Down
3 changes: 3 additions & 0 deletions src/tribler/gui/tribler_request_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ def add_request(self, request):
buf.setData(request.raw_data)
buf.open(QIODevice.ReadOnly)

# A workaround for Qt5 bug. See https://github.com/Tribler/tribler/issues/7018
self.setNetworkAccessible(QNetworkAccessManager.Accessible)

request.reply = self.sendCustomRequest(qt_request, request.method.encode("utf8"), buf)
buf.setParent(request.reply)

Expand Down

0 comments on commit e7756c4

Please sign in to comment.