From d7bace1b41039d699b7b0f9fe1d3b47ce22af99e Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Mon, 10 Nov 2008 10:14:08 +0000 Subject: [PATCH] ganeti.http: Add constant for "Unexpected EOF" This is an expected error message and will be used in two places. Reviewed-by: iustinp --- lib/http.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/http.py b/lib/http.py index d6756ffc5..46838358e 100644 --- a/lib/http.py +++ b/lib/http.py @@ -87,6 +87,8 @@ HTTP_CONTENT_LENGTH = "Content-Length" HTTP_CONNECTION = "Connection" HTTP_KEEP_ALIVE = "Keep-Alive" +_SSL_UNEXPECTED_EOF = "Unexpected EOF" + class SocketClosed(socket.error): pass @@ -1252,7 +1254,7 @@ class _SSLFileObject(object): # TODO except OpenSSL.SSL.SysCallError, (retval, desc): - if ((retval == -1 and desc == "Unexpected EOF") + if ((retval == -1 and desc == _SSL_UNEXPECTED_EOF) or retval > 0): self._ConnectionLost() return "" -- GitLab