Diff between 68bd9dd92b949aa22202edd69bc3a69c155cc9ce and 1c2da64348f85314e73494a0372cf26bb2cf821c

Changed Files

File Additions Deletions Status
gobex/gobex-packet.c +0 -14 modified
gobex/gobex-packet.h +0 -1 modified
gobex/gobex.c +3 -3 modified
tools/obex-server-tool.c +4 -4 modified

Full Patch

diff --git a/gobex/gobex-packet.c b/gobex/gobex-packet.c
index 5765c8b..e2914a4 100644
--- a/gobex/gobex-packet.c
+++ b/gobex/gobex-packet.c
@@ -79,20 +79,6 @@ guint8 g_obex_packet_get_operation(GObexPacket *pkt, gboolean *final)
 	return pkt->opcode;
 }
 
-GObexHeader *g_obex_packet_find_header(GObexPacket *pkt, guint8 id)
-{
-	GSList *l;
-
-	for (l = pkt->headers; l != NULL; l = g_slist_next(l)) {
-		GObexHeader *hdr = l->data;
-
-		if (g_obex_header_get_id(hdr) == id)
-			return hdr;
-	}
-
-	return NULL;
-}
-
 gboolean g_obex_packet_prepend_header(GObexPacket *pkt, GObexHeader *header)
 {
 	pkt->headers = g_slist_prepend(pkt->headers, header);
diff --git a/gobex/gobex-packet.h b/gobex/gobex-packet.h
index 6bdfcf0..24c9dcc 100644
--- a/gobex/gobex-packet.h
+++ b/gobex/gobex-packet.h
@@ -84,7 +84,6 @@ typedef struct _GObexPacket GObexPacket;
 GObexHeader *g_obex_packet_get_header(GObexPacket *pkt, guint8 id);
 GObexHeader *g_obex_packet_get_body(GObexPacket *pkt);
 guint8 g_obex_packet_get_operation(GObexPacket *pkt, gboolean *final);
-GObexHeader *g_obex_packet_find_header(GObexPacket *pkt, guint8 id);
 gboolean g_obex_packet_prepend_header(GObexPacket *pkt, GObexHeader *header);
 gboolean g_obex_packet_add_header(GObexPacket *pkt, GObexHeader *header);
 gboolean g_obex_packet_add_body(GObexPacket *pkt, GObexDataProducer func,
diff --git a/gobex/gobex.c b/gobex/gobex.c
index 5f9e9db..b2c0199 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -344,7 +344,7 @@ static void prepare_connect_rsp(GObex *obex, GObexPacket *rsp)
 	init_connect_data(obex, &data);
 	g_obex_packet_set_data(rsp, &data, sizeof(data), G_OBEX_DATA_COPY);
 
-	connid = g_obex_packet_find_header(rsp, G_OBEX_HDR_CONNECTION);
+	connid = g_obex_packet_get_header(rsp, G_OBEX_HDR_CONNECTION);
 	if (connid != NULL) {
 		g_obex_header_get_uint32(connid, &obex->conn_id);
 		return;
@@ -392,7 +392,7 @@ guint g_obex_send_req(GObex *obex, GObexPacket *req, gint timeout,
 	if (obex->conn_id == CONNID_INVALID)
 		goto create_pending;
 
-	connid = g_obex_packet_find_header(req, G_OBEX_HDR_CONNECTION);
+	connid = g_obex_packet_get_header(req, G_OBEX_HDR_CONNECTION);
 	if (connid != NULL)
 		goto create_pending;
 
@@ -611,7 +611,7 @@ static void parse_connect_data(GObex *obex, GObexPacket *pkt)
 		obex->tx_mtu = obex->io_tx_mtu;
 	obex->tx_buf = g_realloc(obex->tx_buf, obex->tx_mtu);
 
-	connid = g_obex_packet_find_header(pkt, G_OBEX_HDR_CONNECTION);
+	connid = g_obex_packet_get_header(pkt, G_OBEX_HDR_CONNECTION);
 	if (connid != NULL)
 		g_obex_header_get_uint32(connid, &obex->conn_id);
 }
diff --git a/tools/obex-server-tool.c b/tools/obex-server-tool.c
index 4b39ba8..7db153e 100644
--- a/tools/obex-server-tool.c
+++ b/tools/obex-server-tool.c
@@ -121,7 +121,7 @@ static void handle_put(GObex *obex, GObexPacket *req, gpointer user_data)
 	struct transfer_data *data;
 	gsize type_len;
 
-	hdr = g_obex_packet_find_header(req, G_OBEX_HDR_TYPE);
+	hdr = g_obex_packet_get_header(req, G_OBEX_HDR_TYPE);
 	if (hdr != NULL) {
 		g_obex_header_get_bytes(hdr, (const guint8 **) &type,
 								&type_len);
@@ -132,7 +132,7 @@ static void handle_put(GObex *obex, GObexPacket *req, gpointer user_data)
 	} else
 		type = NULL;
 
-	hdr = g_obex_packet_find_header(req, G_OBEX_HDR_NAME);
+	hdr = g_obex_packet_get_header(req, G_OBEX_HDR_NAME);
 	if (hdr != NULL)
 		g_obex_header_get_unicode(hdr, &name);
 	else
@@ -180,7 +180,7 @@ static void handle_get(GObex *obex, GObexPacket *req, gpointer user_data)
 	GObexHeader *hdr;
 	gsize type_len;
 
-	hdr = g_obex_packet_find_header(req, G_OBEX_HDR_TYPE);
+	hdr = g_obex_packet_get_header(req, G_OBEX_HDR_TYPE);
 	if (hdr != NULL) {
 		g_obex_header_get_bytes(hdr, (const guint8 **) &type,
 								&type_len);
@@ -191,7 +191,7 @@ static void handle_get(GObex *obex, GObexPacket *req, gpointer user_data)
 	} else
 		type = NULL;
 
-	hdr = g_obex_packet_find_header(req, G_OBEX_HDR_NAME);
+	hdr = g_obex_packet_get_header(req, G_OBEX_HDR_NAME);
 	if (hdr != NULL)
 		g_obex_header_get_unicode(hdr, &name);
 	else