summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* nxt_unit_app_test.c: Test what happens if we lie in the Content-LengthHEADmainAlejandro Colomar2023-05-20-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | As expected, Unit just sends what you said: $ echo -e 'GET / HTTP/1.1\r\nHost: _\n' | ncat localhost 80; HTTP/1.1 200 OK Content-Type: text/plain Content-Length: 42 Server: Unit/1.30.0 Date: Sat, 20 May 2023 21:05:06 GMT Hello world! Request data: Method: GET Protocol: HTTP/1.1 Remote addr: 127.0.0.1 Local addr: 127.0.0.1 Target: / Path: / Fields: Host: _ But send this first. Some extra contents. And some more Signed-off-by: Alejandro Colomar <alx@kernel.org>
* nxt_unit_app_test.c: Use strlen(3)Alejandro Colomar2023-05-20-41/+39
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* nxt_unit_app_test.c: Test if nxt_unit_response_add_content(3) can be called ↵Alejandro Colomar2023-05-20-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | several times It can. $ echo -e 'GET / HTTP/1.1\r\nHost: _\n' | ncat localhost 80; HTTP/1.1 200 OK Content-Type: text/plain Server: Unit/1.30.0 Date: Sat, 20 May 2023 20:38:04 GMT Transfer-Encoding: chunked 9b Hello world! Request data: Method: GET Protocol: HTTP/1.1 Remote addr: 127.0.0.1 Local addr: 127.0.0.1 Target: / Path: / Fields: Host: _ 15 But send this first. 15 Some extra contents. e And some more 0 Signed-off-by: Alejandro Colomar <alx@kernel.org>
* Makefile: ffixAlejandro Colomar2023-05-20-5/+5
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* Makefile, nxt_unit_app_test.c: Set ftm(7) in $CPPFLAGSAlejandro Colomar2023-05-20-2/+1
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* nxt_unit_app_test.c: Use mempcpy(3)Alejandro Colomar2023-05-20-31/+21
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* Makefile: Create a preprocessed file, and allow appending flagsAlejandro Colomar2023-05-20-11/+32
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* nxt_unit_app_test.c: Also use nxt_unit_response_write(3)Alejandro Colomar2023-05-20-0/+7
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* nxt_unit_app_test.c: Use the example from nxt_response_buf_alloc(3)Alejandro Colomar2023-05-20-5/+6
| | | | | | | The text, and the order in which the calls are made, makes it more clear that the buffers can be sent in any order. Signed-off-by: Alejandro Colomar <alx@kernel.org>
* nxt_unit_app_test.c: Test having several buffers, and sending them in ↵Alejandro Colomar2023-05-20-1/+31
| | | | | | | | reverse creation order Suggested-by: Andrei Vasiliu <whyte.vuhuni@gmail.com> Link: <https://github.com/nginx/unit/issues/738> Signed-off-by: Alejandro Colomar <alx@kernel.org>
* nxt_unit_app_test.c: tfixAlejandro Colomar2023-05-09-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* Makefile: Silence a warning from GNU Make 4.4Alejandro Colomar2023-05-09-1/+4
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* Makefile: Use a variable for libunit's $prefixAlejandro Colomar2023-05-09-4/+7
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* nxt_unit_app_test.c: tfixAlejandro Colomar2022-09-01-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* nxt_unit_app_test.c: Move file to src/, and add missing definitionsAlejandro Colomar2022-08-30-1/+7
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* .gitignore: Add fileAlejandro Colomar2022-08-30-0/+1
| | | | | | Ignore tmp/, which is the . Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Makefile: Add fileAlejandro Colomar2022-08-30-0/+71
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Copy program from unit repoAlejandro Colomar2022-08-30-0/+281
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>