Skip to content

Commit 3bf9d05

Browse files
committed
review: clarify buffered {data,body}_size.
Signed-off-by: Piotr Sikora <[email protected]>
1 parent 792c95a commit 3bf9d05

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

abi-versions/v0.2.1/README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,12 @@ Plugin must return one of the following values:
832832
* returns:
833833
- `i32 (`[`proxy_action_t`]`) action`
834834

835-
Called for each data chunk received from downstream.
835+
Called for each data chunk received from downstream,
836+
even when the processing is paused.
837+
838+
`data_size` represents total available size of the data that can be
839+
retrieved, and its value will increment if the processing is paused
840+
and data is buffered by the host and not forwarded upstream.
836841

837842
Data (of `data_size`) can be retrieved and/or modified using
838843
[`proxy_get_buffer_bytes`] and/or [`proxy_set_buffer_bytes`]
@@ -867,7 +872,12 @@ Called when downstream connection is closed.
867872
* returns:
868873
- `i32 (`[`proxy_action_t`]`) action`
869874

870-
Called for each data chunk received from upstream.
875+
Called for each data chunk received from upstream,
876+
even when the processing is paused.
877+
878+
`data_size` represents total available size of the data that can be
879+
retrieved, and its value will increment if the processing is paused
880+
and data is buffered by the host and not forwarded downstream.
871881

872882
Data (of `data_size`) can be retrieved and/or modified using
873883
[`proxy_get_buffer_bytes`] and/or [`proxy_set_buffer_bytes`]
@@ -942,12 +952,17 @@ Plugin must return one of the following values:
942952
* returns:
943953
- `i32 (`[`proxy_action_t`]`) action`
944954

945-
Called for each chunk of HTTP request body received from downstream.
955+
Called for each chunk of HTTP request body received from downstream,
956+
even when the processing is paused.
946957

947958
Request body chunk (of `body_size`) can be retrieved and/or modified
948959
using [`proxy_get_buffer_bytes`] and/or [`proxy_set_buffer_bytes`]
949960
with `buffer_id` set to `HTTP_REQUEST_BODY`.
950961

962+
`body_size` represents total available size of the body that can be
963+
retrieved, and its value will increment if the processing is paused
964+
and the body is buffered by the host and not forwarded upstream.
965+
951966
Paused HTTP request can be resumed using [`proxy_continue_stream`]
952967
or closed using [`proxy_close_stream`] with `stream_type` set to
953968
`HTTP_REQUEST`.
@@ -1032,12 +1047,17 @@ Plugin must return one of the following values:
10321047
* returns:
10331048
- `i32 (`[`proxy_action_t`]`) action`
10341049

1035-
Called for each chunk of HTTP response body received from upstream.
1050+
Called for each chunk of HTTP response body received from upstream,
1051+
even when the processing is paused.
10361052

10371053
Response body chunk (of `body_size`) can be retrieved and/or modified
10381054
using [`proxy_get_buffer_bytes`] and/or [`proxy_set_buffer_bytes`]
10391055
with `buffer_id` set to `HTTP_RESPONSE_BODY`.
10401056

1057+
`body_size` represents total available size of the body that can be
1058+
retrieved, and its value will increment if the processing is paused
1059+
and the body is buffered by the host and not forwarded downstream.
1060+
10411061
Paused HTTP response can be resumed using [`proxy_continue_stream`]
10421062
or closed using [`proxy_close_stream`] with `stream_type` set to
10431063
`HTTP_RESPONSE`.

0 commit comments

Comments
 (0)