From b933ee8e78a353e0e2b64030dfb2388243a7f528 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 10 Jan 2015 16:02:15 +0900 Subject: [PATCH] h2load: Don't retry connection on read error Connection failure is handled by connected() and other errors lead to just failure, no retry is needed. --- src/h2load.cc | 13 +------------ src/h2load.h | 1 - 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/h2load.cc b/src/h2load.cc index 5b408745..cfe8441a 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -455,17 +455,6 @@ int Client::on_connect() { return 0; } -int Client::on_net_error() { - if (state == CLIENT_IDLE) { - disconnect(); - if (connect() == 0) { - return 0; - } - } - debug("error/eof\n"); - return -1; -} - int Client::on_read(const uint8_t *data, size_t len) { auto rv = session->on_read(data, len); if (rv != 0) { @@ -494,7 +483,7 @@ int Client::read_clear() { if (errno == EAGAIN || errno == EWOULDBLOCK) { return 0; } - return on_net_error(); + return -1; } if (nread == 0) { diff --git a/src/h2load.h b/src/h2load.h index 6ff53525..41268b4d 100644 --- a/src/h2load.h +++ b/src/h2load.h @@ -175,7 +175,6 @@ struct Client { int on_read(const uint8_t *data, size_t len); int on_write(); int on_connect(); - int on_net_error(); int noop(); void on_request(int32_t stream_id);