Save current input request

This commit is contained in:
Alexander Larsson 2010-11-25 13:03:52 +01:00
parent 1ba38a48d7
commit 1b3efb3599
2 changed files with 10 additions and 2 deletions

View File

@ -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);
}

View File

@ -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