Method: OvirtSDK4::HttpClient#send

Defined in:
ext/ovirtsdk4c/ov_http_client.c

#send(request) ⇒ Object

[View source]

1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
# File 'ext/ovirtsdk4c/ov_http_client.c', line 1092

static VALUE ov_http_client_send(VALUE self, VALUE request) {
    ov_http_client_object* ptr;

    /* Get the pointer to the native object and check that it isn't closed: */
    ov_http_client_ptr(self, ptr);
    ov_http_client_check_closed(ptr);

    /* If the limit hasn't been reached then submit the request directly to libcurl, otherwise put it in the queue: */
    if (RHASH_SIZE(ptr->pending) < ptr->limit) {
        ov_http_client_submit(self, request);
    }
    else {
        rb_ary_push(ptr->queue, request);
    }

    return Qnil;
}