Table of Contents

OIL2 Class Standard.HTTPfastReceive

class Standard . HTTPfastReceive {
        int32   acceptID;
        string  bufferedData;
        string  defaultHost;
        oid     defaultURLdir;
        int32   doingSend;
        set     extraFeatureHeaders;
        string  fromAddr;
        array   header;
        oid     ioObj;
        int32   isHTTP10;
        string  keepAlive;
        int32   lineCount;
        any     logServiceName;
        assoc   options;
        string  protoVersion;
        int32   reqTime;
        int32   tolerateBadHTTP11;
        oid     urlDir;
        assoc   validRequests;
} inherits from Object;


The class HTTPfastReceive handles I/O on an HTTP 1.1 (or 1.0) session. Objects of class HTTPfastReceive are normally created as needed by the HTTPdaemon object associated with a primary web site.



HTTPfastReceive:create(oid newSocket, oid urlDirectory, string virtHost, optional int32 acceptCount)

Method Description

The object Id of an IOobject representing a newly accepted HTTP connection is passed as the argument newSocket. The object Id of the URLdirectory object associated with the default web site is passed as urlDirectory. It is used by HTTP/1.0-based connections that do not provide a Host: directive or if the specified Host: value is unknown. A unique Id, acceptID, can be provided to identify the session. It is not used directly.


HTTPfastReceive:returnError(int32 errCode, string reasonPhrase, string explain, optional int32 forceClose)

Method Description

An error response to an HTTP request is returned by the returnError method. If a custom error page is defined for the associated site (see URLdirectory:getErrorPageSource), it is used as a template.


HTTPfastReceive:sendResult(int32 errCode, string reasonPhrase, any headerData, any data)

Method Description

A non-error response to an HTTP request is returned via the sendResult method. While errors can be returned using sendResult, the returnError method should be used instead in order to enable custom error pages. The HTTP response code is specified as errCode. A text description associated with the result code is specified as reasonPhrase. For example, successful HTTP responses are indicated with errCode set to 200 and reasonPhrase set to the string "OK".

Any headers associated with response are specified as headerData. This can either be a string or a set of strings. A "Date:" and "Connection:" header are always generated by the HTTPfastReceive object and should never be provided in the headerData argument. Additional feature headers are obtained automatically from the URLdirectory object via its getFeatureHeaders method.

The body of the entity to be returned, if any, is specified as data. This can either be a string, a set of strings or an oid of an IOobject. If an oid is provided, it is passed to a SendFile object, which will perform the I/O transfer.

Return Value

This method does not return a value.

Generated: Wed, 14 Mar 2012 02:52:22 EDT
Support Information