Debian Codegraph @

third_party/python/aiohttp/vendor/llhttp/test/request/finish.md

raw
1 Finish
2 ======
3
4 Those tests check the return codes and the behavior of `llhttp_finish()` C API.
5
6 ## It should be safe to finish after GET request
7
8 <!-- meta={"type": "request-finish"} -->
9 ```http
10 GET / HTTP/1.1
11
12
13 ```
14
15 ```log
16 off=0 message begin
17 off=0 len=3 span[method]="GET"
18 off=3 method complete
19 off=4 len=1 span[url]="/"
20 off=6 url complete
21 off=11 len=3 span[version]="1.1"
22 off=14 version complete
23 off=18 headers complete method=1 v=1/1 flags=0 content_length=0
24 off=18 message complete
25 off=NULL finish=0
26 ```
27
28 ## It should be unsafe to finish after incomplete PUT request
29
30 <!-- meta={"type": "request-finish"} -->
31 ```http
32 PUT / HTTP/1.1
33 Content-Length: 100
34
35 ```
36
37 ```log
38 off=0 message begin
39 off=0 len=3 span[method]="PUT"
40 off=3 method complete
41 off=4 len=1 span[url]="/"
42 off=6 url complete
43 off=11 len=3 span[version]="1.1"
44 off=14 version complete
45 off=16 len=14 span[header_field]="Content-Length"
46 off=31 header_field complete
47 off=32 len=3 span[header_value]="100"
48 off=NULL finish=2
49 ```
50
51 ## It should be unsafe to finish inside of the header
52
53 <!-- meta={"type": "request-finish"} -->
54 ```http
55 PUT / HTTP/1.1
56 Content-Leng
57 ```
58
59 ```log
60 off=0 message begin
61 off=0 len=3 span[method]="PUT"
62 off=3 method complete
63 off=4 len=1 span[url]="/"
64 off=6 url complete
65 off=11 len=3 span[version]="1.1"
66 off=14 version complete
67 off=16 len=12 span[header_field]="Content-Leng"
68 off=NULL finish=2
69 ```