static int http_send_data(HTTPContext *c)

{

    int len, ret;



    while (c->buffer_ptr >= c->buffer_end) {

        ret = http_prepare_data(c);

        if (ret < 0)

            return -1;

        else if (ret == 0) {

            break;

        } else {

            /* state change requested */

            return 0;

        }

    }



    if (c->buffer_end > c->buffer_ptr) {

        len = write(c->fd, c->buffer_ptr, c->buffer_end - c->buffer_ptr);

        if (len < 0) {

            if (errno != EAGAIN && errno != EINTR) {

                /* error : close connection */

                return -1;

            }

        } else {

            c->buffer_ptr += len;

            c->data_count += len;

        }

    }

    return 0;

}

static int http_send_data(HTTPContext *c)

{

    int len, ret;



    while (c->buffer_ptr >= c->buffer_end) {

        ret = http_prepare_data(c);

        if (ret < 0)

            return -1;

        else if (ret == 0) {

            break;

        } else {

            

            return 0;

        }

    }



    if (c->buffer_end > c->buffer_ptr) {

        len = write(c->fd, c->buffer_ptr, c->buffer_end - c->buffer_ptr);

        if (len < 0) {

            if (errno != EAGAIN && errno != EINTR) {

                

                return -1;

            }

        } else {

            c->buffer_ptr += len;

            c->data_count += len;

        }

    }

    return 0;

}

            break;             break;             break;
static int FUNC_0(HTTPContext *VAR_0)

{

    int VAR_1, VAR_2;



    while (VAR_0->buffer_ptr >= VAR_0->buffer_end) {

        VAR_2 = http_prepare_data(VAR_0);

        if (VAR_2 < 0)

            return -1;

        else if (VAR_2 == 0) {

            break;

        } else {

            

            return 0;

        }

    }



    if (VAR_0->buffer_end > VAR_0->buffer_ptr) {

        VAR_1 = write(VAR_0->fd, VAR_0->buffer_ptr, VAR_0->buffer_end - VAR_0->buffer_ptr);

        if (VAR_1 < 0) {

            if (errno != EAGAIN && errno != EINTR) {

                

                return -1;

            }

        } else {

            VAR_0->buffer_ptr += VAR_1;

            VAR_0->data_count += VAR_1;

        }

    }

    return 0;

}

static int FUNC_0(HTTPContext *VAR_0)
{ int VAR_1, VAR_2; while (VAR_0->buffer_ptr >= VAR_0->buffer_end) { VAR_2 = http_prepare_data(VAR_0); if (VAR_2 < 0)
return -1; else if (VAR_2 == 0) { break; } else { return 0; } } if (VAR_0->buffer_end > VAR_0->buffer_ptr) { VAR_1 = write(VAR_0->fd, VAR_0->buffer_ptr, VAR_0->buffer_end - VAR_0->buffer_ptr); if (VAR_1 < 0) { if (errno != EAGAIN && errno != EINTR) { return -1; } } else { VAR_0->buffer_ptr += VAR_1; VAR_0->data_count += VAR_1; } } return 0; }