diff options
author | Max Romanov <max.romanov@nginx.com> | 2019-11-11 18:04:17 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2019-11-11 18:04:17 +0300 |
commit | f2610d216059fd2dfced37442ea4e76f0b88a33b (patch) | |
tree | 0bdb0abf7e5ff6bd0362909d4eace9b81c03734b /src/test | |
parent | ed3298a3c68bb257b43425c92b07e224c7f46be3 (diff) | |
download | unit-f2610d216059fd2dfced37442ea4e76f0b88a33b.tar.gz unit-f2610d216059fd2dfced37442ea4e76f0b88a33b.tar.bz2 |
Fixing libunit 'off by 2' issue in library.
Name and value in each header are 0-terminated, so additional 2 bytes
should be allocated for them. There were several attempts to add these
2 bytes to headers in language modules, but some modules weren't updated.
Also, adding these 2 bytes is specific to the implementation which may be
changed later, so extending this mechanics to modules may cause errors.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/nxt_unit_websocket_chat.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/nxt_unit_websocket_chat.c b/src/test/nxt_unit_websocket_chat.c index ecc9a243..6e274722 100644 --- a/src/test/nxt_unit_websocket_chat.c +++ b/src/test/nxt_unit_websocket_chat.c @@ -104,10 +104,10 @@ ws_chat_root(nxt_unit_request_info_t *req) rc = nxt_unit_response_init(req, 200 /* Status code. */, 2 /* Number of response headers. */, - nxt_length(CONTENT_TYPE) + 1 - + nxt_length(TEXT_HTML) + 1 - + nxt_length(CONTENT_LENGTH) + 1 - + ws_chat_index_content_length_size + 1 + nxt_length(CONTENT_TYPE) + + nxt_length(TEXT_HTML) + + nxt_length(CONTENT_LENGTH) + + ws_chat_index_content_length_size + ws_chat_index_html_size); if (nxt_slow_path(rc != NXT_UNIT_OK)) { return rc; |