From 4f775dc1ae3a7787aa33df064cd0875a18cb00fd Mon Sep 17 00:00:00 2001 From: Timothy Stack Date: Sun, 4 Oct 2015 20:50:49 -0700 Subject: [PATCH] [pt] don't poll if max time is set --- src/papertrail_proc.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/papertrail_proc.cc b/src/papertrail_proc.cc index 4af3fcf4..4b552b97 100644 --- a/src/papertrail_proc.cc +++ b/src/papertrail_proc.cc @@ -131,7 +131,7 @@ struct json_path_handler papertrail_proc::FORMAT_HANDLERS[] = { json_path_handler("^/(partial_results)", read_partial), json_path_handler("^/(reached_record_limit|reached_time_limit)", read_limit), json_path_handler("^/(min_id|min_time_at|max_time_at|" - "reached_beginning|reached_end|tail)") + "reached_beginning|reached_end|tail|no_events)") .add_cb(ignore_bool) .add_cb(ignore_str), json_path_handler("^/events#/\\w+") @@ -162,6 +162,8 @@ void papertrail_proc::yajl_writer(void *context, const char *str, size_t len) long papertrail_proc::complete(CURLcode result) { + curl_request::complete(result); + yajl_reset(this->ptp_jhandle.in()); if (result != CURLE_OK) { @@ -172,6 +174,10 @@ long papertrail_proc::complete(CURLcode result) return -1; } + if (this->ptp_max_time) { + return -1; + } + this->set_url(); if (this->ptp_partial_read) { this->ptp_partial_read = false;