diff --git a/http-auth.c b/http-auth.c index f7a66b3..9e25a47 100644 --- a/http-auth.c +++ b/http-auth.c @@ -276,4 +276,3 @@ char* digest_authentication_encode(const char *line, const char *user, const cha const char *auth_request_header = "Proxy-Authenticate:"; const char *auth_response_header = "Proxy-Authorization:"; -const time_t auth_error_gap = 60; diff --git a/http-auth.h b/http-auth.h index 7aadac5..36e3221 100644 --- a/http-auth.h +++ b/http-auth.h @@ -3,7 +3,6 @@ typedef struct http_auth_t { char *last_auth_query; - time_t last_auth_time; int last_auth_count; } http_auth; diff --git a/http-connect.c b/http-connect.c index 4fadad2..2d96117 100644 --- a/http-connect.c +++ b/http-connect.c @@ -50,7 +50,6 @@ static struct evbuffer *httpc_mkconnect(redsocks_client *client); extern const char *auth_request_header; extern const char *auth_response_header; -extern const time_t auth_error_gap; // quit after connsective auth fail in a time interval, in secs static char *get_auth_request_header(struct evbuffer *buf) { @@ -82,9 +81,8 @@ static void httpc_read_cb(struct bufferevent *buffev, void *_arg) if (code == 407) { // auth failed http_auth *auth = (void*)(client->instance + 1); - time_t now_time = time(NULL); - if (auth->last_auth_query != NULL && now_time - auth->last_auth_time < auth_error_gap && auth->last_auth_count == 1) { - redsocks_log_error(client, LOG_NOTICE, "consective auth failure"); + if (auth->last_auth_query != NULL && auth->last_auth_count == 1) { + redsocks_log_error(client, LOG_NOTICE, "proxy auth failed"); redsocks_drop_client(client); dropped = 1; @@ -105,7 +103,6 @@ static void httpc_read_cb(struct bufferevent *buffev, void *_arg) auth->last_auth_query = calloc(strlen(ptr) + 1, 1); strcpy(auth->last_auth_query, ptr); - auth->last_auth_time = now_time; auth->last_auth_count = 0; free(auth_request);