second-state / wasmedge_wasi_socket

A Rust lib for socket on WasmEdge.
https://second-state.github.io/wasmedge_wasi_socket/
Apache License 2.0
70 stars 28 forks source link

examples/poll_http_server is wrong #46

Open L-jasmine opened 2 years ago

L-jasmine commented 2 years ago

If I Send a http request.like

GET /id=1 HTTP/1.1
Host: 127.0.0.1:8000
User-Agent: curl/7.64.1
Accept: */*
Accept-Encoding: gzip

when I send

GET /id=1 HTTP/1.1
Host: 127.0.0.1:8000

and sleep some time. then send

User-Agent: curl/7.64.1
Accept: */*
Accept-Encoding: gzip

when client sleep. poll_http_server go there L109 https://github.com/second-state/wasmedge_wasi_socket/blob/11be5c7e50c7da544182a82f23e1cf74b0944091/examples/poll_http_server/src/main.rs#L106-L111.

break will return and drop bs. just drop

GET /id=1 HTTP/1.1
Host: 127.0.0.1:8000