1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

pico: small refactor (#9857)

This commit is contained in:
Anton Zavodchikov
2021-04-24 15:21:30 +05:00
committed by GitHub
parent 8ccdae6188
commit dee4904bee
4 changed files with 67 additions and 132 deletions

View File

@ -19,7 +19,7 @@ fn hello_response() string {
return 'Hello, World!'
}
fn callback(req picohttpparser.Request, mut res picohttpparser.Response) {
fn callback(data voidptr, req picohttpparser.Request, mut res picohttpparser.Response) {
if picohttpparser.cmpn(req.method, 'GET ', 4) {
if picohttpparser.cmp(req.path, '/t') {
res.http_ok()
@ -39,6 +39,7 @@ fn callback(req picohttpparser.Request, mut res picohttpparser.Response) {
} else {
res.http_405()
}
res.end()
}
fn main() {