Steven Walter - 2010-01-22
From 916a78295d557c5bcdad1fdbb1dab13435ae58d0 Mon Sep 17 00:00:00 2001
From: Steven Walter <stevenrwalter@gmail.com>
Date: Fri, 22 Jan 2010 18:38:03 -0500
Subject: [PATCH] obex_object_send: reduce totallen when dequeueing headers
Ran into this bug with a server that requires all GET commands to have a
Connection-Id header.  Handled this by calling OBEX_ObjectAddHeader in
the OBEX_EV_PROGRESS handler, but this would eventually fail with
"Header too big" thanks to the incorrect accounting of totallen.
---
 lib/obex_object.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/obex_object.c b/lib/obex_object.c
index 60b14bf..d389da5 100644
--- a/lib/obex_object.c
+++ b/lib/obex_object.c
@@ -500,6 +500,7 @@ int obex_object_send(obex_t *self, obex_object_t *object,

            /* Remove from tx-queue */
            object->tx_headerq = slist_remove(object->tx_headerq, h);
+           object->totallen -= h->length;
            buf_free(h->buf);
            free(h);
        } else if (h->length > self->mtu_tx) {
-- 
1.6.3.3