Possible improvement of #390 (cherry picked from commit 89cae22b91) Conflicts: src/octoprint/util/comm.py
89cae22b91