Changeset 730 for branches


Ignore:
Timestamp:
01/30/12 00:32:16 (4 months ago)
Author:
shiretu
Message:

-- fixed a bug in RTMP uri parsing
-- fixed some issues inside config files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/sources/common/src/utils/misc/uri.cpp

    r690 r730  
    204204                } 
    205205 
    206                 for (string::size_type i = fullDocumentPath.size() - 1; i >= 0; i--) { 
    207                         if (fullDocumentPath[i] == '/') 
    208                                 break; 
    209                         document = fullDocumentPath[i] + document; 
    210                 } 
    211                 documentPath = fullDocumentPath.substr(0, fullDocumentPath.size() - document.size()); 
     206                bool rtmpDocument = false; 
     207 
     208                if (scheme.find("rtmp") == 0) { 
     209                        pos = fullDocumentPath.find(':'); 
     210                        if (pos == string::npos) { 
     211                                rtmpDocument = false; 
     212                        } else { 
     213                                pos = fullDocumentPath.rfind('/', pos); 
     214                                if (pos == string::npos) { 
     215                                        rtmpDocument = false; 
     216                                } else { 
     217                                        rtmpDocument = true; 
     218                                } 
     219                        } 
     220                } else { 
     221                        rtmpDocument = false; 
     222                } 
     223 
     224                if (rtmpDocument) { 
     225                        pos = fullDocumentPath.find(':'); 
     226                        pos = fullDocumentPath.rfind('/', pos); 
     227                        documentPath = fullDocumentPath.substr(0, pos + 1); 
     228                        document = fullDocumentPath.substr(pos + 1); 
     229                } else { 
     230                        for (string::size_type i = fullDocumentPath.size() - 1; i >= 0; i--) { 
     231                                if (fullDocumentPath[i] == '/') 
     232                                        break; 
     233                                document = fullDocumentPath[i] + document; 
     234                        } 
     235                        documentPath = fullDocumentPath.substr(0, fullDocumentPath.size() - document.size()); 
     236                } 
    212237                documentWithFullParameters = document; 
    213238                if (fullParameters != "") 
Note: See TracChangeset for help on using the changeset viewer.