From 64586b71f3b62fe79f3ff56d37b409c9fc5962b9 Mon Sep 17 00:00:00 2001 From: guonaihong Date: Wed, 12 Jun 2024 14:12:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 85d7eba..5b79777 100644 --- a/README.md +++ b/README.md @@ -33,34 +33,34 @@ "Cache-Control: max-age=0\r\n\r\nb\r\nhello world\r\n0\r\n\r\n") var setting = httparser.Setting{ - MessageBegin: func(*httparser.Parser) { + MessageBegin: func(*httparser.Parser, int) { //解析器开始工作 fmt.Printf("begin\n") }, - URL: func(_ *httparser.Parser, buf []byte) { + URL: func(_ *httparser.Parser, buf []byte, _ int) { //url数据 fmt.Printf("url->%s\n", buf) }, - Status: func(*httparser.Parser, []byte) { + Status: func(*httparser.Parser, []byte, _ int) { // 响应包才需要用到 }, - HeaderField: func(_ *httparser.Parser, buf []byte) { + HeaderField: func(_ *httparser.Parser, buf []byte, _ int) { // http header field fmt.Printf("header field:%s\n", buf) }, - HeaderValue: func(_ *httparser.Parser, buf []byte) { + HeaderValue: func(_ *httparser.Parser, buf []byte, _ int) { // http header value fmt.Printf("header value:%s\n", buf) }, - HeadersComplete: func(_ *httparser.Parser) { + HeadersComplete: func(_ *httparser.Parser, _ int) { // http header解析结束 fmt.Printf("header complete\n") }, - Body: func(_ *httparser.Parser, buf []byte) { + Body: func(_ *httparser.Parser, buf []byte, _ int) { fmt.Printf("%s", buf) // Content-Length 或者chunked数据包 }, - MessageComplete: func(_ *httparser.Parser) { + MessageComplete: func(_ *httparser.Parser, _ int) { // 消息解析结束 fmt.Printf("\n") },