def handle(self, sock, read_data, path, headers):
for i in range(self.attempts):<EOL><INDENT>try:<EOL><INDENT>server_sock = eventlet.connect(<EOL>tuple(random.choice(self.backends)),<EOL>)<EOL><DEDENT>except socket.error:<EOL><INDENT>eventlet.sleep(self.delay)<EOL>continue<EOL><DEDENT>def send_onwards(data):<EOL><INDENT>server_sock.sendall(data)<EOL>return len(data)<EOL><DEDENT>try:<EOL><INDENT>size = send_onwards(read_data)<EOL>size += SocketMelder(sock, server_sock).run()<EOL><DEDENT>except socket.error as e:<EOL><INDENT>if e.errno != errno.EPIPE:<EOL><INDENT>raise<EOL><DEDENT><DEDENT><DEDENT>
Sends back a static error page.