Re: Bug in sending advertisment set

[email protected] Fri, 5 May 2006 10:41:46 +0200 (MEST)
Newsgroups gmane.linux.upnp-sdk.general
Message-ID <[email protected]>
Agreeing with Nektarios and because of the confusion the specification
sometimes causes I have one practical question: Where and how does the bu=
g
described below cause any problems?


> --- Urspr=FCngliche Nachricht ---
> Von: "Nektarios K. Papadopoulos" <[email protected]>
> An: [email protected]
> Betreff: Re: [UPnP-SDK-discuss] Bug in sending advertisment set
> Datum: Fri, 05 May 2006 11:06:59 +0300
>=20
> I've always found it hard to be absolutely sure what the UPnP Device=20
> Architecture specifies :-P
>=20
> Having said that, let me point to two other quotes from the same sectio=
n:
>=20
> "Due to the unreliable nature of UDP, devices should send each of the=20
> above discovery messages more than once."
>=20
> "These messages must be sent out as a series with roughly comparable=20
> expiration times; order is unimportant, but refreshing or canceling=20
> individual messages is prohibited."
>=20
> I guess the first quote lead the original author to this implementation=
.=20
> The second is really confusing for me. How can one *refresh* or *cancel=
*=20
> an individual message ?
>=20
> Triggered by *"sent out as a series"*, I came up with the attached=20
> patch. Sending NUM_COPY times the *series* of the messages ;-)
>=20
> What do others think?
>=20
> PS: BTW, did these duplicate messages confused your control point ? I'v=
e=20
> never had any problem with the multiple NOTIFY messages.
>=20
> Olga Soiko wrote:
> > According to UPnP Device Architecture
> >   Section  1.1.2 Discovery: Advertisement: Device available -- NOTIFY
> > with ssdp:alive
> > "NT" in NOTIFY message described the next:
> > =20
> >   NT
> >                   Required header defined by GENA. Notification Type.
> >                   Must be one of the following. (cf. table above.)
> > Single URI.
> >   upnp:rootdevice
> >                   Sent once for root device.
> >   uuid:device-UUID
> >                   Sent once for each device, root or embedded.
> >                   Device UUID specified by UPnP vendor.
> >   urn:schemas-upnp-org:device:deviceType:v
> >                   Sent once for each device, root or embedded.
> >                   Device type and version defined by UPnP Forum worki=
ng
> > committee.
> >   urn:schemas-upnp-org:service:serviceType:v
> >                   Sent once for each service.
> >                   Service type and version defined by UPnP Forum work=
ing
> > committee.
> >=20
> > Because of 'while(NUM_COPY)' in the function 'NewRequestHandler'
> > NOTIFY messages with the same values of 'upnp:rootdevice',
> > 'uuid:device-UUID', 'urn:schemas-upnp-org:device:deviceType:v',
> > 'urn:schemas-upnp-org:service:serviceType:v' are sent more than ones.
> > I propose to delete 'while'.
> > =20
> >=20
> >=20
> > ---------------------------------------------------------------------=
---
> >=20
> > diff -Naur old/upnp/src/ssdp/ssdp_device.c
> new/upnp/src/ssdp/ssdp_device.c
> > --- old/upnp/src/ssdp/ssdp_device.c	2006-02-22 23:38:04 +0200
> > +++ new/upnp/src/ssdp/ssdp_device.c	2006-04-10 16:50:43 +0300
> > @@ -231,7 +231,7 @@
> >          int rc;
> > =20
> >          NumCopy =3D 0;
> > -        while( NumCopy < NUM_COPY ) {
> > +//        while( NumCopy < NUM_COPY ) {
> >              DBGONLY( UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__=
,
> >                                   ">>> SSDP SEND >>>\n%s\n",
> >                                   *( RqPacket + Index ) );
> > @@ -241,7 +241,7 @@
> >                               0, ( struct sockaddr * )DestAddr, sockl=
en
> );
> >              imillisleep( SSDP_PAUSE );
> >              ++NumCopy;
> > -        }
> > +//        }
> >      }
> > =20
> >      shutdown( ReplySock, SD_BOTH );
>=20
> --=20
> ______________________________________________________________
> Nektarios K. Papadopoulos
> Senior Engineer
> Software Engineering Group
> inAccess Networks
> 95A Pentelis Avenue.    Tel    : +30-210-6837640
> 152 34 Halandri Athens  Fax    : +30-210-6899504
> ______________________________________________________________
>=20

--=20
Analog-/ISDN-Nutzer sparen mit GMX SmartSurfer bis zu 70%!
Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job ea=
sier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim=
o
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D=
121642