From aa4d86b81f6095316813c599659014c15bf9b935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 24 Sep 2014 14:39:17 +0300 Subject: Remove the onrequest hook It was redundant with middlewares. Allows us to save a few operations for every incoming requests. --- doc/src/manual/cowboy.ezdoc | 9 --------- doc/src/manual/cowboy_protocol.ezdoc | 5 ----- doc/src/manual/cowboy_req.ezdoc | 6 ++---- doc/src/manual/cowboy_spdy.ezdoc | 5 ----- 4 files changed, 2 insertions(+), 23 deletions(-) (limited to 'doc/src/manual') diff --git a/doc/src/manual/cowboy.ezdoc b/doc/src/manual/cowboy.ezdoc index 209d473..c26ed37 100644 --- a/doc/src/manual/cowboy.ezdoc +++ b/doc/src/manual/cowboy.ezdoc @@ -25,15 +25,6 @@ A binary status can be used to set a custom message. HTTP version. -: onrequest_fun() = fun((cowboy_req:req()) -> cowboy_req:req()) - -Fun called immediately after receiving a request. - -It can perform any operation on the Req object, including -reading the request body or replying. If a reply is sent, -the processing of the request ends here, before any middleware -is executed. - : onresponse_fun() = fun((http_status(), http_headers(), iodata(), cowboy_req:req()) -> cowboy_req:req()) diff --git a/doc/src/manual/cowboy_protocol.ezdoc b/doc/src/manual/cowboy_protocol.ezdoc index 6813295..335f2ff 100644 --- a/doc/src/manual/cowboy_protocol.ezdoc +++ b/doc/src/manual/cowboy_protocol.ezdoc @@ -14,7 +14,6 @@ as a Ranch protocol. | {max_keepalive, non_neg_integer()} | {max_request_line_length, non_neg_integer()} | {middlewares, [module()]} - | {onrequest, cowboy:onrequest_fun()} | {onresponse, cowboy:onresponse_fun()} | {timeout, timeout()}] @@ -67,10 +66,6 @@ Maximum length of the request line. List of middlewares to execute for every requests. -: onrequest (undefined) - -Fun called every time a request is received. - : onresponse (undefined) Fun called every time a response is sent. diff --git a/doc/src/manual/cowboy_req.ezdoc b/doc/src/manual/cowboy_req.ezdoc index 94556b2..bcec9b9 100644 --- a/doc/src/manual/cowboy_req.ezdoc +++ b/doc/src/manual/cowboy_req.ezdoc @@ -126,8 +126,7 @@ Types: Return the requested URL excluding the path component. This function will always return `undefined` until the -`cowboy_router` middleware has been executed. This includes -the `onrequest` hook. +`cowboy_router` middleware has been executed. : match_cookies(Req, Fields) -> Map @@ -371,8 +370,7 @@ Types: Return the requested URL. This function will always return `undefined` until the -`cowboy_router` middleware has been executed. This includes -the `onrequest` hook. +`cowboy_router` middleware has been executed. : version(Req) -> Version diff --git a/doc/src/manual/cowboy_spdy.ezdoc b/doc/src/manual/cowboy_spdy.ezdoc index 51a2110..534434c 100644 --- a/doc/src/manual/cowboy_spdy.ezdoc +++ b/doc/src/manual/cowboy_spdy.ezdoc @@ -6,7 +6,6 @@ The `cowboy_spdy` module implements SPDY/3 as a Ranch protocol. : opts() = [{env, cowboy_middleware:env()} | {middlewares, [module()]} - | {onrequest, cowboy:onrequest_fun()} | {onresponse, cowboy:onresponse_fun()}] Configuration for the SPDY protocol handler. @@ -30,10 +29,6 @@ Initial middleware environment. List of middlewares to execute for every requests. -: onrequest (undefined) - -Fun called every time a request is received. - : onresponse (undefined) Fun called every time a response is sent. -- cgit v1.2.3