File: finish.md

package info (click to toggle)
python-aiohttp 3.13.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,964 kB
  • sloc: python: 62,038; ansic: 20,773; makefile: 417; sh: 3
file content (75 lines) | stat: -rw-r--r-- 1,551 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Finish
======

Those tests check the return codes and the behavior of `llhttp_finish()` C API.

## It should be safe to finish after GET request

<!-- meta={"type": "request-finish"} -->
```http
GET / HTTP/1.1


```

```log
off=0 message begin
off=0 len=3 span[method]="GET"
off=3 method complete
off=4 len=1 span[url]="/"
off=6 url complete
off=6 len=4 span[protocol]="HTTP"
off=10 protocol complete
off=11 len=3 span[version]="1.1"
off=14 version complete
off=18 headers complete method=1 v=1/1 flags=0 content_length=0
off=18 message complete
off=NULL finish=0
```

## It should be unsafe to finish after incomplete PUT request

<!-- meta={"type": "request-finish"} -->
```http
PUT / HTTP/1.1
Content-Length: 100

```

```log
off=0 message begin
off=0 len=3 span[method]="PUT"
off=3 method complete
off=4 len=1 span[url]="/"
off=6 url complete
off=6 len=4 span[protocol]="HTTP"
off=10 protocol complete
off=11 len=3 span[version]="1.1"
off=14 version complete
off=16 len=14 span[header_field]="Content-Length"
off=31 header_field complete
off=32 len=3 span[header_value]="100"
off=NULL finish=2
```

## It should be unsafe to finish inside of the header

<!-- meta={"type": "request-finish"} -->
```http
PUT / HTTP/1.1
Content-Leng
```

```log
off=0 message begin
off=0 len=3 span[method]="PUT"
off=3 method complete
off=4 len=1 span[url]="/"
off=6 url complete
off=6 len=4 span[protocol]="HTTP"
off=10 protocol complete
off=11 len=3 span[version]="1.1"
off=14 version complete
off=16 len=12 span[header_field]="Content-Leng"
off=NULL finish=2
```