Why is there a tracker, then?

Anyway, I've attached the patch to this email.

Regards,

  Martin


Am Dienstag, den 07.02.2006, 12:32 +0100 schrieb Marcel Holtmann:
> Hi Martin,
> 
> > I have replaced the file in
> > http://sourceforge.net/tracker/index.php?func=detail&aid=1424504&group_id=8960&atid=308960
> > with the patch in unified format.
> 
> send any patches to the mailing list, because I am not reading the
> tracker.
> 
> Regards
> 
> Marcel
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> Openobex-users mailing list
> [email protected]
> http://lists.sourceforge.net/lists/listinfo/openobex-users
Index: include/obex_const.h
===================================================================
RCS file: /cvsroot/openobex/openobex/include/obex_const.h,v
retrieving revision 1.25
diff -u -3 -r1.25 obex_const.h
--- include/obex_const.h	3 Jan 2006 23:06:58 -0000	1.25
+++ include/obex_const.h	5 Feb 2006 14:11:10 -0000
@@ -101,6 +101,7 @@
 #define OBEX_FL_STREAM_START	0x02	/* Start of streaming body */
 #define OBEX_FL_STREAM_DATA	0x04	/* Body-stream data */
 #define OBEX_FL_STREAM_DATAEND	0x08	/* Body stream last data */
+#define OBEX_FL_SUSPEND 0x10 /* Suspend after sending this header */
 
 /* Transports */
 #define OBEX_TRANS_IRDA		1
@@ -129,6 +130,9 @@
 #define OBEX_HDR_OBJCLASS	0x4f /* OBEX Object class of object */
 #define OBEX_HDR_CONNECTION	0xcb /* Connection identifier */
 
+/* Support for buggy OBEX servers */
+#define OBEX_HDR_EMPTY    0x00 /* Empty header */
+
 /* Commands */
 #define OBEX_CMD_CONNECT	0x00
 #define OBEX_CMD_DISCONNECT	0x01
Index: lib/ChangeLog
===================================================================
RCS file: /cvsroot/openobex/openobex/lib/ChangeLog,v
retrieving revision 1.50
diff -u -3 -r1.50 ChangeLog
--- lib/ChangeLog	19 Dec 2005 11:58:24 -0000	1.50
+++ lib/ChangeLog	5 Feb 2006 14:11:10 -0000
@@ -1,3 +1,11 @@
+2006-02-05  Martin Schulze  <[EMAIL PROTECTED]>
+
+	* Add new header type OBEX_HDR_EMPTY. Causes an empty
+	  OBEX packet to be sent when in suspeded mode. This is
+	  needed by some buggy OBEX servers (e.g. Teleca).
+	* Add flags field in obex_header_element and new flag
+	  OBEX_FL_SUSPEND for better control of transfers.
+
 2005-12-18  Alex Kanavin       <[EMAIL PROTECTED]>
 
 	* Support for USB transport layer and USB interface discovery
Index: lib/obex_object.c
===================================================================
RCS file: /cvsroot/openobex/openobex/lib/obex_object.c,v
retrieving revision 1.23
diff -u -3 -r1.23 obex_object.c
--- lib/obex_object.c	3 Jan 2006 18:36:15 -0000	1.23
+++ lib/obex_object.c	5 Feb 2006 14:11:10 -0000
@@ -189,6 +189,7 @@
 	memset(element, 0, sizeof(struct obex_header_element));
 
 	element->hi = hi;
+	element->flags = flags;
 	
 	/* Is this a stream? */
 	if(flags & OBEX_FL_STREAM_START)	{
@@ -198,6 +199,11 @@
 		return 1;
 	}
 	
+	if(hi == OBEX_HDR_EMPTY) {
+		DEBUG(2, "Empty header\n");
+		object->tx_headerq = slist_append(object->tx_headerq, element);
+		return 1;
+	}
 
 	switch (hi & OBEX_HI_MASK) {
 	case OBEX_INT:
@@ -426,6 +432,7 @@
 	int actual, finished = 0;
 	uint16_t tx_left;
 	int addmore = TRUE;
+	int free_h;
 	int real_opcode;
 
 	DEBUG(4, "\n");
@@ -468,6 +475,7 @@
 	while(addmore == TRUE && object->tx_headerq != NULL) {
 		
 		h = object->tx_headerq->data;
+		free_h = FALSE;
 
 		if(h->stream) {
 			/* This is a streaming body */
@@ -482,6 +490,10 @@
 			/* The body may be fragmented over several packets. */
 			tx_left -= send_body(object, h, txmsg, tx_left);
 		}
+		else if(h->hi == OBEX_HDR_EMPTY) {
+			object->tx_headerq = slist_remove(object->tx_headerq, h);
+			free_h = TRUE;
+		}
 		else if(h->length <= tx_left) {
 			/* There is room for more data in tx msg */
 			DEBUG(4, "Adding non-body header\n");
@@ -491,7 +503,7 @@
 			/* Remove from tx-queue */
 			object->tx_headerq = slist_remove(object->tx_headerq, h);
 			g_netbuf_free(h->buf);
-			free(h);
+			free_h = TRUE;
 		}
 		else if(h->length > self->mtu_tx) {
 			/* Header is bigger than MTU. This should not happen,
@@ -505,6 +517,13 @@
 			/* This header won't fit. */
 			addmore = FALSE;
 		}
+
+		if(h->flags & OBEX_FL_SUSPEND) {
+			object->suspend = 1;
+			addmore = FALSE;
+		}
+		if(free_h)
+			free(h);
 		
 		if(tx_left == 0)
 			addmore = FALSE;
Index: lib/obex_object.h
===================================================================
RCS file: /cvsroot/openobex/openobex/lib/obex_object.h,v
retrieving revision 1.12
diff -u -3 -r1.12 obex_object.h
--- lib/obex_object.h	2 Dec 2005 18:53:24 -0000	1.12
+++ lib/obex_object.h	5 Feb 2006 14:11:10 -0000
@@ -45,6 +45,7 @@
 	unsigned int offset;
 	int body_touched;
 	int stream;
+	unsigned int flags;
 };
 
 typedef struct {

Reply via email to