mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-29 06:51:10 +00:00
Save current input request
This commit is contained in:
parent
1ba38a48d7
commit
1b3efb3599
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user