mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-14 15:56:44 +03:00
Signify that Request and Response from RequestCtx and Header from Request and Response mustn't be copied by value
This commit is contained in:
@@ -16,6 +16,8 @@ import (
|
||||
// and use CopyTo() instead.
|
||||
type Request struct {
|
||||
// Request header
|
||||
//
|
||||
// Copying Header by value is forbidden. Use pointer to Header instead.
|
||||
Header RequestHeader
|
||||
|
||||
body []byte
|
||||
@@ -36,6 +38,8 @@ type Request struct {
|
||||
// and use CopyTo() instead.
|
||||
type Response struct {
|
||||
// Response header
|
||||
//
|
||||
// Copying Header by value is forbidden. Use pointer to Header instead.
|
||||
Header ResponseHeader
|
||||
|
||||
body []byte
|
||||
|
||||
@@ -219,9 +219,13 @@ func TimeoutHandler(h RequestHandler, timeout time.Duration, msg string) Request
|
||||
// before return.
|
||||
type RequestCtx struct {
|
||||
// Incoming request.
|
||||
//
|
||||
// Copying Request by value is forbidden. Use pointer to Request instead.
|
||||
Request Request
|
||||
|
||||
// Outgoing response.
|
||||
//
|
||||
// Copying Response by value is forbidden. Use pointer to Response instead.
|
||||
Response Response
|
||||
|
||||
id uint64
|
||||
|
||||
Reference in New Issue
Block a user