[glib-networking/mcatanzaro/tls-thread] progress
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/mcatanzaro/tls-thread] progress
- Date: Sun, 11 Aug 2019 18:05:44 +0000 (UTC)
commit 87d40f9063c433b372224f9e49f909173aed5f33
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sun Aug 11 13:05:24 2019 -0500
progress
tls/base/gtlsconnection-base.c | 16 ++++++++++++++++
tls/base/gtlsthread.c | 5 +++--
2 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/tls/base/gtlsconnection-base.c b/tls/base/gtlsconnection-base.c
index f900f30..66038b6 100644
--- a/tls/base/gtlsconnection-base.c
+++ b/tls/base/gtlsconnection-base.c
@@ -928,17 +928,33 @@ tls_source_sync (GTlsConnectionBaseSource *tls_source)
tls_source->child_source);
g_source_unref (tls_source->child_source);
}
+GTLS_DEBUG (tls, "%s: tls_source=%p op_waiting=%d io_waiting=%d", __FUNCTION__, tls_source, op_waiting,
io_waiting);
if (op_waiting)
+{
+GTLS_DEBUG (tls, "created GCancellableSource");
tls_source->child_source = g_cancellable_source_new (priv->waiting_for_op);
+}
else if (io_waiting && G_IS_DATAGRAM_BASED (tls_source->base))
+{
+GTLS_DEBUG (tls, "created GDatagramBasedSource");
tls_source->child_source = g_datagram_based_create_source (priv->base_socket, tls_source->condition,
NULL);
+}
else if (io_waiting && G_IS_POLLABLE_INPUT_STREAM (tls_source->base))
+{
+GTLS_DEBUG (tls, "created GPollableInputStreamSource");
tls_source->child_source = g_pollable_input_stream_create_source (priv->base_istream, NULL);
+}
else if (io_waiting && G_IS_POLLABLE_OUTPUT_STREAM (tls_source->base))
+{
+GTLS_DEBUG (tls, "created GPollableOutputStreamSource");
tls_source->child_source = g_pollable_output_stream_create_source (priv->base_ostream, NULL);
+}
else
+{
+GTLS_DEBUG (tls, "op ready, created GTimeoutSource and it's set to expire!");
tls_source->child_source = g_timeout_source_new (0);
+}
g_source_set_callback (tls_source->child_source, dummy_callback, NULL, NULL);
g_source_add_child_source ((GSource *)tls_source, tls_source->child_source);
diff --git a/tls/base/gtlsthread.c b/tls/base/gtlsthread.c
index a599da5..9575ed8 100644
--- a/tls/base/gtlsthread.c
+++ b/tls/base/gtlsthread.c
@@ -439,8 +439,9 @@ GTLS_OP_DEBUG (op, "%s: delayed_op=%p type=%d", __FUNCTION__, delayed_op, op->ty
g_clear_error (&op->error);
g_set_error (&op->error, G_IO_ERROR, G_IO_ERROR_CANCELLED,
_("Operation cancelled"));
+ goto finished;
}
- else
+ else /* FIXME: this could trigger if GTlsConnectionBase yielded an op, even if op isn't ready. We
need to do the check timeout/reschedule dance */
{
GTLS_OP_DEBUG (op, "Delayed op %p timed out!", op);
g_assert (op->timeout != -1);
@@ -509,7 +510,7 @@ GTLS_OP_DEBUG (op, "%s: New op %p from queue", __FUNCTION__, op);
g_source_set_callback (tls_source, G_SOURCE_FUNC (resume_dtls_op), data, NULL);
else
g_source_set_callback (tls_source, G_SOURCE_FUNC (resume_tls_op), data, NULL);
-
+GTLS_OP_DEBUG (op, "%s: created tls_source %p for op %p", __FUNCTION__, tls_source, op);
main_context = g_main_loop_get_context (main_loop);
g_source_attach (tls_source, main_context);
g_source_unref (tls_source);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]