Receive CGI Stateful Data (QzhbCgiRecvState_r) API

The QzhbCgiRecvState_r() API allows a high availability CGI programs to receive the CGI stateful data.

Required Parameter Group:
1 Target buffer Output Char(*)
2 Length of target buffer Input Binary(4)
3 Length of response Output Binary(4)
4 Continuation handle I/O Char(*)
5 Error Code I/O Char(*)

The HTTP Server receives the data for the next request to the stateful CGI so that if a failover occurs the data is available on the backup system (new primary system). This API is used with API QzhbCgiSendState_r().

Required parameter group

Target buffer
OUTPUT:CHAR(*)

The target buffer containing the state of a high availability CGI program.

Length of target buffer
INPUT:BINARY(4)

The length of the target buffer that receives the API output. The minimum length is 1 byte and the maximum length is 61,000 bytes.

Length of response
OUTPUT:BINARY(4)

The length of response is the actual length of the information that is returned from the target buffer. If this value is greater than the length of the target buffer, then there is more state to read. The difference between these two values represents the amount of bytes the caller should read in subsequent calls to this API.

Continuation handle
I/O:CHAR(*)

The continuation handle is the handle that is returned when more data is available to return, but the target buffer is not large enough. The caller must pass this handle to the QzhbCgiRecvState_r() API on subsequent calls as it was received from the previous call. On the first call to this API, the continuation handle must be set to 0 (equivalent to NULL in C). The caller must not allocate, deallocate, or modify the continuation handle. This field is set to 0 when all information is returned.

Error code
I/O:CHAR(*)

The structure in which to return error information. For the format of the structure, see the API error reporting topic in the IBM® i Information Center.

Error messages

CPF24B4 E
Severe Error while addressing parameter list.
CPF3C17 E
Error occurred with input data parameter.
CPF3CF1 E
Error code parameter not valid.
HTP4005 E
Highly Available CGI invoked QzhbCgiRecvState_r() after it had already received the entire state.
HTP4006 E
QzhbCgiRecvState_r() was called when there was no state.