OSDN Git Service

android-x86/external-bluetooth-bluez.git
11 years agogobex: add unit test for GET request with APPARAM
Luiz Augusto von Dentz [Wed, 23 Nov 2011 13:42:08 +0000 (15:42 +0200)]
gobex: add unit test for GET request with APPARAM

11 years agogobex: add unit test for GET request with delay
Luiz Augusto von Dentz [Wed, 23 Nov 2011 13:42:07 +0000 (15:42 +0200)]
gobex: add unit test for GET request with delay

11 years agogobex: add unit test for PUT response with delay
Luiz Augusto von Dentz [Wed, 23 Nov 2011 13:42:06 +0000 (15:42 +0200)]
gobex: add unit test for PUT response with delay

11 years agogobex: fix removing wrong id on transfer_free
Luiz Augusto von Dentz [Mon, 21 Nov 2011 11:59:51 +0000 (13:59 +0200)]
gobex: fix removing wrong id on transfer_free

If statement checks for get_id handle but was removing req_id.

11 years agogobex: Add "cd ../dir" handling in setpath
Bartosz Szatkowski [Thu, 17 Nov 2011 13:45:30 +0000 (14:45 +0100)]
gobex: Add "cd ../dir" handling in setpath

11 years agogobex: make connection id check less strict
Luiz Augusto von Dentz [Fri, 11 Nov 2011 14:29:06 +0000 (16:29 +0200)]
gobex: make connection id check less strict

OBEX spec says:

  Only the first packet in the request needs to contain the Connection
  Id header...

  If a Connection Id header is received with an invalid connection
  identifier, it is recommended that the operation be rejected with the
  response code (0xD3) “Service Unavailable”.

Since not all requests packets need to contain Connection Id header we
should only try to validate it in case a header is received.

Reported by Hendrik Sattler <post@hendrik-sattler.de>

11 years agogobex: fix sending Connection ID header in all requests
Luiz Augusto von Dentz [Fri, 11 Nov 2011 14:29:05 +0000 (16:29 +0200)]
gobex: fix sending Connection ID header in all requests

According to both OBEX and GOEP specs Connection ID should only be
included in the first packet of a request.

11 years agogobex: fix not tracking received responses
Luiz Augusto von Dentz [Fri, 11 Nov 2011 14:29:04 +0000 (16:29 +0200)]
gobex: fix not tracking received responses

obex->rx_last_op is only updated if there is no pending request which
means it only store last received request.

11 years agogobex: fix checking connection id for ABORT
Luiz Augusto von Dentz [Fri, 11 Nov 2011 14:29:03 +0000 (16:29 +0200)]
gobex: fix checking connection id for ABORT

OBEX spec state that it is optional to send a Connection Id header in an
OBEX ABORT operation.

Reported by Hendrik Sattler <post@hendrik-sattler.de>

11 years agogobex: add unit test for CONNECT followed by PUT request with random data
Luiz Augusto von Dentz [Fri, 11 Nov 2011 14:29:02 +0000 (16:29 +0200)]
gobex: add unit test for CONNECT followed by PUT request with random data

Note that in order to work the buffer had to be increased to OBEX maximum
MTU otherwise test_io_cb would be sending responses for each fragment it
has read which may not constitute a full packet.

11 years agogobex: add unit test for CONNECT followed by GET wrong response
Luiz Augusto von Dentz [Fri, 11 Nov 2011 14:29:01 +0000 (16:29 +0200)]
gobex: add unit test for CONNECT followed by GET wrong response

11 years agogobex: add unit test for CONNECT followed by PUT response
Luiz Augusto von Dentz [Fri, 11 Nov 2011 14:29:00 +0000 (16:29 +0200)]
gobex: add unit test for CONNECT followed by PUT response

11 years agogobex: add unit test for CONNECT followed by PUT request
Luiz Augusto von Dentz [Fri, 11 Nov 2011 14:28:59 +0000 (16:28 +0200)]
gobex: add unit test for CONNECT followed by PUT request

11 years agogobex: add unit test for CONNECT followed by GET response
Luiz Augusto von Dentz [Fri, 11 Nov 2011 14:28:58 +0000 (16:28 +0200)]
gobex: add unit test for CONNECT followed by GET response

11 years agogobex: add unit test for CONNECT followed by GET request
Luiz Augusto von Dentz [Fri, 11 Nov 2011 14:28:57 +0000 (16:28 +0200)]
gobex: add unit test for CONNECT followed by GET request

11 years agogobex: add unit test for CONNECT response
Luiz Augusto von Dentz [Fri, 11 Nov 2011 14:28:56 +0000 (16:28 +0200)]
gobex: add unit test for CONNECT response

11 years agogobex: add unit test for CONNECT request
Luiz Augusto von Dentz [Fri, 11 Nov 2011 14:28:55 +0000 (16:28 +0200)]
gobex: add unit test for CONNECT request

11 years agogobex: add check for connection id
Luiz Augusto von Dentz [Mon, 7 Nov 2011 12:29:18 +0000 (14:29 +0200)]
gobex: add check for connection id

Since gobex maintain the connection id of the session it is more
convenient to check whether the incoming request connection matches
before calling the application handlers.

11 years agogobex: remove extra define of G_OBEX_RSP_SUCCESS
Luiz Augusto von Dentz [Mon, 7 Nov 2011 12:29:17 +0000 (14:29 +0200)]
gobex: remove extra define of G_OBEX_RSP_SUCCESS

11 years agogobex: dump data when G_OBEX_DEBUG_DATA is set
Luiz Augusto von Dentz [Fri, 21 Oct 2011 10:34:05 +0000 (13:34 +0300)]
gobex: dump data when G_OBEX_DEBUG_DATA is set

11 years agogobex: log packets using G_OBEX_DEBUG_PACKET
Luiz Augusto von Dentz [Fri, 21 Oct 2011 10:34:04 +0000 (13:34 +0300)]
gobex: log packets using G_OBEX_DEBUG_PACKET

11 years agogobex: log headers using G_OBEX_DEBUG_HEADER
Luiz Augusto von Dentz [Fri, 21 Oct 2011 10:34:03 +0000 (13:34 +0300)]
gobex: log headers using G_OBEX_DEBUG_HEADER

11 years agogobex: log transfers using G_OBEX_DEBUG_TRANSFER
Luiz Augusto von Dentz [Fri, 21 Oct 2011 10:34:02 +0000 (13:34 +0300)]
gobex: log transfers using G_OBEX_DEBUG_TRANSFER

11 years agogobex: log commands using G_OBEX_DEBUG_COMMAND
Luiz Augusto von Dentz [Fri, 21 Oct 2011 10:34:01 +0000 (13:34 +0300)]
gobex: log commands using G_OBEX_DEBUG_COMMAND

11 years agogobex: log errors using G_OBEX_DEBUG_ERROR
Luiz Augusto von Dentz [Fri, 21 Oct 2011 10:34:00 +0000 (13:34 +0300)]
gobex: log errors using G_OBEX_DEBUG_ERROR

11 years agogobex: add initial support for debug
Luiz Augusto von Dentz [Sat, 22 Oct 2011 10:29:30 +0000 (13:29 +0300)]
gobex: add initial support for debug

This adds support for debug using GOBEX_DEBUG environment variable.

11 years agogobex: fix includes of config.h
Luiz Augusto von Dentz [Thu, 20 Oct 2011 07:49:42 +0000 (10:49 +0300)]
gobex: fix includes of config.h

11 years agogobex: add missing checks for config.h
Luiz Augusto von Dentz [Tue, 18 Oct 2011 08:12:25 +0000 (11:12 +0300)]
gobex: add missing checks for config.h

11 years agogobex: Fix decoding byte array headers with too small length
Johan Hedberg [Thu, 6 Oct 2011 11:31:13 +0000 (14:31 +0300)]
gobex: Fix decoding byte array headers with too small length

Length values of less than 3 are invalid.

11 years agogobex: Remove g_obex_packet_find_header
Johan Hedberg [Mon, 5 Sep 2011 09:29:54 +0000 (12:29 +0300)]
gobex: Remove g_obex_packet_find_header

This was exactly the same as g_obex_packet_get_header.

11 years agogobex: add option to set input/output MTU to test-server
Luiz Augusto von Dentz [Thu, 1 Sep 2011 09:47:51 +0000 (12:47 +0300)]
gobex: add option to set input/output MTU to test-server

11 years agogobex: add option to set input/output MTU to test-client
Luiz Augusto von Dentz [Thu, 1 Sep 2011 09:47:50 +0000 (12:47 +0300)]
gobex: add option to set input/output MTU to test-client

11 years agogobex: Use larger timeout first packet in transfers
Johan Hedberg [Thu, 1 Sep 2011 07:47:08 +0000 (10:47 +0300)]
gobex: Use larger timeout first packet in transfers

Frequently upon receiving the first packet servers will perform some
sort of user interaction to authorize the incoming request. It's
therefore wise to use a larger timeout for this first packet on the
client side.

11 years agogobex: Fix request timeout handling when aborting
Johan Hedberg [Thu, 1 Sep 2011 07:41:50 +0000 (10:41 +0300)]
gobex: Fix request timeout handling when aborting

11 years agogobex: Protect against user callback freeing internal objects
Johan Hedberg [Wed, 31 Aug 2011 09:41:48 +0000 (12:41 +0300)]
gobex: Protect against user callback freeing internal objects

A user callback could potentially do things like g_obex_cancel_request
or g_obex_unref while we are inside the IO watch callback. It is
therefore important to ensure that we are in a consistent state when the
user callback returns.

11 years agogobex: Protect against transfer_complete callback removing the transfer
Johan Hedberg [Tue, 30 Aug 2011 15:13:19 +0000 (18:13 +0300)]
gobex: Protect against transfer_complete callback removing the transfer

11 years agogobex: Add unit tests for Action command functions
Johan Hedberg [Tue, 30 Aug 2011 09:57:50 +0000 (12:57 +0300)]
gobex: Add unit tests for Action command functions

11 years agogobex: Fix opcode for Action command convenience functions
Johan Hedberg [Tue, 30 Aug 2011 09:57:29 +0000 (12:57 +0300)]
gobex: Fix opcode for Action command convenience functions

11 years agogobex: Add support for Action command header offset (0)
Johan Hedberg [Tue, 30 Aug 2011 09:57:09 +0000 (12:57 +0300)]
gobex: Add support for Action command header offset (0)

11 years agogobex: Add client transfer functions taking a pre-created GObexPacket
Johan Hedberg [Tue, 30 Aug 2011 09:33:20 +0000 (12:33 +0300)]
gobex: Add client transfer functions taking a pre-created GObexPacket

11 years agogobex: Add OBEX packet header addition convenience functions
Johan Hedberg [Tue, 30 Aug 2011 09:32:00 +0000 (12:32 +0300)]
gobex: Add OBEX packet header addition convenience functions

11 years agogobex: Add Action command convenience functions
Johan Hedberg [Tue, 30 Aug 2011 09:30:39 +0000 (12:30 +0300)]
gobex: Add Action command convenience functions

11 years agogobex: add root support to test-server
Luiz Augusto von Dentz [Fri, 26 Aug 2011 09:49:36 +0000 (12:49 +0300)]
gobex: add root support to test-server

11 years agogobex: Add Bluetooth support for test-server
Luiz Augusto von Dentz [Fri, 26 Aug 2011 09:49:35 +0000 (12:49 +0300)]
gobex: Add Bluetooth support for test-server

11 years agogobex: Add Bluetooth support for test-client
Luiz Augusto von Dentz [Fri, 26 Aug 2011 09:49:34 +0000 (12:49 +0300)]
gobex: Add Bluetooth support for test-client

11 years agogobex: Add random put request test
Luiz Augusto von Dentz [Fri, 26 Aug 2011 09:49:33 +0000 (12:49 +0300)]
gobex: Add random put request test

11 years agogobex: fix setting final bit on PUT requests
Luiz Augusto von Dentz [Fri, 26 Aug 2011 09:49:32 +0000 (12:49 +0300)]
gobex: fix setting final bit on PUT requests

Final bit should not be set when creating new request packets for PUT
since it may be not be the end of the body.

11 years agogobex: fix not handling unkown transport type
Luiz Augusto von Dentz [Fri, 26 Aug 2011 09:49:31 +0000 (12:49 +0300)]
gobex: fix not handling unkown transport type

11 years agogobex: Fix encoding of empty unicode headers
Jakub Adamek [Sun, 14 Aug 2011 13:16:25 +0000 (15:16 +0200)]
gobex: Fix encoding of empty unicode headers

According to IrOBEX:
"An empty Name header is defined as a Name header of length 3 (one byte
opcode + two byte length)."

The current code encodes an empty header with 5 bytes, including two
bytes of null-terminator.

This patch assumes that this definition of emptiness applies to all
unicode headers, not just the name header.

11 years agogobex: Remove bogus extra semicolons
Syam Sidhardhan [Wed, 10 Aug 2011 18:43:28 +0000 (00:13 +0530)]
gobex: Remove bogus extra semicolons

11 years agogobex: Fix compilation when NEED_G_SLIST_FREE_FULL is defined
Daniele Forsi [Wed, 3 Aug 2011 22:20:38 +0000 (00:20 +0200)]
gobex: Fix compilation when NEED_G_SLIST_FREE_FULL is defined

To use the replacement for g_slist_free_full() both compat.h and
glib-helper.h need to be included.

Fixes:
gobex/gobex.c:911: error: implicit declaration of function 'g_slist_free_full'
tools/obex-server-tool.c:344: error: implicit declaration of function ‘g_slist_free_full’

11 years agogobex: Make use of g_slist_free_full when elements are dynamically-allocated
Luiz Augusto von Dentz [Tue, 2 Aug 2011 10:00:06 +0000 (13:00 +0300)]
gobex: Make use of g_slist_free_full when elements are dynamically-allocated

This avoid having to iterate twice in the list to free its elements.

11 years agogobex: Remove reduntant empty line
Johan Hedberg [Tue, 19 Jul 2011 21:18:15 +0000 (00:18 +0300)]
gobex: Remove reduntant empty line

11 years agogobex: Fix compilation error with GPOINTER_TO_UINT
Johan Hedberg [Mon, 18 Jul 2011 10:35:16 +0000 (13:35 +0300)]
gobex: Fix compilation error with GPOINTER_TO_UINT

Fixes the following issue seen on debian unstable:

gobex/gobex.c: In function 'handle_request':
gobex/gobex.c:646:50: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

11 years agogobex: Add support for returning -EAGAIN from producer callback
Johan Hedberg [Tue, 12 Jul 2011 08:52:05 +0000 (11:52 +0300)]
gobex: Add support for returning -EAGAIN from producer callback

11 years agogobex: Premit raw OBEX error codes within G_OBEX_ERROR GError domain
Johan Hedberg [Mon, 11 Jul 2011 22:51:37 +0000 (01:51 +0300)]
gobex: Premit raw OBEX error codes within G_OBEX_ERROR GError domain

11 years agogobex: Refactor get response parsing in transfer code
Johan Hedberg [Mon, 11 Jul 2011 22:45:16 +0000 (01:45 +0300)]
gobex: Refactor get response parsing in transfer code

11 years agogobex: Fix put request handling with final bit value
Johan Hedberg [Mon, 11 Jul 2011 21:38:18 +0000 (00:38 +0300)]
gobex: Fix put request handling with final bit value

11 years agogobex: Add g_obex_packet_get_body convenience function
Johan Hedberg [Mon, 11 Jul 2011 21:37:25 +0000 (00:37 +0300)]
gobex: Add g_obex_packet_get_body convenience function

11 years agogobex: Make use of g_obex_send_rsp where possible
Johan Hedberg [Mon, 11 Jul 2011 20:45:49 +0000 (23:45 +0300)]
gobex: Make use of g_obex_send_rsp where possible

11 years agogobex: Allow g_obex_send_rsp to take custom headers
Johan Hedberg [Mon, 11 Jul 2011 19:28:47 +0000 (22:28 +0300)]
gobex: Allow g_obex_send_rsp to take custom headers

11 years agogobex: Merge gobex-transfer.h into gobex.h
Johan Hedberg [Mon, 11 Jul 2011 14:17:48 +0000 (17:17 +0300)]
gobex: Merge gobex-transfer.h into gobex.h

11 years agogobex: Use guint instead of gint for request callback id
Johan Hedberg [Mon, 11 Jul 2011 07:47:34 +0000 (10:47 +0300)]
gobex: Use guint instead of gint for request callback id

11 years agogobex: Fix missing newline in test-server error log
Johan Hedberg [Sun, 10 Jul 2011 22:15:26 +0000 (01:15 +0300)]
gobex: Fix missing newline in test-server error log

11 years agogobex: Minor coding style fixes
Johan Hedberg [Sun, 10 Jul 2011 22:13:46 +0000 (01:13 +0300)]
gobex: Minor coding style fixes

11 years agogobex: Add g_obex_send_rsp convenience function
Johan Hedberg [Sun, 10 Jul 2011 22:07:33 +0000 (01:07 +0300)]
gobex: Add g_obex_send_rsp convenience function

11 years agogobex: Fix test-server/client file creation mode
Johan Hedberg [Sun, 10 Jul 2011 21:52:33 +0000 (00:52 +0300)]
gobex: Fix test-server/client file creation mode

11 years agogobex: Add Get support to test-client and test-server
Johan Hedberg [Sun, 10 Jul 2011 21:50:15 +0000 (00:50 +0300)]
gobex: Add Get support to test-client and test-server

11 years agogobex: Make use of va-args headers in higher level functions
Johan Hedberg [Sun, 10 Jul 2011 20:09:02 +0000 (23:09 +0300)]
gobex: Make use of va-args headers in higher level functions

11 years agogobex: Fix minor memory leak in unit test
Johan Hedberg [Sun, 10 Jul 2011 20:08:35 +0000 (23:08 +0300)]
gobex: Fix minor memory leak in unit test

11 years agogobex: Make transfer functions take va-args header lists
Johan Hedberg [Sun, 10 Jul 2011 19:33:16 +0000 (22:33 +0300)]
gobex: Make transfer functions take va-args header lists

11 years agogobex: Remove _ID_ from header type definitions
Johan Hedberg [Sun, 10 Jul 2011 18:47:49 +0000 (21:47 +0300)]
gobex: Remove _ID_ from header type definitions

11 years agogobex: Add va-args based packet creation support
Johan Hedberg [Sun, 10 Jul 2011 18:36:47 +0000 (21:36 +0300)]
gobex: Add va-args based packet creation support

11 years agogobex: Make buffer parameter const for g_obex_header_new_bytes
Johan Hedberg [Sun, 10 Jul 2011 17:59:12 +0000 (20:59 +0300)]
gobex: Make buffer parameter const for g_obex_header_new_bytes

11 years agogobex: Remove unneeded data_policy from g_obex_header_new_bytes
Johan Hedberg [Sun, 10 Jul 2011 10:57:55 +0000 (13:57 +0300)]
gobex: Remove unneeded data_policy from g_obex_header_new_bytes

11 years agogobex: Allow calling g_obex_get_rsp later with custom headers
Johan Hedberg [Sun, 10 Jul 2011 09:47:50 +0000 (12:47 +0300)]
gobex: Allow calling g_obex_get_rsp later with custom headers

11 years agogobex: Ignore unexpected responses (which can occur when aborting)
Johan Hedberg [Sat, 9 Jul 2011 13:26:46 +0000 (16:26 +0300)]
gobex: Ignore unexpected responses (which can occur when aborting)

11 years agogobex: Add g_obex_delete
Johan Hedberg [Sat, 9 Jul 2011 11:36:05 +0000 (13:36 +0200)]
gobex: Add g_obex_delete

11 years agogobex: Add g_obex_mkdir
Johan Hedberg [Sat, 9 Jul 2011 11:29:22 +0000 (13:29 +0200)]
gobex: Add g_obex_mkdir

11 years agogobex: Add unit test for SetPath("..")
Johan Hedberg [Sat, 9 Jul 2011 11:26:01 +0000 (13:26 +0200)]
gobex: Add unit test for SetPath("..")

11 years agogobex: Use proper response code in connect response
Johan Hedberg [Sat, 9 Jul 2011 11:23:39 +0000 (13:23 +0200)]
gobex: Use proper response code in connect response

11 years agogobex: Add g_obex_setpath
Johan Hedberg [Sat, 9 Jul 2011 11:22:19 +0000 (13:22 +0200)]
gobex: Add g_obex_setpath

11 years agogobex: Fix header offset lookup
Johan Hedberg [Sat, 9 Jul 2011 11:14:46 +0000 (13:14 +0200)]
gobex: Fix header offset lookup

11 years agogobex: Add unit test for g_obex_connect
Johan Hedberg [Sat, 9 Jul 2011 10:53:09 +0000 (12:53 +0200)]
gobex: Add unit test for g_obex_connect

11 years agogobex: Refactor common unit test functions to util.c
Johan Hedberg [Sat, 9 Jul 2011 09:06:31 +0000 (11:06 +0200)]
gobex: Refactor common unit test functions to util.c

11 years agogobex: Add g_obex_cancel_transfer
Johan Hedberg [Fri, 8 Jul 2011 10:32:20 +0000 (12:32 +0200)]
gobex: Add g_obex_cancel_transfer

11 years agogobex: Add unit tests for g_obex_suspend & g_obex_resume
Johan Hedberg [Fri, 8 Jul 2011 10:01:29 +0000 (12:01 +0200)]
gobex: Add unit tests for g_obex_suspend & g_obex_resume

11 years agogobex: Fix g_obex_get_rsp end of transfer handling
Johan Hedberg [Fri, 8 Jul 2011 09:48:59 +0000 (11:48 +0200)]
gobex: Fix g_obex_get_rsp end of transfer handling

11 years agogobex: Assert correct io_cb count in transfer unit tests
Johan Hedberg [Fri, 8 Jul 2011 09:48:32 +0000 (11:48 +0200)]
gobex: Assert correct io_cb count in transfer unit tests

11 years agogobex: Add support for suspend & resume
Johan Hedberg [Thu, 7 Jul 2011 11:33:42 +0000 (13:33 +0200)]
gobex: Add support for suspend & resume

11 years agogobex: Refactor transfer unit test IO callbacks
Johan Hedberg [Wed, 6 Jul 2011 16:42:00 +0000 (18:42 +0200)]
gobex: Refactor transfer unit test IO callbacks

11 years agogobex: Add g_obex_get_rsp
Johan Hedberg [Wed, 6 Jul 2011 15:30:38 +0000 (17:30 +0200)]
gobex: Add g_obex_get_rsp

11 years agogobex: Add g_obex_get_req
Johan Hedberg [Wed, 6 Jul 2011 15:05:19 +0000 (17:05 +0200)]
gobex: Add g_obex_get_req

11 years agogobex: Extend g_obex_put_rsp unit test to have two rounds of requests
Johan Hedberg [Wed, 6 Jul 2011 14:23:50 +0000 (17:23 +0300)]
gobex: Extend g_obex_put_rsp unit test to have two rounds of requests

11 years agogobex: Don't call consumer callback if there is no data
Johan Hedberg [Wed, 6 Jul 2011 14:21:52 +0000 (17:21 +0300)]
gobex: Don't call consumer callback if there is no data

11 years agogobex: Add unit test for g_obex_put_rsp
Johan Hedberg [Wed, 6 Jul 2011 12:42:08 +0000 (15:42 +0300)]
gobex: Add unit test for g_obex_put_rsp

11 years agogobex: Use zero timeout to make timeout unit tests run faster
Johan Hedberg [Wed, 6 Jul 2011 09:06:50 +0000 (12:06 +0300)]
gobex: Use zero timeout to make timeout unit tests run faster

11 years agogobex: Add unit test for put transfer API
Johan Hedberg [Wed, 6 Jul 2011 08:05:02 +0000 (11:05 +0300)]
gobex: Add unit test for put transfer API

11 years agogobex: Move more unit test helpers to util.c
Johan Hedberg [Wed, 6 Jul 2011 07:59:01 +0000 (10:59 +0300)]
gobex: Move more unit test helpers to util.c

11 years agogobex: Add unit test for unexpected data
Johan Hedberg [Tue, 5 Jul 2011 23:11:18 +0000 (02:11 +0300)]
gobex: Add unit test for unexpected data