Changeset 730


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

Files:
5 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 != "") 
  • trunk/builders/cmake/crtmpserver/crtmpserver.lua

    r716 r730  
    152152                                        uri="rtmp://edge01.fms.dutchview.nl/botr/bunny", 
    153153                                        localStreamName="rtmp_test", 
    154                                         swfUrl="http://www.example.com/example.swf"; 
    155                                         pageUrl="http://www.example.com/"; 
     154                                        swfUrl="http://www.example.com/example.swf", 
     155                                        pageUrl="http://www.example.com/", 
     156                                        tcUrl="rtmp://edge01.fms.dutchview.nl/botr/bunny", --this one is usually required and should have the same value as the uri 
    156157                                        emulateUserAgent="MAC 10,1,82,76", 
    157158                                }]]-- 
  • trunk/configs/all.debug.lua

    r672 r730  
    150150                                        localStreamName="stream6", 
    151151                                        emulateUserAgent="MAC 10,1,82,76", 
     152                                        tcUrl="rtmp://edge01.fms.dutchview.nl/botr/bunny", --this one is usually required and should have the same value as the uri 
    152153                                } 
    153154                                { 
    154155                                        uri="rtmp://edge01.fms.dutchview.nl/botr/bunny", 
    155156                                        localStreamName="stream6", 
    156                                         swfUrl="http://www.example.com/example.swf"; 
    157                                         pageUrl="http://www.example.com/"; 
     157                                        swfUrl="http://www.example.com/example.swf", 
     158                                        pageUrl="http://www.example.com/", 
    158159                                        emulateUserAgent="MAC 10,1,82,76", 
     160                                        tcUrl="rtmp://edge01.fms.dutchview.nl/botr/bunny", --this one is usually required and should have the same value as the uri 
    159161                                } 
    160162                                ]]-- 
     
    314316                        randomAccessStreams=false 
    315317                }, 
    316                 { 
    317                         name="applestreamingclient", 
    318                         description="Apple Streaming Client", 
    319                         protocol="dynamiclinklibrary", 
    320                         --[[acceptors =  
    321                         { 
    322                                 { 
    323                                         ip="0.0.0.0", 
    324                                         port=5544, 
    325                                         protocol="inboundRtsp" 
    326                                 } 
    327                         },]]-- 
    328                         aliases= 
    329                         { 
    330                                 "asc", 
    331                         }, 
    332                         --validateHandshake=true, 
    333                         --default=true, 
    334                 }, 
    335318                --[[{ 
    336319                        name="vmapp", 
  • trunk/configs/flvplayback.lua

    r717 r730  
    8080                                        uri="rtmp://edge01.fms.dutchview.nl/botr/bunny", 
    8181                                        localStreamName="test1", 
     82                                        tcUrl="rtmp://edge01.fms.dutchview.nl/botr/bunny", --this one is usually required and should have the same value as the uri 
    8283                                }]]-- 
    8384                        }, 
  • trunk/sources/common/src/utils/misc/uri.cpp

    r723 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.