Iain Hibbert | 21 Jun 2011 17:39

OBEX_ServerRegister() regression?

Hi,

I found a problem running obexapp with newer OpenOBEX library, in that it
previously called OBEX_ServerRegister(), passing a sockaddr as requested,
but that the newer OpenOBEX now returns a failure for this..

The reason for the failure being that obexapp uses a custom transport and
custom transport handling does not provide any set_local_addr method.

I'm not sure that the address it passed was significant in any way (and
obexapp does not expect that it is), so just passing an empty address may
have been correct for that, but before I file a bug report with the
obexapp author is it an acceptable regression for OpenOBEX? The
alternative would be to provide an empty set_local_addr for the custom
transport..

iain

(although obexapp provides Bluetooth service, I'm not sure if Max wrote it
before the BtOBEX was created, or if he chose the custom transport so that
it could register SDP services aswell)

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
Iain Hibbert | 21 Jun 2011 18:46

Re: OBEX_ServerRegister() regression?

On Tue, 21 Jun 2011, Iain Hibbert wrote:

> I found a problem running obexapp with newer OpenOBEX library, in that it
> previously called OBEX_ServerRegister(), passing a sockaddr as requested,
> but that the newer OpenOBEX now returns a failure for this..
>
> The reason for the failure being that obexapp uses a custom transport and
> custom transport handling does not provide any set_local_addr method.
>
> I'm not sure that the address it passed was significant in any way (and
> obexapp does not expect that it is), so just passing an empty address may
> have been correct for that, but before I file a bug report with the
> obexapp author is it an acceptable regression for OpenOBEX?

I just noticed the comment at OBEX_ServerRegister:

	Bind a server socket to an Obex service. Common transport have
	specialised version of this function.
	If you want to call the listen callback of the custom transport,
	use NULL for saddr and 0 for addrlen.

which implies that this will be a known issue, I will send a patch to
obexapp maintainer..

iain

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
(Continue reading)

Hendrik Sattler | 21 Jun 2011 22:56
Picon

Re: OBEX_ServerRegister() regression?

Am Dienstag, 21. Juni 2011, 17:39:32 schrieb Iain Hibbert:
> Hi,
> 
> I found a problem running obexapp with newer OpenOBEX library, in that it
> previously called OBEX_ServerRegister(), passing a sockaddr as requested,
> but that the newer OpenOBEX now returns a failure for this..
> 
> The reason for the failure being that obexapp uses a custom transport and
> custom transport handling does not provide any set_local_addr method.
> 
> I'm not sure that the address it passed was significant in any way (and
> obexapp does not expect that it is), so just passing an empty address may
> have been correct for that, but before I file a bug report with the
> obexapp author is it an acceptable regression for OpenOBEX? The
> alternative would be to provide an empty set_local_addr for the custom
> transport..

Same goes for the FD transport. Using dummy values is not correct as the 
custom transport cannot validate the value. So IMHO returning -1 in this case 
is right. Using NULL and 0 willl work with the old version _IF_ the memcpy() 
does  work with
	memcpy(foo, NULL, 0);

> (although obexapp provides Bluetooth service, I'm not sure if Max wrote it
> before the BtOBEX was created, or if he chose the custom transport so that
> it could register SDP services aswell)

How are SDP services registered on BSD?

HS
(Continue reading)

Iain Hibbert | 22 Jun 2011 08:09

Re: OBEX_ServerRegister() regression?

On Tue, 21 Jun 2011, Hendrik Sattler wrote:

> Am Dienstag, 21. Juni 2011, 17:39:32 schrieb Iain Hibbert:
> > Hi,
> >
> > I found a problem running obexapp with newer OpenOBEX library, in that it
> > previously called OBEX_ServerRegister(), passing a sockaddr as requested,
> > but that the newer OpenOBEX now returns a failure for this..
> >
> > The reason for the failure being that obexapp uses a custom transport and
> > custom transport handling does not provide any set_local_addr method.
> >
> > I'm not sure that the address it passed was significant in any way (and
> > obexapp does not expect that it is), so just passing an empty address may
> > have been correct for that, but before I file a bug report with the
> > obexapp author is it an acceptable regression for OpenOBEX? The
> > alternative would be to provide an empty set_local_addr for the custom
> > transport..
>
> Same goes for the FD transport. Using dummy values is not correct as the
> custom transport cannot validate the value. So IMHO returning -1 in this case
> is right. Using NULL and 0 willl work with the old version _IF_ the memcpy()
> does  work with
> 	memcpy(foo, NULL, 0);

Hm, that may be Ok I think, though C99 does not specifically allow it..

perhaps it would be better to just ignore any passed addresses, if the
backend does not need it?  There is no way, AFAIK, for the calling code to
recover that address anyway..
(Continue reading)

Hendrik Sattler | 22 Jun 2011 10:37
Picon

Re: OBEX_ServerRegister() regression?

Zitat von Iain Hibbert <plunky <at> rya-online.net>:
> On Tue, 21 Jun 2011, Hendrik Sattler wrote:
>
>> Am Dienstag, 21. Juni 2011, 17:39:32 schrieb Iain Hibbert:
>> > Hi,
>> >
>> > I found a problem running obexapp with newer OpenOBEX library, in that it
>> > previously called OBEX_ServerRegister(), passing a sockaddr as requested,
>> > but that the newer OpenOBEX now returns a failure for this..
>> >
>> > The reason for the failure being that obexapp uses a custom transport and
>> > custom transport handling does not provide any set_local_addr method.
>> >
>> > I'm not sure that the address it passed was significant in any way (and
>> > obexapp does not expect that it is), so just passing an empty address may
>> > have been correct for that, but before I file a bug report with the
>> > obexapp author is it an acceptable regression for OpenOBEX? The
>> > alternative would be to provide an empty set_local_addr for the custom
>> > transport..
>>
>> Same goes for the FD transport. Using dummy values is not correct as the
>> custom transport cannot validate the value. So IMHO returning -1 in  
>> this case
>> is right. Using NULL and 0 willl work with the old version _IF_ the memcpy()
>> does  work with
>> 	memcpy(foo, NULL, 0);
>
> Hm, that may be Ok I think, though C99 does not specifically allow it..
>
> perhaps it would be better to just ignore any passed addresses, if the
(Continue reading)


Gmane