From: Jaroslav Kysela Date: Thu, 3 Aug 2017 12:22:59 +0000 (+0200) Subject: http websocket comet: keep alive nonce (digest auth), fixes re-auth issue with chrome X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ff045b46a76b901e27262ad66665495e28881a9a;p=thirdparty%2Ftvheadend.git http websocket comet: keep alive nonce (digest auth), fixes re-auth issue with chrome --- diff --git a/src/http.c b/src/http.c index 120637f0b..bc8e13053 100644 --- a/src/http.c +++ b/src/http.c @@ -310,6 +310,16 @@ http_get_opaque(const char *realm, const char *nonce) return md5sum(a, 1); } +/** + * + */ +void +http_alive(http_connection_t *hc) +{ + if (hc->hc_nonce) + http_nonce_exists(hc->hc_nonce); /* update timer */ +} + /** * Transmit a HTTP reply */ diff --git a/src/http.h b/src/http.h index f26fc8f8f..5a65d5cc9 100644 --- a/src/http.h +++ b/src/http.h @@ -199,6 +199,8 @@ static inline int http_args_empty(const struct http_arg_list *list) { return TAI int http_tokenize(char *buf, char **vec, int vecsize, int delimiter); +void http_alive(http_connection_t *hc); + void http_error(http_connection_t *hc, int error); int http_encoding_valid(http_connection_t *hc, const char *encoding); diff --git a/src/webui/comet.c b/src/webui/comet.c index 1da5a917d..b33eef69f 100644 --- a/src/webui/comet.c +++ b/src/webui/comet.c @@ -432,6 +432,7 @@ comet_mailbox_ws(http_connection_t *hc, const char *remain, void *opaque) if (res >= 0) { comet_mailbox_ws_msg(hc, cmb, first, msg); htsmsg_destroy(msg); + http_alive(hc); first = 0; } }