qulogic/pidgin

queuedoutputstream: Refactor to behave better with the rest of Gio

PurpleQueuedOutputStream uses purple_queued_output_stream_push_bytes()
in order to queue bytes to be flushed. This requires consuming code to
call flush when it's not already flushing, and doesn't allow other
GOutputStream operations to behave well in combination with the
queued operations.

This patch refactors PurpleQueuedOutputStream to behave more like other
GOutputStream operations. It adds
purple_queued_output_stream_push_bytes_async(), which has the same
signature as the write_async functions. This way, if the there are
already queued bytes, it will send the new bytes when their turn
has come, and if not, it will start sending the new bytes immediately.
No need to flush. If a non-queued operation is attempted, it will
behave the same as if any other operation is pending. If a non-queued
operation is pending and a queued operation is attempted, it will
behave the same as a non-queued operation.

Now that the callback is called per async operation, if there's a
fatal error, all remaining queued operations will likely return
this same error. purple_queued_output_stream_clear_queue() was added
to handle this issue. If a fatal error occurs, call
purple_queued_output_stream_clear_queue() in
purple_queued_output_stream_push_bytes_async()'s callback in order
to clear the queue and avoid excessive errors returning.
# Purple, Pidgin and Finch
See AUTHORS and COPYRIGHT for the list of contributors.
libpurple is a library intended to be used by programmers seeking
to write an IM client that connects to many IM networks. It supports
AIM, ICQ, and XMPP, among others.
Pidgin is a graphical IM client written in C which uses the GTK+
toolkit.
Finch is a text-based IM client written in C which uses the ncurses
toolkit.
These programs are not endorsed by, nor affiliated with, AOL nor any
other company in any way.
## BUILD
Pidgin uses [meson](https://mesonbuild.com) as a build system.
You can quickly build Pidgin with the following commands
meson build
cd build
ninja
sudo ninja install
There are quite a few options for the build that you can view by looking at `meson_options.txt`. You can specify the options when running meson like the following:
meson -Ddebug=true build
If you've already ran meson you can use `meson configure`
cd build
meson configure -Ddebug=true
## RUN
Currently Pidgin can not be run from a build directory which means you must
install it first. Once you've done that, you only need to run 'pidgin' or
'finch'.
To get started, simply add a new account.
If you come across a bug, please report it at: https://developer.pidgin.im/
## PLUGINS
If you do not wish to enable the plugin support within Purple, run meson with
`-Dplugins=false` or if you've already ran meson use
`meson configure -Dplugins=false` from the build directory. This will prevent
the ability to load plugins.
`ninja install` puts the plugins in `$PREFIX/lib/purple` (PREFIX being what
you specified when you ran meson. It defaults to `/usr/local`). Purple
looks for the plugins in that directory by default. Plugins can be installed
per-user in `~/.purple/plugins` as well. Pidgin and Finch also look in
`$PREFIX/lib/pidgin` and `$PREFIX/lib/finch` for UI-specific, respectively.
## Developing
There is a ton of information on developing Pidgin available at
[developer.pidgin.im](https://developer.pidgin.im).
To generate the documentation locally you can pass `-Ddoc=true` to `meson` or
`meson configure` which will build the `gtk-docs` for everything.