Thread (15 messages) flat view 15 messages, 2 authors, 2011-06-20
STALE5558d

[PATCH obexd 07/10] Reorder headers to conform to BIP's requirements

From: Jakub Adamek <hidden>
Date: 2011-06-19 00:59:43
Subsystem: the rest · Maintainer: Linus Torvalds

---
 gwobex/obex-priv.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/gwobex/obex-priv.c b/gwobex/obex-priv.c
index c986744..5d3b458 100644
--- a/gwobex/obex-priv.c
+++ b/gwobex/obex-priv.c
@@ -898,11 +898,6 @@ gboolean gw_obex_get_with_aheaders(GwObex *ctx,
         OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_CONNECTION, hv, 4, 0);
     }
 
-    if (apparam && apparam_size > 0) {
-        hv.bs = (unsigned char *)apparam;
-        OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_APPARAM, hv, apparam_size, 0);
-    }
-
     if (type) {
         hv.bs = (unsigned char *)type;
         OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_TYPE, hv, strlen(type) + 1, 0);
@@ -939,6 +934,11 @@ gboolean gw_obex_get_with_aheaders(GwObex *ctx,
         }
     }
 
+    if (apparam && apparam_size > 0) {
+        hv.bs = (unsigned char *)apparam;
+        OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_APPARAM, hv, apparam_size, 0);
+    }
+
     if (aheaders) {
         const GSList *hlist = aheaders;
         struct a_header *ah;
@@ -1073,6 +1073,11 @@ gboolean gw_obex_put_with_aheaders(GwObex *ctx,
         OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_CONNECTION, hv, 4, 0);
     }
 
+    if (type) {
+        hv.bs = (unsigned char *)type;
+        OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_TYPE, hv, strlen(type) + 1, 0);
+    }
+
     if (uname) {
         hv.bs = (unsigned char *)uname;
         OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_NAME, hv, uname_len, 0);
@@ -1080,11 +1085,6 @@ gboolean gw_obex_put_with_aheaders(GwObex *ctx,
         uname = NULL;
     }
 
-    if (type) {
-        hv.bs = (unsigned char *)type;
-        OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_TYPE, hv, strlen(type) + 1, 0);
-    }
-    
     if (apparam && apparam_size > 0) {
         hv.bs = (unsigned char *)apparam;
         OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_APPARAM, hv, apparam_size, 0);
-- 
1.7.0.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help