annotate src/misc/ngx_cpp_test_module.cpp @ 7746:88eca63261c3

gRPC: RST_STREAM(NO_ERROR) handling after "trailer only" responses. Similarly to the problem fixed in 2096b21fcd10 (ticket #1792), when a "trailer only" gRPC response (that is, a response with the END_STREAM flag in the HEADERS frame) was immediately followed by RST_STREAM(NO_ERROR) in the data preread along with the response header, RST_STREAM wasn't properly skipped and caused "upstream rejected request with error 0" errors. Observed with "unknown service" gRPC errors returned by grpc-go. Fix is to set ctx->done if we are going to parse additional data, so the RST_STREAM(NO_ERROR) is properly skipped. Additionally, now ngx_http_grpc_filter() will complain about frames sent for closed stream if there are any.
author Pavel Pautov <p.pautov@f5.com>
date Wed, 18 Nov 2020 18:41:16 -0800
parents f1e6f65ddfeb
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2157
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
5761
1d693deab8ae Style: fix typo.
Piotr Sikora <piotr@cloudflare.com>
parents: 4759
diff changeset
2 // stub module to test header files' C++ compatibility
2157
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
3
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
4 extern "C" {
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5 #include <ngx_config.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6 #include <ngx_core.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7 #include <ngx_event.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 #include <ngx_event_connect.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 #include <ngx_event_pipe.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11 #include <ngx_http.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 #include <ngx_mail.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14 #include <ngx_mail_pop3_module.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15 #include <ngx_mail_imap_module.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
16 #include <ngx_mail_smtp_module.h>
7727
f1e6f65ddfeb Cpp test: added stream.
Ruslan Ermilov <ru@nginx.com>
parents: 5761
diff changeset
17
f1e6f65ddfeb Cpp test: added stream.
Ruslan Ermilov <ru@nginx.com>
parents: 5761
diff changeset
18 #include <ngx_stream.h>
2157
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
19 }
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
20
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
21 // nginx header files should go before other, because they define 64-bit off_t
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
22 // #include <string>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
23
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
24
4759
4c36e15651f7 Fixed compilation with -Wmissing-prototypes.
Ruslan Ermilov <ru@nginx.com>
parents: 2157
diff changeset
25 void ngx_cpp_test_handler(void *data);
4c36e15651f7 Fixed compilation with -Wmissing-prototypes.
Ruslan Ermilov <ru@nginx.com>
parents: 2157
diff changeset
26
2157
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
27 void
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
28 ngx_cpp_test_handler(void *data)
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
29 {
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
30 return;
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
31 }