openobex:vudentz-clone.git
6 years agoFix build errors on obex_test tool when using gcc 4.6
Luiz Augusto von Dentz [Wed, 25 May 2011 07:57:30 +0000 (10:57 +0300)]
Fix build errors on obex_test tool when using gcc 4.6

obex_test_client.c: In function ‘push_client’:
obex_test_client.c:229:6: error: variable ‘num’ set but not used
obex_test_client.c: In function ‘put_client’:
obex_test_client.c:290:6: error: variable ‘num’ set but not used
obex_test_client.c: In function ‘get_client’:
obex_test_client.c:347:6: error: variable ‘num’ set but not used
obex_test_client.c: In function ‘setpath_client’:
obex_test_client.c:418:6: error: variable ‘num’ set but not used
cc1: all warnings being treated as errors

6 years agoFix Windows build broken by commit b807401578a6
Hendrik Sattler [Tue, 22 Feb 2011 18:51:24 +0000 (19:51 +0100)]
Fix Windows build broken by commit b807401578a6

6 years agoFix miscellaneous coding style issues
Johan Hedberg [Mon, 21 Feb 2011 21:08:26 +0000 (18:08 -0300)]
Fix miscellaneous coding style issues

6 years agoAdd verbose flag and use it to print more information about usb device
Hendrik Sattler [Sat, 19 Feb 2011 12:12:45 +0000 (13:12 +0100)]
Add verbose flag and use it to print more information about usb device

6 years agoFix usb transport
Hendrik Sattler [Fri, 18 Feb 2011 19:39:52 +0000 (20:39 +0100)]
Fix usb transport

I couldn't test the usb based transport for quite some time due to missing
hardware. A combination of previous broke the usb transport. This patch fixes
this breakage and also simplifies a bit.

6 years agoFix compilation for Microsoft Visual C++ compiler version 10
Hendrik Sattler [Sun, 30 Jan 2011 19:41:30 +0000 (20:41 +0100)]
Fix compilation for Microsoft Visual C++ compiler version 10

6 years agoMerge all transport-specific data into one union
Hendrik Sattler [Sat, 19 Feb 2011 11:45:05 +0000 (12:45 +0100)]
Merge all transport-specific data into one union

This lowers the memory consumption for every transport type and avoids a
seperate malloc() call for custom transports.

6 years agoFix wrong installation rule instroduced in 81d918714d75184c...
Hendrik Sattler [Fri, 18 Feb 2011 19:42:17 +0000 (20:42 +0100)]
Fix wrong installation rule instroduced in 81d918714d75184c...

Problem was wrong syntax in the CMake code.

6 years agoReorganize some line in acinline.m4 and fix openobex.pc file
Hendrik Sattler [Thu, 20 Jan 2011 20:55:06 +0000 (21:55 +0100)]
Reorganize some line in acinline.m4 and fix openobex.pc file

6 years agoBuild manpages with autotools using xmlto
Hendrik Sattler [Fri, 7 Jan 2011 15:05:06 +0000 (16:05 +0100)]
Build manpages with autotools using xmlto

6 years agoFix Doxygen output for autotools build when srcdir!=buildir
Hendrik Sattler [Fri, 7 Jan 2011 14:46:10 +0000 (15:46 +0100)]
Fix Doxygen output for autotools build when srcdir!=buildir

6 years agoAdd udev helper to allow access to USB devices for non-root users
Hendrik Sattler [Sat, 1 Jan 2011 20:54:59 +0000 (21:54 +0100)]
Add udev helper to allow access to USB devices for non-root users

6 years agoAllow bootstrap-configure to take extra parameters
Johan Hedberg [Tue, 18 Jan 2011 11:32:03 +0000 (11:32 +0000)]
Allow bootstrap-configure to take extra parameters

6 years agoFix OBEX_ResponseToString documentation
Iain Hibbert [Tue, 26 Oct 2010 13:10:41 +0000 (14:10 +0100)]
Fix OBEX_ResponseToString documentation

OBEX_ResponseToString() documentation says that it returns a static
string or NULL on error. This is not quite correct as the code does
never return NULL, and moreover it will be easier to use if that is
part of the API. Make it so.

6 years agoFix non-header data parsing
Hendrik Sattler [Tue, 21 Dec 2010 05:38:13 +0000 (06:38 +0100)]
Fix non-header data parsing

6 years agoCentralize memory allocation for data reading
Hendrik Sattler [Sun, 19 Dec 2010 14:56:52 +0000 (15:56 +0100)]
Centralize memory allocation for data reading

6 years agoFix return codes for libusb-0.1 transport
Hendrik Sattler [Thu, 16 Dec 2010 21:54:11 +0000 (22:54 +0100)]
Fix return codes for libusb-0.1 transport

6 years agoMake sure that all TX data gets transferred
Hendrik Sattler [Fri, 10 Dec 2010 21:25:36 +0000 (22:25 +0100)]
Make sure that all TX data gets transferred

6 years agoFix definitions in pkg-config file
Hendrik Sattler [Wed, 8 Dec 2010 18:27:16 +0000 (19:27 +0100)]
Fix definitions in pkg-config file

6 years agoAdd support for OBEX_DEBUG and OBEX_DUMP enviroment variables
Luiz Augusto von Dentz [Fri, 10 Dec 2010 11:25:53 +0000 (13:25 +0200)]
Add support for OBEX_DEBUG and OBEX_DUMP enviroment variables

6 years agoFix not resetting state to idle when canceling a request on server mode
Luiz Augusto von Dentz [Thu, 9 Dec 2010 10:06:02 +0000 (12:06 +0200)]
Fix not resetting state to idle when canceling a request on server mode

Also deliver ABORT signal so the user application can free whatever
resource being use to handle the request.

6 years agoFix miscelaneous coding style issues
Johan Hedberg [Wed, 8 Dec 2010 09:43:24 +0000 (11:43 +0200)]
Fix miscelaneous coding style issues

6 years agoUse fast path for rejected packets
Hendrik Sattler [Sun, 5 Dec 2010 11:06:00 +0000 (12:06 +0100)]
Use fast path for rejected packets

6 years agoAdd support for SRM flags
Hendrik Sattler [Thu, 2 Dec 2010 21:12:29 +0000 (22:12 +0100)]
Add support for SRM flags

This includes the ability for the application to insert additional headers in
between BODY headers. However, the application itself must then make sure that
it is appending an empty BODY header/stream, so that a proper END-OF-BODY
header can be generated.

6 years agoAdd SRM header ID definitions
Hendrik Sattler [Thu, 2 Dec 2010 21:11:04 +0000 (22:11 +0100)]
Add SRM header ID definitions

6 years agoMake obex_object_send() easier to understand
Hendrik Sattler [Sun, 21 Nov 2010 13:06:27 +0000 (14:06 +0100)]
Make obex_object_send() easier to understand

6 years agoReformat debug dump output
Hendrik Sattler [Sun, 21 Nov 2010 10:09:34 +0000 (11:09 +0100)]
Reformat debug dump output

6 years agoAdd support for single response mode
Hendrik Sattler [Mon, 15 Nov 2010 20:32:30 +0000 (21:32 +0100)]
Add support for single response mode

6 years agoAllow custom transport to insert whole packets on read()
Hendrik Sattler [Mon, 15 Nov 2010 20:29:24 +0000 (21:29 +0100)]
Allow custom transport to insert whole packets on read()

6 years agoReturn correct return value for USB-1.x write timeout
Hendrik Sattler [Mon, 15 Nov 2010 20:24:47 +0000 (21:24 +0100)]
Return correct return value for USB-1.x write timeout

6 years agoHandle multiple messages in RX message queue
Hendrik Sattler [Wed, 10 Nov 2010 17:09:34 +0000 (18:09 +0100)]
Handle multiple messages in RX message queue

The self->rx_msg buffer may contain more that one message. These changes allow
to handle this.

6 years agoRemove STATE_START
Hendrik Sattler [Wed, 10 Nov 2010 17:04:01 +0000 (18:04 +0100)]
Remove STATE_START

STATE_START was MODE_CLI specific and is actually conditional part of
STATE_SEND. This patch merges both states.

7 years agoStrip second argument of obex_object_setcmd()
Hendrik Sattler [Sat, 23 Oct 2010 12:36:09 +0000 (14:36 +0200)]
Strip second argument of obex_object_setcmd()

This also changes the return code from contant 1 (and checked nowhere) to void.

7 years agoAPI documentation updates
Hendrik Sattler [Tue, 19 Oct 2010 19:30:57 +0000 (21:30 +0200)]
API documentation updates

7 years agoMake argument of buf_total_size() const
Hendrik Sattler [Tue, 19 Oct 2010 19:30:08 +0000 (21:30 +0200)]
Make argument of buf_total_size() const

7 years agoFix OBEX_CancelRequest for server mode
Luiz Augusto von Dentz [Thu, 14 Oct 2010 07:25:25 +0000 (10:25 +0300)]
Fix OBEX_CancelRequest for server mode

Make use of last response set if nice is TRUE, so that applications can
set a proper error when canceling a suspended requests.

7 years agoFix use of state as mode
Luiz Augusto von Dentz [Mon, 11 Oct 2010 07:58:52 +0000 (10:58 +0300)]
Fix use of state as mode

Old code use to have just state member but now it is separated into state
and mode.

7 years agoAdd option for hint filtering to obex_find
Hendrik Sattler [Mon, 30 Aug 2010 21:10:31 +0000 (23:10 +0200)]
Add option for hint filtering to obex_find

7 years agoDo no send REQHINT event for ABORT command.
Hendrik Sattler [Tue, 28 Sep 2010 16:48:53 +0000 (18:48 +0200)]
Do no send REQHINT event for ABORT command.

Currently the server application gets a REQHINT for the ABORT command but none
of the other events because it gets automatically converted to an ABORT event
instead. So sending the REQHINT is not necessary and may actually confuse the
application (no matching REQDONE).

7 years agoFix bug in custom transport
Hendrik Sattler [Tue, 28 Sep 2010 16:46:36 +0000 (18:46 +0200)]
Fix bug in custom transport

A bug in custom transport prevents its usage. One other bug makes it crash, fix
both and also the left-over memcpy-instead-of-struct-assignment.

7 years agoFix miscelaneous coding style issues
Johan Hedberg [Thu, 26 Aug 2010 21:03:01 +0000 (00:03 +0300)]
Fix miscelaneous coding style issues

Too long lines, unnecessary type casts, whitespace issues, etc.

7 years agoMSVC build fix, and bug fix for 32-bit systems
Hendrik Sattler [Thu, 19 Aug 2010 14:56:30 +0000 (16:56 +0200)]
MSVC build fix, and bug fix for 32-bit systems

7 years agoCheck that SetCustomData is only used with OBEX_TRANS_CUSTOM
Hendrik Sattler [Sun, 22 Aug 2010 14:47:05 +0000 (16:47 +0200)]
Check that SetCustomData is only used with OBEX_TRANS_CUSTOM

7 years agoFix autoconf build warnings
Luiz Augusto von Dentz [Fri, 13 Aug 2010 10:53:30 +0000 (13:53 +0300)]
Fix autoconf build warnings

Variables must contain _cv_ to be cached

7 years agoEnable AM_SILENT_RULES if supported
Luiz Augusto von Dentz [Fri, 13 Aug 2010 08:39:54 +0000 (11:39 +0300)]
Enable AM_SILENT_RULES if supported

7 years agoFix not resuming server requests properly
Luiz Augusto von Dentz [Thu, 12 Aug 2010 08:33:21 +0000 (11:33 +0300)]
Fix not resuming server requests properly

In the server case the final bit of the opcode must always be set, but
when receiving if the final bit is not set it should not allow last
command to not trigger REQDONE when there is still more data coming.

7 years agoFix not ignoring aborted objects when resuming
Luiz Augusto von Dentz [Mon, 5 Jul 2010 11:16:50 +0000 (14:16 +0300)]
Fix not ignoring aborted objects when resuming

Requests that have been aborted should be ignored and not be sent, similar
to what happen when receiving.

7 years agoFix final bit not being set on a resumed request
Vinicius Costa Gomes [Wed, 11 Aug 2010 18:11:12 +0000 (14:11 -0400)]
Fix final bit not being set on a resumed request

In the server case the final bit of the opcode must always be set. When
resuming a request that would take more than one packet, it was not set.

7 years agoFix build with autotools
Hendrik Sattler [Thu, 22 Jul 2010 19:11:09 +0000 (21:11 +0200)]
Fix build with autotools

7 years agoUpdate documentation cover page and add more documentation for data types
Hendrik Sattler [Tue, 22 Jun 2010 20:26:41 +0000 (22:26 +0200)]
Update documentation cover page and add more documentation for data types

7 years agoProcess body headers after REQCHECK
Hendrik Sattler [Tue, 20 Jul 2010 17:35:50 +0000 (19:35 +0200)]
Process body headers after REQCHECK

If the application choses stream mode, it can never receive REQCHECK events.
Splitting the processing times of body and non-body headers makes this possible
and allows even the usage of stream mode after inspecting the other headers.
To allow this, obex_object_receive() has one additional parameter that has one
bit for each possible header id (OBEX_HDR_ID_*).

7 years agoSplit obex_object_receive()
Hendrik Sattler [Fri, 16 Jul 2010 21:32:42 +0000 (23:32 +0200)]
Split obex_object_receive()

The object receive function was reworked to make some other changes possible.
The path of the data is not more clear.

7 years agoMake data pointer of buf_insert_*() const
Hendrik Sattler [Sun, 9 May 2010 08:15:11 +0000 (10:15 +0200)]
Make data pointer of buf_insert_*() const

7 years agoAdd an application for finding connectable devices.
Hendrik Sattler [Fri, 16 Jul 2010 21:23:21 +0000 (23:23 +0200)]
Add an application for finding connectable devices.

Since transports can be used to get a list of devices to connect to, this
example application makes that information available from the command line.

7 years agoCode cleanup
Hendrik Sattler [Fri, 16 Jul 2010 21:14:25 +0000 (23:14 +0200)]
Code cleanup

Some issues cleaned up with this patch:
 - safer use of sizeof() by using variables instead of repeating the variable
   type
 - remove magic values (size of headers)
 - remove unused local variables that were not detected by the compiler
 - remove unused struct member

7 years agoMake send/write routines honour the user-selected timeout
Hendrik Sattler [Sat, 17 Jul 2010 09:14:37 +0000 (11:14 +0200)]
Make send/write routines honour the user-selected timeout

All socket/file descriptor bases routines solve this using a select() call.
LibUSB-1.x is also easy (using a variable instead of a constant). LibUSB-0.x
doesn't know about waiting infinitely but that is simulated by a maximum
timeout. The custom transport must manage the timeout itself for the read()
and write() callbacks.
Previously, the timeout value given to OBEX_HandleInput() was ignored for
the USB transport. Instead they used a fixed timeout. This patch fixes that
without adding additonal data copies.

7 years agoAdd read callback for custom transport
Hendrik Sattler [Fri, 16 Jul 2010 20:48:13 +0000 (22:48 +0200)]
Add read callback for custom transport

Currently, custom transport need their own buffer of the size of the largest
obex packet to do the custom data feed. This includes one data copy that can
be avoided by defining a read function like for all other transports. The old
method can be used at the same time.
Application must be recompiled! But we did not release, yet, and the next
release will have a different SOVERSION, so no problem.

7 years agoRemove indirect buffer copying by obex_data_indication()
Hendrik Sattler [Fri, 16 Jul 2010 20:41:53 +0000 (22:41 +0200)]
Remove indirect buffer copying by obex_data_indication()

Previously, obex_data_indication accepted a buffer (and length) as
arguments, forwarding that to obex_transport_read() where it was copied
to rx_msg. However, this long way can be shortened by copying the data
to rx_msg before calling obex_data_indication(). Thus, the additional
arguments are not needed anymore.

7 years agoAdd OBEX_FL_CLOEXEC flag
Hendrik Sattler [Fri, 16 Jul 2010 17:27:37 +0000 (19:27 +0200)]
Add OBEX_FL_CLOEXEC flag

7 years agoMove obex_transport specific code to own functions
Hendrik Sattler [Fri, 16 Jul 2010 17:17:01 +0000 (19:17 +0200)]
Move obex_transport specific code to own functions

7 years agoAdd obex_transport init and cleanup functions
Hendrik Sattler [Fri, 16 Jul 2010 17:13:41 +0000 (19:13 +0200)]
Add obex_transport init and cleanup functions

7 years agoMove socket_t variables to struct obex_transport
Hendrik Sattler [Fri, 16 Jul 2010 16:56:37 +0000 (18:56 +0200)]
Move socket_t variables to struct obex_transport

The socket variables are transport specific data and do not belong to
struct obex itself. Additionally, replace all usages of "self->trans."
in the transport source files with a shorter struct obex_transport pointer.

7 years agoUse notifiers to get the USB-1.x FD more reliably
Hendrik Sattler [Sat, 20 Mar 2010 20:02:53 +0000 (21:02 +0100)]
Use notifiers to get the USB-1.x FD more reliably

7 years agoUse the transport data pointer to store the obex_ctrans_t
Hendrik Sattler [Fri, 16 Jul 2010 16:09:18 +0000 (18:09 +0200)]
Use the transport data pointer to store the obex_ctrans_t

The obex_ctrans_t is only used when using OBEX_TRANS_CUSTOM. Thus it is
transport private data. Additionally, this adds a clone() function to transport
ops to allow a copy in OBEX_ServerAccept (although a custom transport can never
reach that code as self->fd never gets set).

This also fixes other transports that always relied on the fact the obex_t
pointer is never cleaned up before the obex_t pointers returned from
OBEX_ServerAccept (not relevant on all systems and transports).

7 years agoUse WSAStartup() on Windows only for transports that need it
Hendrik Sattler [Thu, 15 Jul 2010 19:03:32 +0000 (21:03 +0200)]
Use WSAStartup() on Windows only for transports that need it

7 years agoAdd transport specific data pointer
Hendrik Sattler [Wed, 14 Jul 2010 21:08:08 +0000 (23:08 +0200)]
Add transport specific data pointer

The libusb-1.x context must be stored with the obex_t to be able to use more
than one.

7 years agoMake the IrDA device enumeration accessable to the application
Hendrik Sattler [Wed, 14 Jul 2010 20:55:30 +0000 (22:55 +0200)]
Make the IrDA device enumeration accessable to the application

Currently, the IrDA transport can only use the first device. It already uses a
device search to determine possible candidates. These changes make these search
results available to the application by the same functions that are used for
USB interface search. To make that possible, quite some parts of the irobex
transport are reworked and the transport connect function is now a wrapper
around the public interface. This also adds support for IAS queries on Windows.

7 years agoAdd transport enumeration function wrapper
Hendrik Sattler [Wed, 14 Jul 2010 18:45:58 +0000 (20:45 +0200)]
Add transport enumeration function wrapper

This adds a wrapper for calling the transport's find_interfaces() function.
It also changes the signature of that function to add a obex_t ptr as first
argument.

7 years agoAdd missing AF_INET conversion
Hendrik Sattler [Fri, 5 Mar 2010 21:58:06 +0000 (22:58 +0100)]
Add missing AF_INET conversion

7 years agoAdd a generic struct for transport operations
Hendrik Sattler [Wed, 14 Jul 2010 18:16:26 +0000 (20:16 +0200)]
Add a generic struct for transport operations

This add a new struct with operations for transports. All transports are
converted to use them.

7 years agoCmake build files: fix build option for data dumping
Hendrik Sattler [Thu, 24 Jun 2010 17:01:05 +0000 (19:01 +0200)]
Cmake build files: fix build option for data dumping

7 years agoCmake build files: fix installation on 64-bit linux
Thomas Koeller [Wed, 26 Aug 2009 18:28:26 +0000 (20:28 +0200)]
Cmake build files: fix installation on 64-bit linux

7 years agoCMake build files: allow debug levels > 1
Hendrik Sattler [Tue, 6 Apr 2010 21:07:32 +0000 (23:07 +0200)]
CMake build files: allow debug levels > 1

7 years agoFix FindLibUSB cmake module
Hendrik Sattler [Sat, 20 Mar 2010 00:23:20 +0000 (01:23 +0100)]
Fix FindLibUSB cmake module

7 years agoFix build errors with MSVC
Hendrik Sattler [Tue, 13 Jul 2010 04:26:36 +0000 (06:26 +0200)]
Fix build errors with MSVC

MSVC doesn't like "inline", use "__inline" instead.
Additionally, the obex_tcp example application uses functions that are only
available in Windows 7, so disable its compilation on Windows.
obex_test is ok except that one "extern" variable was missing due to usage of
using an internal header file from lib/.

7 years agoLet obex_test handle Ctrl+D
Hendrik Sattler [Thu, 15 Apr 2010 20:01:57 +0000 (22:01 +0200)]
Let obex_test handle Ctrl+D

This used the patch provided in SF.net bug #1741367

7 years agoAdd help message to obex_test
Hendrik Sattler [Thu, 15 Apr 2010 19:36:09 +0000 (21:36 +0200)]
Add help message to obex_test

This is a fixed version of the patch from SF.net bug #1741416

7 years agoMove ircp to apps/ directory
Hendrik Sattler [Thu, 1 Apr 2010 23:25:54 +0000 (01:25 +0200)]
Move ircp to apps/ directory

7 years agoMove source of common app library to its own subdir
Hendrik Sattler [Tue, 13 Jul 2010 04:18:06 +0000 (06:18 +0200)]
Move source of common app library to its own subdir

7 years agoMove all obex_test source files to own subdir
Hendrik Sattler [Tue, 13 Jul 2010 04:08:40 +0000 (06:08 +0200)]
Move all obex_test source files to own subdir

7 years agoobex_data_indication: obex_transport_read return on zero not an error
Steven Walter [Mon, 1 Feb 2010 01:15:53 +0000 (20:15 -0500)]
obex_data_indication: obex_transport_read return on zero not an error

The USB transport will return 0 zero in some situations.  A subsequent
read will succeed.

7 years agoobex_object_send: reduce totallen when dequeueing headers
Steven Walter [Fri, 22 Jan 2010 23:38:03 +0000 (18:38 -0500)]
obex_object_send: reduce totallen when dequeueing headers

Ran into this bug with a server that requires all GET commands to have a
Connection-Id header.  Handled this by calling OBEX_ObjectAddHeader in
the OBEX_EV_PROGRESS handler, but this would eventually fail with
"Header too big" thanks to the incorrect accounting of totallen.

7 years agoSplit big switch-case into several functions
Hendrik Sattler [Tue, 6 Apr 2010 21:02:24 +0000 (23:02 +0200)]
Split big switch-case into several functions

7 years agoPut state and mode into seperate variables
Hendrik Sattler [Sat, 27 Mar 2010 21:21:10 +0000 (22:21 +0100)]
Put state and mode into seperate variables

7 years agoMove linux irda.h to include directory
Hendrik Sattler [Tue, 13 Jul 2010 03:46:54 +0000 (05:46 +0200)]
Move linux irda.h to include directory

7 years agoFix printf data types in debug function calls
Hendrik Sattler [Sat, 20 Mar 2010 00:09:36 +0000 (01:09 +0100)]
Fix printf data types in debug function calls

7 years agoRemove simple and unused unicode conversion functions (v2)
Hendrik Sattler [Sun, 14 Mar 2010 13:22:21 +0000 (14:22 +0100)]
Remove simple and unused unicode conversion functions (v2)

The functions to convert to/from Unicode are too simple to be usable for any
application: they only work for ASCII and ISO-8859-1. This is usually better
done by the application with functions offered by Glib, Qt, iconv or similar.
The example applications are not converted to alternatives, instead they get a
private copy of those functions.

7 years agoReduce code duplication
Hendrik Sattler [Sat, 6 Mar 2010 21:00:57 +0000 (22:00 +0100)]
Reduce code duplication

7 years agoRevert "Use select also for USB when the read file descriptor is valid"
Hendrik Sattler [Mon, 8 Mar 2010 18:09:49 +0000 (19:09 +0100)]
Revert "Use select also for USB when the read file descriptor is valid"

This reverts commit ac36a81faf8a553a1c7cf22d7420c3c3d1b63d5f. It seems that
USB file descriptor does not work with POLLIN.

7 years agoFix commit ab21c6c431afab2d0f368430bad1496e2f0caf1c
Hendrik Sattler [Mon, 1 Mar 2010 19:50:02 +0000 (20:50 +0100)]
Fix commit ab21c6c431afab2d0f368430bad1496e2f0caf1c

The commit made the same mistake that was already fixed in
52bf1445d2fa4b95dac4b98e1cb6e9dbb5d5ed7d. This creates a new static
function that is used by all obex_deliver_event() calls.

7 years agoRemove alread removed function from documentation
Hendrik Sattler [Wed, 24 Feb 2010 19:01:22 +0000 (20:01 +0100)]
Remove alread removed function from documentation

7 years agoSet current obex command for OBEX_EV_STREAM*
Hendrik Sattler [Wed, 24 Feb 2010 19:01:14 +0000 (20:01 +0100)]
Set current obex command for OBEX_EV_STREAM*

7 years agoClean up memory allocation function usage
Hendrik Sattler [Tue, 23 Feb 2010 19:16:06 +0000 (20:16 +0100)]
Clean up memory allocation function usage

Use x=malloc(sizeof(*x)) style for all malloc calls use calloc for
zeroed arrays, also fix memset calls.

7 years agoRemove duplicated definitions of obex header types
Hendrik Sattler [Tue, 23 Feb 2010 05:47:28 +0000 (06:47 +0100)]
Remove duplicated definitions of obex header types

The 4 defintions in lib/obex_header match the OBEX_HDR_TYPE_* from
inlude/openobex/obex_const.h. The latter one is preferred, so we
may as well use them internally.

7 years agoUse select also for USB when the read file descriptor is valid
Hendrik Sattler [Sun, 21 Feb 2010 14:35:06 +0000 (15:35 +0100)]
Use select also for USB when the read file descriptor is valid

7 years agoFix invalid memory access
Bastien Nocera [Fri, 19 Feb 2010 13:40:27 +0000 (13:40 +0000)]
Fix invalid memory access

The hdr pointer will not be valid any more if the transport
read() does a realloc, so reset it after a read().

Fixes the following valgrind error:
==31644== Thread 2:
==31644== Invalid read of size 1
==31644==    at 0x4E3D787: obex_data_indication (obex_main.c:307)
==31644==    by 0x4E3F403: obex_transport_handle_input (obex_transport.c:72)
==31644==    by 0x4E3C67E: OBEX_HandleInput (obex.c:449)
==31644==    by 0x4C335BD: gw_obex_request_sync (obex-priv.c:108)
==31644==    by 0x4C34114: gw_obex_get (obex-priv.c:939)
==31644==    by 0x4C319EE: gw_obex_read_dir (gw-obex.c:198)
==31644==    by 0x408222: _retrieve_folder_listing (gvfsbackendobexftp.c:552)
==31644==    by 0x408DD1: do_enumerate (gvfsbackendobexftp.c:1549)
==31644==    by 0x411491: g_vfs_job_run (gvfsjob.c:198)
==31644==    by 0x3C758658CA: ??? (in /lib64/libglib-2.0.so.0.2303.0)
==31644==    by 0x3C75863A03: ??? (in /lib64/libglib-2.0.so.0.2303.0)
==31644==    by 0x3C74806CA9: start_thread (in /lib64/libpthread-2.11.90.so)
==31644==  Address 0x5313f50 is 0 bytes inside a block of size 71,679 free'd
==31644==    at 0x4A05255: realloc (vg_replace_malloc.c:476)
==31644==    by 0x4E41D12: buf_resize (databuffer.c:147)
==31644==    by 0x4E42063: buf_reserve_end (databuffer.c:217)
==31644==    by 0x4E3FE90: obex_transport_read (obex_transport.c:519)
==31644==    by 0x4E3D711: obex_data_indication (obex_main.c:268)
==31644==    by 0x4E3F403: obex_transport_handle_input (obex_transport.c:72)
==31644==    by 0x4E3C67E: OBEX_HandleInput (obex.c:449)
==31644==    by 0x4C335BD: gw_obex_request_sync (obex-priv.c:108)
==31644==    by 0x4C34114: gw_obex_get (obex-priv.c:939)
==31644==    by 0x4C319EE: gw_obex_read_dir (gw-obex.c:198)
==31644==    by 0x408222: _retrieve_folder_listing (gvfsbackendobexftp.c:552)
==31644==    by 0x408DD1: do_enumerate (gvfsbackendobexftp.c:1549)
==31644==

7 years agoExport the libusb1 read file descriptor
Bastien Nocera [Fri, 19 Feb 2010 12:04:43 +0000 (12:04 +0000)]
Export the libusb1 read file descriptor

When using libusb1, we can export the file descriptor that
corresponds to reading from the device, so it can be used to
setup polling sources, and timeout based operations.

This would be used by osso-gwobex to monitor incoming data, for
USB support.

7 years agoFix libusb1 detection
Bastien Nocera [Fri, 19 Feb 2010 12:03:01 +0000 (12:03 +0000)]
Fix libusb1 detection

There's no need to check for the presence of a .pc file in
/usr/lib/, pkg-config will already do that for you, and it would
fail on machines where /usr/lib64 is used, or when libusb1 is
installed in another prefix.

7 years agoAdd ACTION command opcode and new header ids from v1.3 errata
Hendrik Sattler [Thu, 18 Feb 2010 19:35:16 +0000 (20:35 +0100)]
Add ACTION command opcode and new header ids from v1.3 errata

7 years agoMake obex_transport_accept static
Hendrik Sattler [Tue, 29 Dec 2009 10:39:30 +0000 (11:39 +0100)]
Make obex_transport_accept static