[datatype-dev] CR-Client: handle relative URLs in base meta renderer

[datatype-dev] CR-Client: handle relative URLs in base meta renderer

Eric Hyche ehyche at real.com
Tue Nov 28 08:51:31 PST 2006




> -----Original Message-----
> From: Henry Ping [mailto:ping at real.com] 
> Sent: Tuesday, November 28, 2006 11:42 AM
> To: ehyche at real.com; datatype-dev at lists.helixcommunity.org
> Subject: RE: [datatype-dev] CR-Client: handle relative URLs 
> in base meta renderer
> 
> If cURL.GetLastError() returns an error and it's not relative 
> URL, do we still want to pass it to the core?
> 

I'm not trying to do much here in the way of filtering
out bad URLs - I'm assuming that if the URL is bad, then
when the filesystem or fileformat try to open it, then
the error will show up there. I'm just trying to
detect relative URLs.

Eric

> For RAM, we validate the protocol part of the URL and skip it 
> if it's not
> valid.
> 
> Rest looks good.
> 
> -->Henry
> 
> > -----Original Message-----
> > From: datatype-dev-bounces at helixcommunity.org 
> > [mailto:datatype-dev-bounces at helixcommunity.org] On Behalf Of 
> > Eric Hyche
> > Sent: Monday, November 27, 2006 2:25 PM Ping
> > To: datatype-dev at lists.helixcommunity.org
> > Subject: [datatype-dev] CR-Client: handle relative URLs in 
> > base meta renderer
> > 
> > 
> > Description
> > -----------------------------------------
> > URLs inside an ASX file can be relative. This change enables 
> > the base meta renderer to handle these relative URLs.
> > 
> > Files Modified
> > -----------------------------------------
> > datatype/common/metarend/metarend.cpp
> > 
> > Branches
> > -----------------------------------------
> > HEAD only
> > 
> > Index: metarend.cpp
> > ===================================================================
> > RCS file: /cvsroot/datatype/common/metarend/metarend.cpp,v
> > retrieving revision 1.2
> > diff -u -w -u -w -r1.2 metarend.cpp
> > --- metarend.cpp        27 Nov 2006 17:40:12 -0000      1.2
> > +++ metarend.cpp        27 Nov 2006 22:22:40 -0000
> > @@ -806,8 +806,7 @@
> >          {
> >              const char* pszURL = pSource->GetURL();
> >              HX_ASSERT(pszURL);
> > -            // We only set (and use) these for local ram files.
> > -            if (pszURL && !strncasecmp(pszURL, "file:", 5))
> > +            if (pszURL)
> >              {
> >                  // Use original URL if it exists
> >                  HXBOOL bPrefixGenHandled = FALSE; @@ 
> > -1286,14 +1285,23 @@
> >                      retVal =
> > m_ppMetaEntry[i]->m_ppRefMetaData[0]->GetPropertyCString("URL"
> > , pBuffer);
> >                      if (SUCCEEDED(retVal))
> >                      {
> > +                        // Create a local CHXString with the URL
> > +                        CHXString strURL((const char*)
> > pBuffer->GetBuffer());
> > +                        // Check if this is a relative URL
> > +                        CHXURL cURL((const char*) strURL, 
> > m_pContext);
> > +                        if (FAILED(cURL.GetLastError()) &&
> > cURL.IsRelativeURL())
> > +                        {
> > +                            // This is a relative URL, so we 
> > have to fix up
> > +                            // by appending it to the URL prefix
> > +                            strURL  = m_urlPrefix;
> > +                            strURL += (const char*) 
> > pBuffer->GetBuffer();
> > +                        }
> >                          // Set the return value
> >                          retVal = HXR_OUTOFMEMORY;
> >                          // Allocate a CString
> > -                        CHXString* pURL = new 
> CHXString((const char*)
> > pBuffer->GetBuffer());
> > +                        CHXString* pURL = new CHXString(strURL);
> >                          if (pURL)
> >                          {
> > -                            // Make sure the URL is escaped
> > -//                            
> HXEscapeUtil::EnsureEscapedURL(*pURL);
> >                              // Add this to the track map
> >                              m_pTrackMap->SetAt((LONG32) i, 
> > (void*) pURL);
> >                              // Clear the return value
> > 
> > 
> > =============================================
> > Eric Hyche (ehyche at real.com)
> > Technical Lead
> > RealNetworks, Inc. 
> > 
> > 
> > _______________________________________________
> > Datatype-dev mailing list
> > Datatype-dev at helixcommunity.org
> > http://lists.helixcommunity.org/mailman/listinfo/datatype-dev
> 




More information about the Datatype-dev mailing list
 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.