diff --git a/gobex/gobex.c b/gobex/gobex.c
index 887e2a2..3848884 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
g_error_free(err);
pending_pkt_free(p);
+ p->timeout_id = 0;
+
return FALSE;
}
p->cancelled = TRUE;
- g_source_remove(p->timeout_id);
+ if (p->timeout_id > 0)
+ g_source_remove(p->timeout_id);
+
p->timeout = G_OBEX_ABORT_TIMEOUT;
p->timeout_id = g_timeout_add_seconds(p->timeout, req_timeout, obex);
struct pending_pkt *p = obex->pending_req;
GObexPacket *req;
- g_source_remove(p->timeout_id);
+ if (p->timeout_id > 0) {
+ g_source_remove(p->timeout_id);
+ p->timeout_id = 0;
+ }
+
p->suspended = TRUE;
req = g_obex_packet_new(G_OBEX_OP_GET, TRUE,
/* Remove it as pending and add it back to the queue so it gets sent
* again */
- g_source_remove(p->timeout_id);
- p->timeout_id = 0;
+ if (p->timeout_id > 0) {
+ g_source_remove(p->timeout_id);
+ p->timeout_id = 0;
+ }
obex->pending_req = NULL;
g_obex_send_internal(obex, p, NULL);
}
* continue sending responses until the transfer is finished
*/
if (opcode == G_OBEX_OP_GET && rspcode == G_OBEX_RSP_CONTINUE) {
- g_source_remove(p->timeout_id);
+ if (p->timeout_id > 0)
+ g_source_remove(p->timeout_id);
+
p->timeout_id = g_timeout_add_seconds(p->timeout, req_timeout,
obex);
return FALSE;