Fix TCP failure handling

Closed Michał Kępień requested to merge 1059-fix-tcp-failure-handling into master

Merge request reports