Sometimes we need to use some information that can't be predicted
before running the extern plugin. For example, access the
`ngx.var.request_start_time` in the extern plugin.

Hence, we add a pair of messages: ExtraInfoReq & ExtraInfoResp.

Now a request from APISIX to Plugin Runner will be like this:

```
APISIX sends HTTPReqCallReq
while reply from Runner isn't HTTPReqCallResp:
    APISIX handle ExtraInfoReq
    APISIX sends ExtraInfoResp
APISIX handle HTTPReqCallResp
```

The ExtraInfo schema is:

```
namespace A6.ExtraInfo;

table Var {
    name:string;
}

table ReqBody {
}

union Info {
    // Get the `ngx.var.name`
    Var,
    // Get the request body
    ReqBody,
}

table Req {
    info:Info;
}

table Resp {
    result:[ubyte];
}
```


In some situations, user may want to process request body that is
greater than 16M.
Although handling a large body in the extern plugin is discourage, we
still need to way to adapt it instead of just raise an error.

To solve this problem, let's extend the current rpc header.

Normally we have a header like this:

1 byte type + 3 byte length + body

Since body can't be zero in all known types, we can introduce an
extension with zero length placeholder.

Now we can accept such a header to represent a body larger than 16M:

1 byte type + 3 byte zero + 4 byte length + body.

Body larger than 4GB is unsupported since we will buffer the whole
body both in APISIX and in Runner.

Reply via email to