diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-09-29 18:06:25 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-09-29 18:06:25 (EDT) |
commit | feda98f9c3ecadeaf364f16c12d112e19ce7183f (patch) | |
tree | 78c71643bedbd32a81502219d6c40db3c6934da6 /src/about.c | |
parent | 85b5c16b09320d6da34dd552c79ad28a43e9debf (diff) | |
download | marquee-feda98f9c3ecadeaf364f16c12d112e19ce7183f.zip marquee-feda98f9c3ecadeaf364f16c12d112e19ce7183f.tar.gz marquee-feda98f9c3ecadeaf364f16c12d112e19ce7183f.tar.bz2 |
about: Make path handlers send responses to WK
Diffstat (limited to 'src/about.c')
-rw-r--r-- | src/about.c | 24 |
1 files changed, 14 insertions, 10 deletions
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); |