bool get_next_line(const char *start_ptr, const char * end_ptr,
                           const char *& line_start,
                           const char *& line_end)
        {
            // Finds the boundaries of the next non-empty line within start
            // and end ptrs

            // This initializes line_start to the first non-whitespace character
            line_start = skip_whitespace_and_line_term(start_ptr, end_ptr);

            line_end = skip_to_line_term(line_start, end_ptr);

            return (line_start < end_ptr);

        }
OSCL_EXPORT_REF bool parseRtspRange(const char *rangeString, int length, RtspRangeType& range)
{
    const char *end = rangeString + length;

    const char* sptr, *eptr;

    // initialize range to invalid format
    range.format = RtspRangeType::INVALID_RANGE;

    // find the first word before the "="
    sptr = skip_whitespace_and_line_term(rangeString, end);
    if (sptr >= end)
    {
        return false;
    }

    for (eptr = sptr; eptr < end &&
            (*eptr != '=' && *eptr != ':' && *eptr != ' ' && *eptr != '\t');
            ++eptr);


    StrPtrLen smpte_type("smpte");
    StrPtrLen smpte25_type("smpte-25");
    StrPtrLen smpte30_type("smpte-30-drop");
    StrPtrLen npt_type("npt");
    StrPtrLen abs_type("clock");
//#ifdef RTSP_PLAYLIST_SUPPORT
    StrPtrLen playlist_play_time_type("playlist_play_time");
//#endif //#ifdef RTSP_PLAYLIST_SUPPORT

    if (!oscl_strncmp(sptr, smpte_type.c_str(), eptr - sptr) ||
            !oscl_strncmp(sptr, smpte25_type.c_str(), eptr - sptr) ||
            !oscl_strncmp(sptr, smpte30_type.c_str(), eptr - sptr))
    {
        // Parsing one of the SMPTE time formats

        // save the exact format temporarily
        RtspRangeType::RtspRangeFormat tmp_format;
        if (!oscl_strncmp(sptr, smpte30_type.c_str(), smpte30_type.length()))
        {
            tmp_format = RtspRangeType::SMPTE_30_RANGE;
        }
        else if (!oscl_strncmp(sptr, smpte25_type.c_str(), smpte25_type.length()))
        {
            tmp_format = RtspRangeType::SMPTE_25_RANGE;
        }
        else
        {
            tmp_format = RtspRangeType::SMPTE_RANGE;
        }

        // skip ahead to beyond the "="
        if (*eptr != '=')
        {
            for (; eptr < end && *eptr != '='; ++eptr);
        }

        sptr = skip_whitespace(eptr + 1, end);
        if (sptr >= end)
        {
            return false;
        }

        // find the start/end separator
        for (eptr = sptr; eptr < end &&
                (*eptr != '-'); ++eptr);

        if (*eptr != '-')
        {
            return false;
        }

        range.start_is_set = false;
        if (eptr > sptr)
        {
            // there is a start time

            if (parse_smpte_format(sptr, eptr, tmp_format, range.smpte_start) == false)
            {
                return false;
            }

            // now set the appropriate flags
            range.start_is_set = true;
        }

        // see if there is a stop time
        sptr = skip_whitespace_and_line_term(eptr + 1, end);
        range.end_is_set = false;
        if (sptr < end)
        {
            // there is a stop time specification
            eptr = skip_to_whitespace(sptr, end);

            if (parse_smpte_format(sptr, eptr, tmp_format, range.smpte_end)
                    == false)
            {
                return false;
            }

            // now set the appropriate flags
            range.end_is_set = true;
        }

        // now set the appropriate range format
        range.format = tmp_format;

    } // end if this is an SMPTE time format

    else if (!oscl_strncmp(sptr, npt_type.c_str(), eptr - sptr))
    {

        // skip ahead to beyond the "=" or ":"
        if (*eptr != '=')
        {
            for (; eptr < end && *eptr != '=' && *eptr != ':'; ++eptr);
        }

        sptr = skip_whitespace(eptr + 1, end);
        if (sptr >= end)
        {
            return false;
        }

        // find the start/end separator
        for (eptr = sptr; eptr < end &&
                (*eptr != '-'); ++eptr);

        if (*eptr != '-')
        {
            return false;
        }

        range.start_is_set = false;
        if (eptr > sptr)
        {
            // there is a start time
            if (parse_npt_format(sptr, eptr, range.npt_start) == false)
            {
                return false;
            }

            // now set the appropriate flags
            range.start_is_set = true;

        }

        // see if there is a stop time
        range.end_is_set = false;
        sptr = skip_whitespace_and_line_term(eptr + 1, end);
        if (sptr < end)
        {
            // there is a stop time specification
            eptr = skip_to_whitespace(sptr, end);

            if (parse_npt_format(sptr, eptr, range.npt_end)
                    == false)
            {
                return false;
            }

            // now set the appropriate flags
            range.end_is_set = true;
        }

        // now set the appropriate range format
        range.format = RtspRangeType::NPT_RANGE;

    } // end if this is an NPT time format

    else if (!oscl_strncmp(sptr, abs_type.c_str(), eptr - sptr))
    {


        // skip ahead to beyond the "="
        if (*eptr != '=')
        {
            for (; eptr < end && *eptr != '='; ++eptr);
        }

        sptr = skip_whitespace(eptr + 1, end);
        if (sptr >= end)
        {
            return false;
        }

        // find the start/end separator
        for (eptr = sptr; eptr < end &&
                (*eptr != '-'); ++eptr);

        if (*eptr != '-')
        {
            return false;
        }

        range.start_is_set = false;
        if (eptr > sptr)
        {
            // there is a start time
            if (parse_abs_format(sptr, eptr, range.abs_start) == false)
            {
                return false;
            }

            // now set the appropriate flags
            range.start_is_set = true;

        }

        // see if there is a stop time
        sptr = skip_whitespace_and_line_term(eptr + 1, end);
        range.end_is_set = true;
        if (sptr < end)
        {
            // there is a stop time specification
            eptr = skip_to_whitespace(sptr, end);

            if (parse_abs_format(sptr, eptr, range.abs_end)
                    == false)
            {
                return false;
            }

            // now set the appropriate flags
            range.end_is_set = true;
        }

        // now set the appropriate range format
        range.format = RtspRangeType::ABS_RANGE;

    } // end if this is an ABS time format
//#ifdef RTSP_PLAYLIST_SUPPORT
    // for Range:playlist_play_time=<URN,clipIndex,clipOffset>
    //playlist_play_time=</public/playlist/va_playlists/test.ply,3,0.0>;npt=194.81542
    else if (!oscl_strncmp(sptr, playlist_play_time_type.c_str(), eptr - sptr))
    {
        // store the whole string since we may not need the parsed version of things
        //oscl_memcpy(range.iPlaylistPlayStr,rangeString,length);
        //range.iPlaylistPlayStr[length] = '\0';

        range.format = RtspRangeType::PLAYLIST_TIME_RANGE;
        range.start_is_set = range.end_is_set = false;

        // now set the appropriate flags
        range.start_is_set = true;

        // skip ahead to beyond the "="
        if (*eptr != '=')
        {
            for (; eptr < end && *eptr != '='; ++eptr);
        }

        sptr = skip_whitespace(eptr + 1, end);
        if (sptr >= end)
        {
            return false;
        }

        // next should be the opening "<"
        // skip ahead to beyond the "<"
        if (*eptr != '<')
        {
            for (; eptr < end && *eptr != '<'; ++eptr);
        }

        sptr = skip_whitespace(eptr + 1, end);
        if (sptr >= end)
        {
            return false;
        }

        // find the comma separator
        for (eptr = sptr; eptr < end &&
                (*eptr != ','); ++eptr);

        if (*eptr != ',')
        {
            return false;
        }

        // first the urn
        if (eptr > sptr)
        {
            // there is a urn
            if (oscl_memcpy(range.iPlaylistUrl, sptr, eptr - sptr) == false)
            {
                return false;
            }
            //range.iUrn[(eptr-sptr)+1] = '\0';
            range.iPlaylistUrl[eptr-sptr] = '\0';
        }

        // now the clipIndex
        sptr = skip_whitespace(eptr + 1, end);
        if (sptr >= end)
        {
            return false;
        }

        // find the next comma separator
        for (eptr = sptr; eptr < end &&
                (*eptr != ','); ++eptr);

        if (*eptr != ',')
        {
            return false;
        }

        // now the clipIndex
        if (eptr > sptr)
        {
            // there is a clipIndex
            uint32 tmp;
            if (PV_atoi(sptr, 'd', eptr - sptr, tmp) == false)
            {
                return false;
            }
            range.playlist_start.iClipIndex = (int32)tmp;
        }

        // now the clipOffset
        sptr = skip_whitespace(eptr + 1, end);
        if (sptr >= end)
        {
            return false;
        }

        // find the final '>' separator or the final possible '.' in offset
        //<sec>.<frac>
        for (eptr = sptr; eptr < end &&
                (*eptr != '>') && (*eptr != '.'); ++eptr);

        if (eptr >= end)
        {
            return false;
        }

        // @todo ignore the factional part for now
        // now the clipOffset
        if (eptr > sptr)
        {
            // there is a clipOffset
            uint32 tmp;
            if (PV_atoi(sptr, 'd', eptr - sptr, tmp) == false)
            {
                return false;
            }
            range.playlist_start.sec = (int32)tmp;

            {
                range.playlist_start.milli_sec = 0;
                if (*eptr == '.')
                {
                    // there is an optional fractional seconds field

                    // get the fractional seconds
                    const int MAX_TMP_BUFSIZE = 12;
                    char tmpbuf[MAX_TMP_BUFSIZE];
                    int copy_size;

                    eptr = skip_to_whitespace(sptr, end);

                    copy_size = eptr - sptr;

                    if (copy_size > MAX_TMP_BUFSIZE - 1)
                    {
                        copy_size = MAX_TMP_BUFSIZE - 1;
                    }

                    oscl_strncpy(tmpbuf, sptr, copy_size);


                    tmpbuf[copy_size] = '\0';

                    OsclFloat tmp_fnum;
                    if (!PV_atof(tmpbuf, tmp_fnum))
                        return false;
                    range.playlist_start.milli_sec = (uint32)(1000.0 * tmp_fnum + 0.5);
                }
            }
        }
    }  // end if this is a playlist_play_time format, for response to playlist_play commands
//#endif //#ifdef RTSP_PLAYLIST_SUPPORT
    else
    {
        /*Unsupported time format*/
        range.format = RtspRangeType::UNKNOWN_RANGE;
        range.start_is_set = false;
        range.end_is_set = false;
        return false;
    }

    return true;
}
        //Read and parse the config file
        //retval = -1 if the config file doesnt exist
        int8 ReadAndParseLoggerConfigFile()
        {
            int8 retval = 1;

            if (0 != iLogFile.Open(iLogFileName, Oscl_File::MODE_READ, iFileServer))
            {
                retval = -1;
            }
            else
            {
                if (!iLogFileRead)
                {
                    int32 nCharRead = iLogFile.Read(ibuffer, 1, sizeof(ibuffer));
                    //Parse the buffer for \n chars
                    Oscl_Vector<char*, OsclMemAllocator> LogConfigStrings;

                    const char *end_ptr = ibuffer + oscl_strlen(ibuffer) ; // Point just beyond the end
                    const char *section_start_ptr;
                    const char *line_start_ptr, *line_end_ptr;
                    char* end_temp_ptr;
                    int16 offset = 0;

                    section_start_ptr = skip_whitespace_and_line_term(ibuffer, end_ptr);

                    while (section_start_ptr < end_ptr)
                    {
                        if (!get_next_line(section_start_ptr, end_ptr,
                                           line_start_ptr, line_end_ptr))
                        {
                            break;
                        }


                        section_start_ptr = line_end_ptr + 1;

                        end_temp_ptr = (char*)line_end_ptr;
                        *end_temp_ptr = '\0';

                        LogConfigStrings.push_back((char*)line_start_ptr);

                    }

                    //Populate the  LoggerConfigElements vector
                    {
                        if (!LogConfigStrings.empty())
                        {
                            Oscl_Vector<char*, OsclMemAllocator>::iterator it;
                            it = LogConfigStrings.begin();
                            uint32 appenderType;
                            PV_atoi(*it, 'd', oscl_strlen(*it), appenderType);
                            iAppenderType = appenderType;
                            if (LogConfigStrings.size() > 1)
                            {
                                for (it = LogConfigStrings.begin() + 1; it != LogConfigStrings.end(); it++)
                                {
                                    char* CommaIndex = (char*)oscl_strstr(*it, ",");
                                    if (CommaIndex != NULL)
                                    {
                                        *CommaIndex = '\0';
                                        LoggerConfigElement obj;
                                        uint32 logLevel;
                                        PV_atoi(*it, 'd', oscl_strlen(*it), logLevel);
                                        obj.iLogLevel = logLevel;
                                        obj.iLoggerString = CommaIndex + 1;
                                        iLoggerConfigElements.push_back(obj);
                                    }
                                }
                            }
                            else
                            {
                                //Add the config element for complete logging fo all the modules
                                LoggerConfigElement obj;
                                obj.iLoggerString = "";
                                obj.iLogLevel = 8;
                                iLoggerConfigElements.push_back(obj);
                            }
                        }
                    }
                    iLogFile.Close();
                    iLogFileRead = true;
                }
            }
            return retval;
        }