Obtain information on a session.
Entry | ||
---|---|---|
R0 | Flags: | |
Bits 0-31 | Reserved (must be zero) | |
R1 | Session identifier | |
Exit | ||
R0 | Status word: | |
Bit 0 => | Connected to server | |
Bit 1 => | Sent request | |
Bit 2 => | Sent data | |
Bit 3 => | Initial response received | |
Bit 4 => | Transfer in progress | |
Bit 5 => | All data received | |
Bit 6 => | Transfer aborted | |
R1 | Preserved | |
R2 | Server response, as an “HTTP” response code (200, 401 etc.) | |
R3 | Bytes read so far (total body data count) | |
R4 | Total bytes to be transferred in whole transaction if known (approximate value only), or -1 if unknown | |
All other registers preserved |
Interrupt state undefined.
SWI is not re-entrant.
This SWI is used to monitor the transfer of data from a remote service. It is protocol independent – the exit status bits are common to all services. Clients must test this field bit-wise, since the value is cumulative.
Clients may not assume that the states returned in R0 will progress in any particular combination or order. However, the likely progression during a fetch for a resource being retrieved over a network (when the bits are combined into a single decimal value) is: 0,1,3,7,15,31 and then R0:5 set upon completion, and R0:6 set at any stage when an error has occurred.
Since each protocol module is returning its results according to the HTTP protocol, R2 can be treated as an HTTP response code whatever the URL being fetched. For example, the FileFetcher module will indicate file not found errors by setting the response code to 404 (HTTP’s Not Found error code).
Note that in the case of, for example, an HTTP 400 (Forbidden) return, some explanatory data may be received, too. If the amount of data to be received is unknown, R4 will contain -1, however R3 will contain the number of bytes received so far. The R4 value should be treated as approximate, since the exact interpretation varies between protocols.
When this SWI is called, the URL module invokes the Protocol_Status SWI for the protocol module concerned with the request.