size_t tx_data;
size_t tx_sent;
+ gboolean suspended;
+
guint write_source;
gssize io_rx_mtu;
obex->tx_sent = 0;
}
+ if (obex->suspended) {
+ obex->write_source = 0;
+ return FALSE;
+ }
+
if (!obex->write(obex, NULL))
goto stop_tx;
{
GIOCondition cond;
+ if (obex->suspended)
+ return;
+
if (obex->write_source > 0)
return;
return TRUE;
}
+void g_obex_suspend(GObex *obex)
+{
+ if (obex->write_source > 0) {
+ g_source_remove(obex->write_source);
+ obex->write_source = 0;
+ }
+
+ obex->suspended = TRUE;
+}
+
+void g_obex_resume(GObex *obex)
+{
+ obex->suspended = FALSE;
+
+ if (g_queue_get_length(obex->tx_queue) > 0 || obex->tx_data > 0)
+ enable_tx(obex);
+}
+
static void parse_connect_data(GObex *obex, GObexPacket *pkt)
{
const struct connect_data *data;
GObexRequestFunc func,
gpointer user_data);
gboolean g_obex_remove_request_function(GObex *obex, gint id);
+
+void g_obex_suspend(GObex *obex);
+void g_obex_resume(GObex *obex);
+
GObex *g_obex_new(GIOChannel *io, GObexTransportType transport_type,
gssize rx_mtu, gssize tx_mtu);