int AXIS2_CALL cgi_stream_write()

in src/core/transport/http/server/CGI/axis2_cgi_stream.c [42:87]


int AXIS2_CALL cgi_stream_write(
    axutil_stream_t * stream,
    const axutil_env_t * env,
    const void *buffer,
    size_t count);

int AXIS2_CALL cgi_stream_read(
    axutil_stream_t * stream,
    const axutil_env_t * env,
    void *buffer,
    size_t count);

int AXIS2_CALL cgi_stream_skip(
    axutil_stream_t * stream,
    const axutil_env_t * env,
    int count);

int AXIS2_CALL cgi_stream_get_char(
    axutil_stream_t * stream,
    const axutil_env_t * env);

axutil_stream_t *AXIS2_CALL
axutil_stream_create_cgi(
    const axutil_env_t * env,
    unsigned int content_length)
{
    cgi_stream_impl_t *stream_impl = NULL;
    AXIS2_ENV_CHECK(env, NULL);
    AXIS2_PARAM_CHECK(env->error, content_length, NULL);

    stream_impl = (cgi_stream_impl_t *)AXIS2_MALLOC(env->allocator, sizeof(cgi_stream_impl_t));

    if(!stream_impl)
    {
        return NULL;
    }
    stream_impl->cur_pos = 0;
    stream_impl->content_length = content_length;
    stream_impl->stream_type = AXIS2_STREAM_MANAGED;

    axutil_stream_set_read(&(stream_impl->stream), env, cgi_stream_read);
    axutil_stream_set_write(&(stream_impl->stream), env, cgi_stream_write);
    axutil_stream_set_skip(&(stream_impl->stream), env, cgi_stream_skip);

    return &(stream_impl->stream);
}