(GAsyncReadyCallback)got_input, request);
}
+static void
+send_error (HttpRequest *request,
+ int error_code,
+ const char *reason)
+{
+ char *res;
+
+ res = g_strdup_printf ("HTTP/1.0 %d %s\r\n\r\n"
+ "<html><head><title>%d %s</title></head>"
+ "<body>%s</body></html>",
+ error_code, reason,
+ error_code, reason,
+ reason);
+ /* TODO: This should really be async */
+ g_output_stream_write_all (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
+ res, strlen (res), NULL, NULL, NULL);
+ g_free (res);
+ http_request_free (request);
+}
+
static void
start_input (HttpRequest *request)
{
http_request_free (request);
}
-static void
-send_error (HttpRequest *request,
- int error_code,
- const char *reason)
-{
- char *res;
-
- res = g_strdup_printf ("HTTP/1.0 %d %s\r\n\r\n"
- "<html><head><title>%d %s</title></head>"
- "<body>%s</body></html>",
- error_code, reason,
- error_code, reason,
- reason);
- /* TODO: This should really be async */
- g_output_stream_write_all (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
- res, strlen (res), NULL, NULL, NULL);
- g_free (res);
- http_request_free (request);
-}
-
static void
send_data (HttpRequest *request,
const char *mimetype,