[vlc-devel] [PATCH 1/2] httpd: store timeout date rather than activity date
Thomas Guillem
thomas at gllm.fr
Tue Jun 15 15:10:07 UTC 2021
Hello Stavros,
Thanks for your contribution.
We moved recently to gitlab, and we are now reviewing new contributions via merge requests. You can create one here https://code.videolan.org/videolan/vlc/-/merge_requests.
Best,
Thomas
On Tue, Jun 15, 2021, at 17:03, Stavros Vagionitis wrote:
> This should not make any functional differences.
>
> Refs #25812.
>
> (cherry picked from commit 2fd2b843c4af0e42c6848bc88ab03173500cc52c)
> ---
> src/network/httpd.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/network/httpd.c b/src/network/httpd.c
> index 69e6399483..33c5394f42 100644
> --- a/src/network/httpd.c
> +++ b/src/network/httpd.c
> @@ -146,7 +146,7 @@ struct httpd_client_t
> bool b_stream_mode;
> uint8_t i_state;
>
> - mtime_t i_activity_date;
> + mtime_t i_timeout_date;
> mtime_t i_activity_timeout;
>
> /* buffer for reading header */
> @@ -1187,8 +1187,8 @@ void httpd_MsgAdd(httpd_message_t *msg, const
> char *name, const char *psz_value,
> static void httpd_ClientInit(httpd_client_t *cl, mtime_t now)
> {
> cl->i_state = HTTPD_CLIENT_RECEIVING;
> - cl->i_activity_date = now;
> cl->i_activity_timeout = INT64_C(10000000);
> + cl->i_timeout_date = now + cl->i_activity_timeout;
> cl->i_buffer_size = HTTPD_CL_BUFSIZE;
> cl->i_buffer = 0;
> cl->p_buffer = xmalloc(cl->i_buffer_size);
> @@ -1738,7 +1738,7 @@ static void httpdLoop(httpd_host_t *host)
> if (cl->i_ref < 0 || (cl->i_ref == 0 &&
> (cl->i_state == HTTPD_CLIENT_DEAD ||
> (cl->i_activity_timeout > 0 &&
> - cl->i_activity_date+cl->i_activity_timeout <
> now)))) {
> + cl->i_timeout_date < now)))) {
> TAB_REMOVE(host->i_client, host->client, cl);
> i_client--;
> httpd_ClientDestroy(cl);
> @@ -1746,7 +1746,7 @@ static void httpdLoop(httpd_host_t *host)
> }
>
> if (val == 0) {
> - cl->i_activity_date = now;
> + cl->i_timeout_date = now + cl->i_activity_timeout;
> delay = 0;
> }
>
> --
> 2.25.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list