static HrtBuffer* hwf_request_container_create_buffer(HioMessage *message) { HwfRequestContainer *request = HWF_REQUEST_CONTAINER(message); return hjs_runtime_create_buffer(request->runtime); }
static void hwf_request_container_finalize(GObject *object) { HwfRequestContainer *container; container = HWF_REQUEST_CONTAINER(object); G_OBJECT_CLASS(hwf_request_container_parent_class)->finalize(object); }
static gboolean on_request_run(HrtTask *task, HrtWatcherFlags flags, void *data) { HwfRequestContainer *request; request = HWF_REQUEST_CONTAINER(data); hwf_request_container_execute(request, task); return FALSE; }
static void hwf_request_container_dispose(GObject *object) { HwfRequestContainer *container; container = HWF_REQUEST_CONTAINER(object); if (container->runtime != NULL) { g_object_unref(container->runtime); container->runtime = NULL; } G_OBJECT_CLASS(hwf_request_container_parent_class)->dispose(object); }
static void hwf_request_container_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { HwfRequestContainer *container; container = HWF_REQUEST_CONTAINER(object); switch (prop_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
static GObject* hwf_request_container_constructor(GType type, guint n_construct_properties, GObjectConstructParam *construct_params) { GObject *object; HwfRequestContainer *container; object = G_OBJECT_CLASS(hwf_request_container_parent_class)->constructor(type, n_construct_properties, construct_params); container = HWF_REQUEST_CONTAINER(object); return object; }
static gboolean on_request_completed(HrtTask *task, HrtWatcherFlags flags, void *data) { HwfRequestContainer *request; HioResponseHttp *response; request = HWF_REQUEST_CONTAINER(data); hrt_debug("Task %p request %p completed", task, request); /* Automatically send headers and close the body, * if it wasn't done already. */ response = hio_request_http_get_response(HIO_REQUEST_HTTP(request)); hio_response_http_send_headers(response); hio_response_http_close(response); return FALSE; }
static HioRequestHttp* hwf_connection_container_create_request(HioConnectionHttp *http, const char *method, int major_version, int minor_version, const char *path, const char *query_string) { HioRequestHttp *request; GValue value = { 0, }; request = hio_request_http_new(HWF_TYPE_REQUEST_CONTAINER, method, major_version, minor_version, path, query_string); g_value_init(&value, HJS_TYPE_RUNTIME); if (!hrt_task_get_arg(HIO_CONNECTION(http)->task, "runtime", &value, NULL)) g_error("Task didn't have a runtime set on it"); hwf_request_container_set_runtime(HWF_REQUEST_CONTAINER(request), g_value_get_object(&value)); g_value_unset(&value); hrt_debug("Created request %s %d.%d '%s' query '%s'", hio_request_http_get_method(request), hio_request_http_get_major_version(request), hio_request_http_get_minor_version(request), hio_request_http_get_path(request), hio_request_http_get_query_string(request)); return request; }