OSDN Git Service

gobex: Add basic MTU tracking variables
authorJohan Hedberg <johan.hedberg@intel.com>
Sun, 26 Jun 2011 20:17:20 +0000 (23:17 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 4 Dec 2012 21:21:56 +0000 (22:21 +0100)
gobex/gobex.c

index 3c70337..7c3b077 100644 (file)
 
 #include "gobex.h"
 
+#define G_OBEX_DEFAULT_MTU     4096
+#define G_OBEX_MINIMUM_MTU     255
+#define G_OBEX_MAXIMUM_MTU     65535
+
 /* Header types */
 #define G_OBEX_HDR_TYPE_UNICODE        (0 << 6)
 #define G_OBEX_HDR_TYPE_BYTES  (1 << 6)
@@ -65,6 +69,9 @@ struct _GObex {
        gint ref_count;
        GIOChannel *io;
 
+       guint16 rx_mtu;
+       guint16 tx_mtu;
+
        GQueue *req_queue;
 };
 
@@ -510,6 +517,8 @@ GObex *g_obex_new(GIOChannel *io)
 
        obex->io = io;
        obex->ref_count = 1;
+       obex->rx_mtu = G_OBEX_DEFAULT_MTU;
+       obex->tx_mtu = G_OBEX_MINIMUM_MTU;
        obex->req_queue = g_queue_new();
 
        return obex;