Outstanding GIOChannel issues



The implementation of the new GIOChannel API for 2.0 is mostly complete, but
there are a few outstanding issues I'd like some comments on:

  * win32 implmentation:

    Currently being handled by Hans Breuer (many thanks). These include
    bug 57689, bug 57690, bug 57691, and bug 57692. Hans, would you like
    me to transfer ownership of these bugs to you?

    The problem in this area that worries me is that we haven't made up our
    minds how to handle O_BINARY (bug 57695). Ideas? Opinions? Anyone?

  * character-at-a-time read:

    For variable width UTF-8 charaters, the current API
    would require users to write code of the form:

    char buf[6];
    GIOStatus status;
    gsize char_size, loop;
    GError *err = NULL;

    for (loop = 1; loop <= 6; ++loop)
      {
        status = g_io_channel_read_chars (channel, buf, loop, &char_size, &err);

        if (char_size != 0 || status != G_IO_STATUS_NORMAL)
          break;
      }

    g_assert (loop <= 6);

    /* Handle cases */

    which is ugly, and requires a lot of unnecessary looping. On the
    other hand, it would be possible to write

    GIOStatus g_io_channel_get_unichar (GIOChannel *channel,
                                        gunichar   *char,
                                        GError     *error);

    into the API with minimal effort. Is this an important issue, or
    are we too late into the API freeze? Owen?

  * error handling in g_io_channel_write_chars()

    I think we're going to have to allow for the possibility of partial
    writes on the channel. In the relevant case, part of the
    (aribitrarily large, much greater than buf_size) data has been
    written to disk, and the next write returns G_IO_STATUS_AGAIN.
    In this case, I think the sensible thing to do is return
    G_IO_STATUS_NORMAL, and set bytes_written to whatever we've
    been able to write so far (including copying to the buffer).

    If we allow partial writes, do we still want to use the partial_chars_buffer
    for partial characters at the end of input?

    Owen, I would really like to hear your opinion on this.

  * minor issues

    * public/private parts of GIOChannel:

      I've marked the close_on_unref flag public, since it's
      safe to have users twiddle that one. Everything else
      is marked private. The only exception that may be necessary
      to this are the is_readable and is_writeable flags,
      which the people at GNet may need to twiddle in
      their wrapper for the unix shutdown() function,
      among other places.

    * documentation fixes:

      In some places, the documentation has gotten out of sync
      with the implmentation. I'll fix those once the above issues are
      resolved.

    * bug fixes:

      forever and always

    * bug 52811 (the old GIOChannel API bug):

      Owen, can you close this? I don't have the necessary permissions.

As always, any comments are welcome.

Ron Steinke




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]