Commit Graph

92 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz
30b091c42e 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>
2012-12-04 22:22:03 +01:00
Luiz Augusto von Dentz
704d8b47a3 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.
2012-12-04 22:22:03 +01:00
Luiz Augusto von Dentz
bf8b55059e gobex: dump data when G_OBEX_DEBUG_DATA is set 2012-12-04 22:22:03 +01:00
Luiz Augusto von Dentz
6690cd3b76 gobex: log commands using G_OBEX_DEBUG_COMMAND 2012-12-04 22:22:03 +01:00
Luiz Augusto von Dentz
fffdbad4a8 gobex: log errors using G_OBEX_DEBUG_ERROR 2012-12-04 22:22:03 +01:00
Luiz Augusto von Dentz
54da6b6ad2 gobex: add initial support for debug
This adds support for debug using GOBEX_DEBUG environment variable.
2012-12-04 22:22:03 +01:00
Johan Hedberg
1c2da64348 gobex: Remove g_obex_packet_find_header
This was exactly the same as g_obex_packet_get_header.
2012-12-04 22:22:03 +01:00
Johan Hedberg
a2204214c2 gobex: Fix request timeout handling when aborting 2012-12-04 22:22:02 +01:00
Johan Hedberg
5b613d1174 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.
2012-12-04 22:22:02 +01:00
Johan Hedberg
91e0e1c324 gobex: Fix opcode for Action command convenience functions 2012-12-04 22:22:02 +01:00
Johan Hedberg
afc903b0f3 gobex: Add support for Action command header offset (0) 2012-12-04 22:22:02 +01:00
Johan Hedberg
e12802a76b gobex: Add Action command convenience functions 2012-12-04 22:22:02 +01:00
Luiz Augusto von Dentz
1e00bd8f5e gobex: fix not handling unkown transport type 2012-12-04 22:22:02 +01:00
Daniele Forsi
f64fe4f401 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’
2012-12-04 22:22:02 +01:00
Johan Hedberg
1513406f59 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]
2012-12-04 22:22:02 +01:00
Johan Hedberg
0528bfc1a0 gobex: Add support for returning -EAGAIN from producer callback 2012-12-04 22:22:02 +01:00
Johan Hedberg
b0341a13d5 gobex: Make use of g_obex_send_rsp where possible 2012-12-04 22:22:01 +01:00
Johan Hedberg
3352a36c11 gobex: Allow g_obex_send_rsp to take custom headers 2012-12-04 22:22:01 +01:00
Johan Hedberg
57e1082eb0 gobex: Use guint instead of gint for request callback id 2012-12-04 22:22:01 +01:00
Johan Hedberg
7ee5aede6e gobex: Minor coding style fixes 2012-12-04 22:22:01 +01:00
Johan Hedberg
d713e186e5 gobex: Add g_obex_send_rsp convenience function 2012-12-04 22:22:01 +01:00
Johan Hedberg
c869ca28b8 gobex: Make use of va-args headers in higher level functions 2012-12-04 22:22:01 +01:00
Johan Hedberg
58cd14d209 gobex: Remove _ID_ from header type definitions 2012-12-04 22:22:01 +01:00
Johan Hedberg
cdcde59687 gobex: Add va-args based packet creation support 2012-12-04 22:22:01 +01:00
Johan Hedberg
f5d10bf7cb gobex: Remove unneeded data_policy from g_obex_header_new_bytes 2012-12-04 22:22:01 +01:00
Johan Hedberg
7f5cb418d3 gobex: Ignore unexpected responses (which can occur when aborting) 2012-12-04 22:22:01 +01:00
Johan Hedberg
1760e5f5f5 gobex: Add g_obex_delete 2012-12-04 22:22:01 +01:00
Johan Hedberg
8554bc2a89 gobex: Add g_obex_mkdir 2012-12-04 22:22:01 +01:00
Johan Hedberg
1b609bec8e gobex: Add g_obex_setpath 2012-12-04 22:22:00 +01:00
Johan Hedberg
8d7a30ff3e gobex: Fix header offset lookup 2012-12-04 22:22:00 +01:00
Johan Hedberg
42d94c84a2 gobex: Add support for suspend & resume 2012-12-04 22:22:00 +01:00
Johan Hedberg
4fa31e1966 gobex: Fix typo 2012-12-04 22:21:59 +01:00
Johan Hedberg
7fee9ce693 gobex: Remove g_obex_set_request_function 2012-12-04 22:21:59 +01:00
Johan Hedberg
3f41b8b201 gobex: Add per-opcode request handlers 2012-12-04 22:21:59 +01:00
Johan Hedberg
49514b2cc4 gobex: Track last received request internally and remove g_obex_response 2012-12-04 22:21:59 +01:00
Johan Hedberg
ba377e0462 gobex: Don't stop sending data if a single packet fails to encode 2012-12-04 22:21:59 +01:00
Johan Hedberg
e6b2f2e4b7 gobex: Fix parsing over-sized packets 2012-12-04 22:21:59 +01:00
Johan Hedberg
67ad4a69a2 gobex: Rename GObexDisconnectFunc to simply GObexFunc 2012-12-04 22:21:59 +01:00
Johan Hedberg
2e49852cce gobex: Use opcode instead of entire req in g_obex_response 2012-12-04 22:21:59 +01:00
Johan Hedberg
0fb35029cf gobex: Add support for Connection ID header 2012-12-04 22:21:59 +01:00
Johan Hedberg
a470646232 gobex: Add convenience response sending function 2012-12-04 22:21:58 +01:00
Johan Hedberg
0794989ac8 gobex: Add convenience function for sending connect req 2012-12-04 22:21:58 +01:00
Johan Hedberg
11d5035505 gobex: Fix RX MTU setting 2012-12-04 22:21:58 +01:00
Johan Hedberg
9c3a8c372d gobex: Fix minor (whitespace) coding style issue 2012-12-04 22:21:58 +01:00
Johan Hedberg
7afc5a6f90 gobex: g_obex_new should create its own GIOChannel ref 2012-12-04 22:21:58 +01:00
Johan Hedberg
0a262129e4 gobex: Fix removing pending request timeout callback 2012-12-04 22:21:58 +01:00
Johan Hedberg
72dfb1af80 gobex: Remove superfluous return statement 2012-12-04 22:21:58 +01:00
Johan Hedberg
e94e8feec6 gobex: Add support for multi-response requests (SRM) 2012-12-04 22:21:58 +01:00
Johan Hedberg
57478308af gobex: Add (transport) MTU parameters to g_obex_new 2012-12-04 22:21:58 +01:00
Johan Hedberg
680e9abc4b gobex: Split ev_func into req_func and disconn_func 2012-12-04 22:21:58 +01:00