RE: [PATCH obexd] Return correct obex service driver in obex_session_start

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




-----Original Message-----
From: Slawomir Bochenski [mailto:lkslawek@xxxxxxxxx] 
Sent: 2011年6月30日 18:26
To: Li, Nami
Cc: Luiz Augusto von Dentz; linux-bluetooth@xxxxxxxxxxxxxxx
Subject: Re: [PATCH obexd] Return correct obex service driver in obex_session_start

On Thu, Jun 30, 2011 at 12:01 PM, Li, Nami <nami@xxxxxxxxxxxxxxxx> wrote:
> Well, if the profile is OPP, then you can get correct service driver. But if the profile is FTP, because in ftp.c:
>
> static struct obex_service_driver ftp = {
>        .name = "File Transfer server",
>        .service = OBEX_FTP,
>        .channel = FTP_CHANNEL,
>        .psm = FTP_PSM,
>        .record = FTP_RECORD,
>        .target = FTP_TARGET,
>        .target_size = TARGET_SIZE,
>        .connect = ftp_connect,
>        .get = ftp_get,
>        .put = ftp_put,
>        .chkput = ftp_chkput,
>        .setpath = ftp_setpath,
>        .disconnect = ftp_disconnect
> };
> It`s target is not null, target_size is 16, so " obex_service_driver_find(server->drivers, NULL,0, NULL, 0)" will return null.
>
> And I`m not picking up the first driver in the list, actually it is the only one in the list.

In case of other profiles, there is OBEX connect command required, and then the appropriate driver will be selected in callback for OBEX connect event (see cmd_connect()).

--
Slawomir Bochenski


Yep, you can get right diver after cmd_connect(). But I think user should get correct driver once obex session start, not after connect cmd. What if user want to use driver in obex_session_start() ? I need to use it when add OBEX over L2CAP.
For OPP, it doesn`t register target and target size in opp.c. So when you call "obex_service_driver_find(server->drivers, NULL, 0, NULL, 0); ", it also returns on first and only list member:

					  if (memncmp0(target, target_size, driver->target,driver->target_size) == 0)			return driver;
which is actually ===>    if (memncmp0(NULL,0, NULL,0) == 0)			return driver;


So I think my patch is OK.

Regards,
Nami



��.n��������+%������w��{.n�����{����^n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux