Use the presence of X-Roll-Ntime in the header as a bool for exists unless N is found in the response.
diff --git a/util.c b/util.c
index 5a26685..50723d4 100644
--- a/util.c
+++ b/util.c
@@ -205,12 +205,14 @@ static size_t resp_hdr_cb(void *ptr, size_t size, size_t nmemb, void *user_data)
applog(LOG_DEBUG, "HTTP hdr(%s): %s", key, val);
if (!strcasecmp("X-Roll-Ntime", key)) {
- if (!strcasecmp("Y", val)) {
+ if (!strncasecmp("N", val, 1)) {
if (opt_debug)
- applog(LOG_DEBUG, "X-Roll-Ntime: Y found");
+ applog(LOG_DEBUG, "X-Roll-Ntime: N found");
+ } else {
+ if (opt_debug)
+ applog(LOG_DEBUG, "X-Roll-Ntime found");
hi->has_rolltime = true;
- } else if (opt_debug)
- applog(LOG_DEBUG, "X-Roll-Ntime: N found");
+ }
}
if (!strcasecmp("X-Long-Polling", key)) {