From 1b3efb35998e7dc7cc90729de2b5d9c4f1b0e9d3 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 25 Nov 2010 13:03:52 +0100 Subject: [PATCH] Save current input request --- gdk/broadway/gdkdisplay-broadway.c | 9 +++++++-- gdk/broadway/gdkdisplay-broadway.h | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gdk/broadway/gdkdisplay-broadway.c b/gdk/broadway/gdkdisplay-broadway.c index e752b6a4f5..0edda8da47 100644 --- a/gdk/broadway/gdkdisplay-broadway.c +++ b/gdk/broadway/gdkdisplay-broadway.c @@ -123,12 +123,12 @@ _gdk_input_init (GdkDisplay *display) g_list_free (list); } -typedef struct { +struct HttpRequest { GdkDisplay *display; GSocketConnection *connection; GDataInputStream *data; GString *request; -} HttpRequest; +}; static void http_request_free (HttpRequest *request) @@ -211,6 +211,9 @@ start_input (HttpRequest *request) gsize len; GChecksum *checksum; char *origin, *host; + GdkDisplayBroadway *display_broadway; + + display_broadway = GDK_DISPLAY_BROADWAY (request->display); lines = g_strsplit (request->request->str, "\n", 0); @@ -306,6 +309,8 @@ start_input (HttpRequest *request) g_output_stream_write_all (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)), challenge, 16, NULL, NULL, NULL); + display_broadway->input = request; + g_data_input_stream_read_upto_async (request->data, "\xff", 1, 0, NULL, (GAsyncReadyCallback)got_input, request); } diff --git a/gdk/broadway/gdkdisplay-broadway.h b/gdk/broadway/gdkdisplay-broadway.h index 8b5c83fa2e..160416def4 100644 --- a/gdk/broadway/gdkdisplay-broadway.h +++ b/gdk/broadway/gdkdisplay-broadway.h @@ -43,6 +43,8 @@ typedef struct _GdkDisplayBroadwayClass GdkDisplayBroadwayClass; #define GDK_IS_DISPLAY_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY_BROADWAY)) #define GDK_DISPLAY_BROADWAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY_BROADWAY, GdkDisplayBroadwayClass)) +typedef struct HttpRequest HttpRequest; + struct _GdkDisplayBroadway { GdkDisplay parent_instance; @@ -81,6 +83,7 @@ struct _GdkDisplayBroadway GSocketService *service; BroadwayOutput *output; + HttpRequest *input; }; struct _GdkDisplayBroadwayClass