annotate src/core/ngx_sha1.h @ 8509:bce9e9643444 quic

QUIC: coalesce neighbouring stream send buffers. Previously a single STREAM frame was created for each buffer in stream output chain which is wasteful with respect to memory. The following changes were made in the stream send code: - ngx_quic_stream_send_chain() no longer calls ngx_quic_stream_send() and got a separate implementation that coalesces neighbouring buffers into a single frame - the new ngx_quic_stream_send_chain() respects the limit argument, which fixes sendfile_max_chunk and limit_rate - ngx_quic_stream_send() is reimplemented to call ngx_quic_stream_send_chain() - stream frame size limit is moved out to a separate function ngx_quic_max_stream_frame() - flow control is moved out to a separate function ngx_quic_max_stream_flow() - ngx_quic_stream_send_chain() is relocated next to ngx_quic_stream_send()
author Roman Arutyunyan <arut@nginx.com>
date Tue, 18 Aug 2020 12:28:33 +0300
parents 9eefb38f0005
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1573
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 /*
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
3 * Copyright (C) Igor Sysoev
4412
d620f497c50f Copyright updated.
Maxim Konovalov <maxim@nginx.com>
parents: 1598
diff changeset
4 * Copyright (C) Nginx, Inc.
1573
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5 */
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 #ifndef _NGX_SHA1_H_INCLUDED_
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 #define _NGX_SHA1_H_INCLUDED_
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12 #include <ngx_config.h>
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 #include <ngx_core.h>
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15
6586
1064ea81ed3a An internal SHA1 implementation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4412
diff changeset
16 typedef struct {
1064ea81ed3a An internal SHA1 implementation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4412
diff changeset
17 uint64_t bytes;
1064ea81ed3a An internal SHA1 implementation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4412
diff changeset
18 uint32_t a, b, c, d, e, f;
1064ea81ed3a An internal SHA1 implementation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4412
diff changeset
19 u_char buffer[64];
1064ea81ed3a An internal SHA1 implementation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4412
diff changeset
20 } ngx_sha1_t;
1064ea81ed3a An internal SHA1 implementation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4412
diff changeset
21
1064ea81ed3a An internal SHA1 implementation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4412
diff changeset
22
1064ea81ed3a An internal SHA1 implementation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4412
diff changeset
23 void ngx_sha1_init(ngx_sha1_t *ctx);
1064ea81ed3a An internal SHA1 implementation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4412
diff changeset
24 void ngx_sha1_update(ngx_sha1_t *ctx, const void *data, size_t size);
1064ea81ed3a An internal SHA1 implementation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4412
diff changeset
25 void ngx_sha1_final(u_char result[20], ngx_sha1_t *ctx);
1064ea81ed3a An internal SHA1 implementation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4412
diff changeset
26
1064ea81ed3a An internal SHA1 implementation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 4412
diff changeset
27
1573
8f911d6d0d70 ngx_sha1.h
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
28 #endif /* _NGX_SHA1_H_INCLUDED_ */