[phodav,02/13] spice: rename my_input_channel

Submitted by Jakub Janku on May 23, 2019, 8:37 a.m.

Details

Message ID 20190523083725.1554-3-jjanku@redhat.com
State New
Headers show
Series "Miscellaneous series" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Jakub Janku May 23, 2019, 8:37 a.m.
my_input_channel_* isn't saying much,
let's rename it to input_channel_*_thread,
which is more fitting.

Signed-off-by: Jakub Janků <jjanku@redhat.com>
---
 spice/spice-webdavd.c | 48 +++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

Patch hide | download patch | download mbox

diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
index 81fe6be..e494692 100644
--- a/spice/spice-webdavd.c
+++ b/spice/spice-webdavd.c
@@ -307,11 +307,11 @@  read_thread (GTask *task,
 
   data = g_task_get_task_data (task);
 
-  g_debug ("my read %" G_GSIZE_FORMAT, data->count);
+  g_debug ("thread read %" G_GSIZE_FORMAT, data->count);
   g_input_stream_read_all (stream,
                            data->buffer, data->count, &bread,
                            cancellable, &error);
-  g_debug ("my read result %" G_GSIZE_FORMAT, bread);
+  g_debug ("thread read result %" G_GSIZE_FORMAT, bread);
 
   if (error)
     {
@@ -329,13 +329,13 @@  read_thread (GTask *task,
 }
 
 static void
-my_input_stream_read_async (GInputStream       *stream,
-                            void               *buffer,
-                            gsize               count,
-                            int                 io_priority,
-                            GCancellable       *cancellable,
-                            GAsyncReadyCallback callback,
-                            gpointer            user_data)
+input_stream_read_async_thread (GInputStream       *stream,
+                                void               *buffer,
+                                gsize               count,
+                                int                 io_priority,
+                                GCancellable       *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer            user_data)
 {
   GTask *task;
   ReadData *data = g_new (ReadData, 1);
@@ -351,9 +351,9 @@  my_input_stream_read_async (GInputStream       *stream,
 }
 
 static gssize
-my_input_stream_read_finish (GInputStream *stream,
-                             GAsyncResult *result,
-                             GError      **error)
+input_stream_read_thread_finish (GInputStream *stream,
+                                 GAsyncResult *result,
+                                 GError      **error)
 {
   g_return_val_if_fail (g_task_is_valid (result, stream), -1);
 
@@ -392,7 +392,7 @@  mux_data_read_cb (GObject      *source_object,
   GError *error = NULL;
   gssize size;
 
-  size = my_input_stream_read_finish (G_INPUT_STREAM (source_object), res, &error);
+  size = input_stream_read_thread_finish (G_INPUT_STREAM (source_object), res, &error);
   g_return_if_fail (size == demux.size);
   if (error)
     {
@@ -422,13 +422,13 @@  mux_size_read_cb (GObject      *source_object,
   GError *error = NULL;
   gssize size;
 
-  size = my_input_stream_read_finish (G_INPUT_STREAM (source_object), res, &error);
+  size = input_stream_read_thread_finish (G_INPUT_STREAM (source_object), res, &error);
   if (error || size != sizeof (guint16))
     goto end;
 
-  my_input_stream_read_async (istream,
-                              &demux.buf, demux.size, G_PRIORITY_DEFAULT,
-                              cancel, mux_data_read_cb, NULL);
+  input_stream_read_async_thread (istream,
+                                  &demux.buf, demux.size, G_PRIORITY_DEFAULT,
+                                  cancel, mux_data_read_cb, NULL);
   return;
 
 end:
@@ -450,13 +450,13 @@  mux_client_read_cb (GObject      *source_object,
   GError *error = NULL;
   gssize size;
 
-  size = my_input_stream_read_finish (G_INPUT_STREAM (source_object), res, &error);
+  size = input_stream_read_thread_finish (G_INPUT_STREAM (source_object), res, &error);
   g_debug ("read %" G_GSSIZE_FORMAT, size);
   if (error || size != sizeof (gint64))
     goto end;
-  my_input_stream_read_async (istream,
-                              &demux.size, sizeof (guint16), G_PRIORITY_DEFAULT,
-                              cancel, mux_size_read_cb, NULL);
+  input_stream_read_async_thread (istream,
+                                  &demux.size, sizeof (guint16), G_PRIORITY_DEFAULT,
+                                  cancel, mux_size_read_cb, NULL);
   return;
 
 end:
@@ -475,9 +475,9 @@  end:
 static void
 start_mux_read (GInputStream *istream)
 {
-  my_input_stream_read_async (istream,
-                              &demux.client, sizeof (gint64), G_PRIORITY_DEFAULT,
-                              cancel, mux_client_read_cb, NULL);
+  input_stream_read_async_thread (istream,
+                                  &demux.client, sizeof (gint64), G_PRIORITY_DEFAULT,
+                                  cancel, mux_client_read_cb, NULL);
 }
 
 static void client_start_read (Client *client);

Comments

Hi

On Thu, May 23, 2019 at 10:37 AM Jakub Janků <jjanku@redhat.com> wrote:
>
> my_input_channel_* isn't saying much,
> let's rename it to input_channel_*_thread,
> which is more fitting.
>
> Signed-off-by: Jakub Janků <jjanku@redhat.com>
> ---
>  spice/spice-webdavd.c | 48 +++++++++++++++++++++----------------------
>  1 file changed, 24 insertions(+), 24 deletions(-)
>
> diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
> index 81fe6be..e494692 100644
> --- a/spice/spice-webdavd.c
> +++ b/spice/spice-webdavd.c
> @@ -307,11 +307,11 @@ read_thread (GTask *task,
>
>    data = g_task_get_task_data (task);
>
> -  g_debug ("my read %" G_GSIZE_FORMAT, data->count);
> +  g_debug ("thread read %" G_GSIZE_FORMAT, data->count);
>    g_input_stream_read_all (stream,
>                             data->buffer, data->count, &bread,
>                             cancellable, &error);
> -  g_debug ("my read result %" G_GSIZE_FORMAT, bread);
> +  g_debug ("thread read result %" G_GSIZE_FORMAT, bread);
>
>    if (error)
>      {
> @@ -329,13 +329,13 @@ read_thread (GTask *task,
>  }
>
>  static void
> -my_input_stream_read_async (GInputStream       *stream,
> -                            void               *buffer,
> -                            gsize               count,
> -                            int                 io_priority,
> -                            GCancellable       *cancellable,
> -                            GAsyncReadyCallback callback,
> -                            gpointer            user_data)
> +input_stream_read_async_thread (GInputStream       *stream,
> +                                void               *buffer,
> +                                gsize               count,
> +                                int                 io_priority,
> +                                GCancellable       *cancellable,
> +                                GAsyncReadyCallback callback,
> +                                gpointer            user_data)

for consistency, keep the suffix _async (& _finish)

ack otherwise

>  {
>    GTask *task;
>    ReadData *data = g_new (ReadData, 1);
> @@ -351,9 +351,9 @@ my_input_stream_read_async (GInputStream       *stream,
>  }
>
>  static gssize
> -my_input_stream_read_finish (GInputStream *stream,
> -                             GAsyncResult *result,
> -                             GError      **error)
> +input_stream_read_thread_finish (GInputStream *stream,
> +                                 GAsyncResult *result,
> +                                 GError      **error)
>  {
>    g_return_val_if_fail (g_task_is_valid (result, stream), -1);
>
> @@ -392,7 +392,7 @@ mux_data_read_cb (GObject      *source_object,
>    GError *error = NULL;
>    gssize size;
>
> -  size = my_input_stream_read_finish (G_INPUT_STREAM (source_object), res, &error);
> +  size = input_stream_read_thread_finish (G_INPUT_STREAM (source_object), res, &error);
>    g_return_if_fail (size == demux.size);
>    if (error)
>      {
> @@ -422,13 +422,13 @@ mux_size_read_cb (GObject      *source_object,
>    GError *error = NULL;
>    gssize size;
>
> -  size = my_input_stream_read_finish (G_INPUT_STREAM (source_object), res, &error);
> +  size = input_stream_read_thread_finish (G_INPUT_STREAM (source_object), res, &error);
>    if (error || size != sizeof (guint16))
>      goto end;
>
> -  my_input_stream_read_async (istream,
> -                              &demux.buf, demux.size, G_PRIORITY_DEFAULT,
> -                              cancel, mux_data_read_cb, NULL);
> +  input_stream_read_async_thread (istream,
> +                                  &demux.buf, demux.size, G_PRIORITY_DEFAULT,
> +                                  cancel, mux_data_read_cb, NULL);
>    return;
>
>  end:
> @@ -450,13 +450,13 @@ mux_client_read_cb (GObject      *source_object,
>    GError *error = NULL;
>    gssize size;
>
> -  size = my_input_stream_read_finish (G_INPUT_STREAM (source_object), res, &error);
> +  size = input_stream_read_thread_finish (G_INPUT_STREAM (source_object), res, &error);
>    g_debug ("read %" G_GSSIZE_FORMAT, size);
>    if (error || size != sizeof (gint64))
>      goto end;
> -  my_input_stream_read_async (istream,
> -                              &demux.size, sizeof (guint16), G_PRIORITY_DEFAULT,
> -                              cancel, mux_size_read_cb, NULL);
> +  input_stream_read_async_thread (istream,
> +                                  &demux.size, sizeof (guint16), G_PRIORITY_DEFAULT,
> +                                  cancel, mux_size_read_cb, NULL);
>    return;
>
>  end:
> @@ -475,9 +475,9 @@ end:
>  static void
>  start_mux_read (GInputStream *istream)
>  {
> -  my_input_stream_read_async (istream,
> -                              &demux.client, sizeof (gint64), G_PRIORITY_DEFAULT,
> -                              cancel, mux_client_read_cb, NULL);
> +  input_stream_read_async_thread (istream,
> +                                  &demux.client, sizeof (gint64), G_PRIORITY_DEFAULT,
> +                                  cancel, mux_client_read_cb, NULL);
>  }
>
>  static void client_start_read (Client *client);
> --
> 2.21.0
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel