[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Ccrtp-devel] 2 problem in rtp.h
From: |
Federico Montesino Pouzols |
Subject: |
Re: [Ccrtp-devel] 2 problem in rtp.h |
Date: |
Mon, 15 Mar 2004 10:22:51 +0100 |
User-agent: |
Mutt/1.3.28i |
Yes, both bugs were in 1.1.0, and both fixes from Guillaume
are now in CVS. Thanks for the report!
Also yes, it would make sense to replace string with String, I
will take care of that a bit later...
On Thu, Mar 11, 2004 at 09:13:57PM -0500, David Sugar wrote:
> Hmm...I think Federico will look at this more closely. However, the current
> release of ccrtp is 1.1.0, not 1.0.2. It looks like the username question is
> valid for 1.1.0 as well, however, and so I assume the other issue is also.
>
> I was thinking it would soon be a good time to do a new release since we were
> getting ready to do a 1.1.1 common c++ release shortly.
>
> On a related note, should we continue using std::string in ccrtp or should we
> now use the new Common C++ "String" class?
>
> On Friday 12 March 2004 07:20 am, Guillaume Glodas wrote:
> > Hi,
> >
> >
> > we've found a string initialisation problem in the source file
> > ccrtp-1.0.2/src/source.cpp
> >
> > 81,83c81,90
> > if ( !strcmp(user,"") )
> > user = Process::getEnv("USER");
> > username = user;
> >
> > when user is NULL, username which is a string, is wrongly initialised.
> >
> > this piece of code seems to fix this bug :
> > if (user) {
> > if ( !strcmp(user,"") )
> > user = Process::getEnv("USER");
> > if (user)
> > username = user;
> > else
> > username="";
> > }
> > else
> > username ="";
> > .
> >
> > We've found a dead lock problem in the header file
> > ccrtp-1.0.2_local/src/ccrtp/rtp.h
> >
> > run()
> > {
> > microtimeout_t timeout = 0;
> > while ( ServiceQueue::isActive() ) {
> > if ( !timeout ){
> > timeout = getSchedulingTimeout();
> > }
> > setCancel(cancelDeferred);
> > controlReceptionService();
> > controlTransmissionService();
> > setCancel(cancelImmediate);
> > microtimeout_t maxWait =
> >
> > timeval2microtimeout(getRTCPCheckInterval());
> > // make sure the scheduling timeout is
> > // <= the check interval for RTCP
> > // packets
> > timeout = (timeout > maxWait)? maxWait :
> > timeout;
> > if ( !timeout ) {
> > setCancel(cancelDeferred);
> > size_t r = dispatchDataPacket();
> > setCancel(cancelImmediate);
> > if ( r < 0 )
> > timeout = timeout;
> > timerTick();
> > } else {
> > if ( isPendingData(timeout/1000) ) {
> > setCancel(cancelDeferred);
> > size_t r = takeInDataPacket();
> > setCancel(cancelImmediate);
> > if ( r < 0 )
> > return;
> > }
> > timeout = 0;
> > }
> > }
> > dispatchBYE("GNU ccRTP stack finishing.");
> > sleep(~0);
> > }
> >
> > if timeout < 100 timeout/1000 = 0
> > isPendingData(timeout/1000) == isPendingData(0)
> > if there no incoming data, isPendingData waits undefinitely.
> >
> > This piece of code seems to solve the problem :
> > run()
> > {
> > microtimeout_t timeout = 0;
> > while ( ServiceQueue::isActive() ) {
> > if ( !(timeout/1000) ){
> > timeout = getSchedulingTimeout();
> > }
> > setCancel(cancelDeferred);
> > controlReceptionService();
> > controlTransmissionService();
> > setCancel(cancelImmediate);
> > microtimeout_t maxWait =
> >
> > timeval2microtimeout(getRTCPCheckInterval());
> > // make sure the scheduling timeout is
> > // <= the check interval for RTCP
> > // packets
> > timeout = (timeout > maxWait)? maxWait :
> > timeout;
> > if ( !(timeout/1000) ) {
> > setCancel(cancelDeferred);
> > size_t r = dispatchDataPacket();
> > setCancel(cancelImmediate);
> > if ( r < 0 )
> > timeout = timeout;
> > timerTick();
> > } else {
> > if ( isPendingData(timeout/1000) ) {
> > setCancel(cancelDeferred);
> > size_t r = takeInDataPacket();
> > setCancel(cancelImmediate);
> > if ( r < 0 )
> > return;
> > }
> > timeout = 0;
> > }
> > }
> > dispatchBYE("GNU ccRTP stack finishing.");
> > sleep(~0);
> > }
> >
> > regards,
> >
> > Guillaume Glodas
> >
> >
> >
> > _______________________________________________
> > Ccrtp-devel mailing list
> > address@hidden
> > http://mail.gnu.org/mailman/listinfo/ccrtp-devel
>
>
>
> _______________________________________________
> Ccrtp-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/ccrtp-devel