From feda98f9c3ecadeaf364f16c12d112e19ce7183f Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 29 Sep 2017 18:06:25 -0400 Subject: about: Make path handlers send responses to WK --- (limited to 'src/about.c') diff --git a/src/about.c b/src/about.c index a4b4d39..c0ede12 100644 --- a/src/about.c +++ b/src/about.c @@ -53,12 +53,9 @@ parse_query_string(gchar *str) void mq_about_request(WebKitURISchemeRequest *request, MqApplication *application) { - const gchar *path; - gchar *query_str; - GHashTable *query; - gchar *contents; - gsize stream_length; - GInputStream *stream; + const gchar *path; + gchar *query_str; + GHashTable *query; path = webkit_uri_scheme_request_get_path(request); query_str = strchr(webkit_uri_scheme_request_get_uri(request), '?'); @@ -70,16 +67,23 @@ mq_about_request(WebKitURISchemeRequest *request, MqApplication *application) } if (g_strcmp0(path, "marquee") == 0) { - contents = mq_about_marquee_response(application, query); - stream_length = strlen(contents); - stream = g_memory_input_stream_new_from_data(contents, - stream_length, g_free); + mq_about_marquee_response(application, query, request); } else { return; } g_free(query_str); +} + +void +mq_about_response(WebKitURISchemeRequest *request, gchar *contents) +{ + gsize stream_length; + GInputStream *stream; + stream_length = strlen(contents); + stream = g_memory_input_stream_new_from_data(contents, + stream_length, g_free); webkit_uri_scheme_request_finish(request, stream, stream_length, "text/html"); g_object_unref(stream); -- cgit v0.9.1