Changeset 87


Ignore:
Timestamp:
08/21/10 18:30:35 (18 months ago)
Author:
shiretu
Message:

-- work on android apple streaming
-- work on new SSL support

Location:
trunk
Files:
6 added
21 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/builders/androidapplestreaming/src/org/apache/android/media/VideoViewDemo.java

    r85 r87  
    144144            return; 
    145145 
    146         //url="http://10.0.2.7/~shiretu/jwp/m.m3u8"; 
    147         //String key="HdnAtffj8TSZvtTRryG5xcI78w8="; 
    148         //String sessId="playback=HTTP_CLOUD_WIRED&contentId=10804941&appAccountName=mlb&eventId=14-265607-2010-08-18&ipid=24061847&sessionKey=jhNOkzFU%2FvMTvsyP4b5l16a47W8%3D&country=us&postalCode=10292&platform=WEB_MEDIAPLAYER"; 
     146        url="http://10.0.2.1/~shiretu/jwp/m.m3u8"; 
     147        String key="mv/riCUfFPozkOrRbr5ddlSFozU="; 
     148        String sessId="playback=HTTP_CLOUD_WIRED&contentId=7320085&appAccountName=mlb&eventId=14-263849-2010-04-08&ipid=11627706&sessionKey=f8ZFssJ4sqRLYIU1VAXCxyvM5mc%3D"; 
    149149 
    150150        //url="http://mlbvod-akc.mlb.com/mlbam/2010/04/08/MLB_GAME_VIDEO_LANPIT_HOME_20100408/master_mobile.m3u8"; 
     
    152152        //String sessId="playback=HTTP_CLOUD_WIRED&contentId=7320085&appAccountName=mlb&eventId=14-263849-2010-04-08&ipid=11627706&sessionKey=GBncPsxRBV02IC9n80RP1Sdr9ew%3D"; 
    153153  
    154         url="http://mediadownloads.mlb.com/mlbam/2010/06/29/9505835_m3u8/128/dropf_9505835_100m_128K.m3u8"; 
    155         String key=""; 
    156         String sessId=""; 
     154        //url="http://mediadownloads.mlb.com/mlbam/2010/06/29/9505835_m3u8/128/dropf_9505835_100m_128K.m3u8"; 
     155        //String key=""; 
     156        //String sessId=""; 
     157 
     158        //url="http://mlbsegqa.mlb.com/mlbam/2010/08/17/MLB_GAME_VIDEO_DETNYA_HOME_20100817/master_mobile.m3u8"; 
     159        //String key="/AMhXX7vmDTcQrsJndNI/TEw+sM="; 
     160        //String sessId="playback=HTTP_CLOUD_MOBILE&contentId=10111969&appAccountName=mlb&eventId=14-265611-2010-08-18&ipid=11627706&sessionKey=f8ZFssJ4sqRLYIU1VAXCxyvM5mc%3D&deviceId=ANDROID_356698030670609&country=us&postalCode=10011&platform=ANDROID"; 
    157161 
    158162        Toast.makeText(getApplicationContext(), "Opening: " + url, Toast.LENGTH_LONG).show(); 
  • trunk/builders/netbeans/osx/applestreamingclient/nbproject/Makefile-Debug.mk

    r85 r87  
    4444        ${OBJECTDIR}/_ext/441423101/speedcomputer.o \ 
    4545        ${OBJECTDIR}/_ext/441423101/applestreamingclient.o \ 
     46        ${OBJECTDIR}/_ext/1568284858/jnihelpers.o \ 
    4647        ${OBJECTDIR}/_ext/413657679/masterm3u8protocol.o \ 
    4748        ${OBJECTDIR}/_ext/1372129895/keyappprotocolhandler.o \ 
     
    139140        $(COMPILE.cc) -g -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_VAR -DANDROID -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -I../../../../sources/applications/applestreamingclient/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/441423101/applestreamingclient.o ../../../../sources/applications/applestreamingclient/src/applestreamingclient.cpp 
    140141 
     142${OBJECTDIR}/_ext/1568284858/jnihelpers.o: ../../../../sources/applications/applestreamingclient/src/protocols/../jnihelpers.cpp  
     143        ${MKDIR} -p ${OBJECTDIR}/_ext/1568284858 
     144        ${RM} $@.d 
     145        $(COMPILE.cc) -g -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_VAR -DANDROID -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -I../../../../sources/applications/applestreamingclient/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1568284858/jnihelpers.o ../../../../sources/applications/applestreamingclient/src/protocols/../jnihelpers.cpp 
     146 
    141147${OBJECTDIR}/_ext/413657679/masterm3u8protocol.o: ../../../../sources/applications/applestreamingclient/src/protocols/m3u8/masterm3u8protocol.cpp  
    142148        ${MKDIR} -p ${OBJECTDIR}/_ext/413657679 
  • trunk/builders/netbeans/osx/applestreamingclient/nbproject/Makefile-Release.mk

    r85 r87  
    4444        ${OBJECTDIR}/_ext/441423101/speedcomputer.o \ 
    4545        ${OBJECTDIR}/_ext/441423101/applestreamingclient.o \ 
     46        ${OBJECTDIR}/_ext/1568284858/jnihelpers.o \ 
    4647        ${OBJECTDIR}/_ext/413657679/masterm3u8protocol.o \ 
    4748        ${OBJECTDIR}/_ext/1372129895/keyappprotocolhandler.o \ 
     
    139140        $(COMPILE.cc) -O2 -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_VAR -DANDROID -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -I../../../../sources/applications/applestreamingclient/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/441423101/applestreamingclient.o ../../../../sources/applications/applestreamingclient/src/applestreamingclient.cpp 
    140141 
     142${OBJECTDIR}/_ext/1568284858/jnihelpers.o: ../../../../sources/applications/applestreamingclient/src/protocols/../jnihelpers.cpp  
     143        ${MKDIR} -p ${OBJECTDIR}/_ext/1568284858 
     144        ${RM} $@.d 
     145        $(COMPILE.cc) -O2 -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_VAR -DANDROID -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -I../../../../sources/applications/applestreamingclient/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1568284858/jnihelpers.o ../../../../sources/applications/applestreamingclient/src/protocols/../jnihelpers.cpp 
     146 
    141147${OBJECTDIR}/_ext/413657679/masterm3u8protocol.o: ../../../../sources/applications/applestreamingclient/src/protocols/m3u8/masterm3u8protocol.cpp  
    142148        ${MKDIR} -p ${OBJECTDIR}/_ext/413657679 
  • trunk/builders/netbeans/osx/applestreamingclient/nbproject/configurations.xml

    r85 r87  
    109109      <itemPath>../../../../sources/applications/applestreamingclient/src/applestreamingclientapplication.cpp</itemPath> 
    110110      <itemPath>../../../../sources/applications/applestreamingclient/src/clientcontext.cpp</itemPath> 
     111      <itemPath>../../../../sources/applications/applestreamingclient/src/protocols/../jnihelpers.cpp</itemPath> 
    111112      <itemPath>../../../../sources/applications/applestreamingclient/src/playlist.cpp</itemPath> 
    112113      <itemPath>../../../../sources/applications/applestreamingclient/src/speedcomputer.cpp</itemPath> 
  • trunk/builders/netbeans/osx/thelib

    • Property svn:ignore set to
      .dep.inc
      build

  • trunk/builders/netbeans/osx/thelib/nbproject/Makefile-Debug.mk

    r77 r87  
    4343        ${OBJECTDIR}/_ext/772217591/inboundnamedpipecarrier.o \ 
    4444        ${OBJECTDIR}/_ext/1215912322/innetrtpstream.o \ 
    45         ${OBJECTDIR}/_ext/1919749812/sslprotocol.o \ 
    4645        ${OBJECTDIR}/_ext/517913122/pidtypes.o \ 
    4746        ${OBJECTDIR}/_ext/1210522057/atomctts.o \ 
     
    7776        ${OBJECTDIR}/_ext/501751224/inboundrtmpprotocol.o \ 
    7877        ${OBJECTDIR}/_ext/2021747320/somanager.o \ 
     78        ${OBJECTDIR}/_ext/1124563255/outboundsslprotocol.o \ 
    7979        ${OBJECTDIR}/_ext/501751224/basertmpappprotocolhandler.o \ 
    8080        ${OBJECTDIR}/_ext/501751224/inboundhttp4rtmp.o \ 
     
    9191        ${OBJECTDIR}/_ext/1054419429/inboundconnectivity.o \ 
    9292        ${OBJECTDIR}/_ext/1210522057/atommoov.o \ 
     93        ${OBJECTDIR}/_ext/1124563255/basesslprotocol.o \ 
    9394        ${OBJECTDIR}/_ext/31226533/innetrtmpstream.o \ 
    9495        ${OBJECTDIR}/_ext/373925503/baseclientapplication.o \ 
     
    179180        ${OBJECTDIR}/_ext/501751224/channel.o \ 
    180181        ${OBJECTDIR}/_ext/554535297/tcpacceptor.o \ 
     182        ${OBJECTDIR}/_ext/1124563255/inboundsslprotocol.o \ 
    181183        ${OBJECTDIR}/_ext/1636055853/streamsmanager.o \ 
    182184        ${OBJECTDIR}/_ext/1215912322/outnetrtpudph264stream.o \ 
     
    260262        $(COMPILE.cc) -g -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1215912322/innetrtpstream.o ../../../../sources/thelib/src/protocols/rtp/streaming/innetrtpstream.cpp 
    261263 
    262 ${OBJECTDIR}/_ext/1919749812/sslprotocol.o: ../../../../sources/thelib/src/protocols/sslprotocol.cpp  
    263         ${MKDIR} -p ${OBJECTDIR}/_ext/1919749812 
    264         ${RM} $@.d 
    265         $(COMPILE.cc) -g -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1919749812/sslprotocol.o ../../../../sources/thelib/src/protocols/sslprotocol.cpp 
    266  
    267264${OBJECTDIR}/_ext/517913122/pidtypes.o: ../../../../sources/thelib/src/protocols/ts/pidtypes.cpp  
    268265        ${MKDIR} -p ${OBJECTDIR}/_ext/517913122 
     
    430427        $(COMPILE.cc) -g -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/2021747320/somanager.o ../../../../sources/thelib/src/protocols/rtmp/sharedobjects/somanager.cpp 
    431428 
     429${OBJECTDIR}/_ext/1124563255/outboundsslprotocol.o: ../../../../sources/thelib/src/protocols/ssl/outboundsslprotocol.cpp  
     430        ${MKDIR} -p ${OBJECTDIR}/_ext/1124563255 
     431        ${RM} $@.d 
     432        $(COMPILE.cc) -g -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1124563255/outboundsslprotocol.o ../../../../sources/thelib/src/protocols/ssl/outboundsslprotocol.cpp 
     433 
    432434${OBJECTDIR}/_ext/501751224/basertmpappprotocolhandler.o: ../../../../sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp  
    433435        ${MKDIR} -p ${OBJECTDIR}/_ext/501751224 
     
    500502        $(COMPILE.cc) -g -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1210522057/atommoov.o ../../../../sources/thelib/src/mediaformats/mp4/atommoov.cpp 
    501503 
     504${OBJECTDIR}/_ext/1124563255/basesslprotocol.o: ../../../../sources/thelib/src/protocols/ssl/basesslprotocol.cpp  
     505        ${MKDIR} -p ${OBJECTDIR}/_ext/1124563255 
     506        ${RM} $@.d 
     507        $(COMPILE.cc) -g -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1124563255/basesslprotocol.o ../../../../sources/thelib/src/protocols/ssl/basesslprotocol.cpp 
     508 
    502509${OBJECTDIR}/_ext/31226533/innetrtmpstream.o: ../../../../sources/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp  
    503510        ${MKDIR} -p ${OBJECTDIR}/_ext/31226533 
     
    939946        ${RM} $@.d 
    940947        $(COMPILE.cc) -g -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/554535297/tcpacceptor.o ../../../../sources/thelib/src/netio/kqueue/tcpacceptor.cpp 
     948 
     949${OBJECTDIR}/_ext/1124563255/inboundsslprotocol.o: ../../../../sources/thelib/src/protocols/ssl/inboundsslprotocol.cpp  
     950        ${MKDIR} -p ${OBJECTDIR}/_ext/1124563255 
     951        ${RM} $@.d 
     952        $(COMPILE.cc) -g -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1124563255/inboundsslprotocol.o ../../../../sources/thelib/src/protocols/ssl/inboundsslprotocol.cpp 
    941953 
    942954${OBJECTDIR}/_ext/1636055853/streamsmanager.o: ../../../../sources/thelib/src/streaming/streamsmanager.cpp  
  • trunk/builders/netbeans/osx/thelib/nbproject/Makefile-Release.mk

    r77 r87  
    4343        ${OBJECTDIR}/_ext/772217591/inboundnamedpipecarrier.o \ 
    4444        ${OBJECTDIR}/_ext/1215912322/innetrtpstream.o \ 
    45         ${OBJECTDIR}/_ext/1919749812/sslprotocol.o \ 
    4645        ${OBJECTDIR}/_ext/517913122/pidtypes.o \ 
    4746        ${OBJECTDIR}/_ext/1210522057/atomctts.o \ 
     
    7776        ${OBJECTDIR}/_ext/501751224/inboundrtmpprotocol.o \ 
    7877        ${OBJECTDIR}/_ext/2021747320/somanager.o \ 
     78        ${OBJECTDIR}/_ext/1124563255/outboundsslprotocol.o \ 
    7979        ${OBJECTDIR}/_ext/501751224/basertmpappprotocolhandler.o \ 
    8080        ${OBJECTDIR}/_ext/501751224/inboundhttp4rtmp.o \ 
     
    9191        ${OBJECTDIR}/_ext/1054419429/inboundconnectivity.o \ 
    9292        ${OBJECTDIR}/_ext/1210522057/atommoov.o \ 
     93        ${OBJECTDIR}/_ext/1124563255/basesslprotocol.o \ 
    9394        ${OBJECTDIR}/_ext/31226533/innetrtmpstream.o \ 
    9495        ${OBJECTDIR}/_ext/373925503/baseclientapplication.o \ 
     
    179180        ${OBJECTDIR}/_ext/501751224/channel.o \ 
    180181        ${OBJECTDIR}/_ext/554535297/tcpacceptor.o \ 
     182        ${OBJECTDIR}/_ext/1124563255/inboundsslprotocol.o \ 
    181183        ${OBJECTDIR}/_ext/1636055853/streamsmanager.o \ 
    182184        ${OBJECTDIR}/_ext/1215912322/outnetrtpudph264stream.o \ 
     
    260262        $(COMPILE.cc) -O2 -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1215912322/innetrtpstream.o ../../../../sources/thelib/src/protocols/rtp/streaming/innetrtpstream.cpp 
    261263 
    262 ${OBJECTDIR}/_ext/1919749812/sslprotocol.o: ../../../../sources/thelib/src/protocols/sslprotocol.cpp  
    263         ${MKDIR} -p ${OBJECTDIR}/_ext/1919749812 
    264         ${RM} $@.d 
    265         $(COMPILE.cc) -O2 -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1919749812/sslprotocol.o ../../../../sources/thelib/src/protocols/sslprotocol.cpp 
    266  
    267264${OBJECTDIR}/_ext/517913122/pidtypes.o: ../../../../sources/thelib/src/protocols/ts/pidtypes.cpp  
    268265        ${MKDIR} -p ${OBJECTDIR}/_ext/517913122 
     
    430427        $(COMPILE.cc) -O2 -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/2021747320/somanager.o ../../../../sources/thelib/src/protocols/rtmp/sharedobjects/somanager.cpp 
    431428 
     429${OBJECTDIR}/_ext/1124563255/outboundsslprotocol.o: ../../../../sources/thelib/src/protocols/ssl/outboundsslprotocol.cpp  
     430        ${MKDIR} -p ${OBJECTDIR}/_ext/1124563255 
     431        ${RM} $@.d 
     432        $(COMPILE.cc) -O2 -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1124563255/outboundsslprotocol.o ../../../../sources/thelib/src/protocols/ssl/outboundsslprotocol.cpp 
     433 
    432434${OBJECTDIR}/_ext/501751224/basertmpappprotocolhandler.o: ../../../../sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp  
    433435        ${MKDIR} -p ${OBJECTDIR}/_ext/501751224 
     
    500502        $(COMPILE.cc) -O2 -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1210522057/atommoov.o ../../../../sources/thelib/src/mediaformats/mp4/atommoov.cpp 
    501503 
     504${OBJECTDIR}/_ext/1124563255/basesslprotocol.o: ../../../../sources/thelib/src/protocols/ssl/basesslprotocol.cpp  
     505        ${MKDIR} -p ${OBJECTDIR}/_ext/1124563255 
     506        ${RM} $@.d 
     507        $(COMPILE.cc) -O2 -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1124563255/basesslprotocol.o ../../../../sources/thelib/src/protocols/ssl/basesslprotocol.cpp 
     508 
    502509${OBJECTDIR}/_ext/31226533/innetrtmpstream.o: ../../../../sources/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp  
    503510        ${MKDIR} -p ${OBJECTDIR}/_ext/31226533 
     
    939946        ${RM} $@.d 
    940947        $(COMPILE.cc) -O2 -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/554535297/tcpacceptor.o ../../../../sources/thelib/src/netio/kqueue/tcpacceptor.cpp 
     948 
     949${OBJECTDIR}/_ext/1124563255/inboundsslprotocol.o: ../../../../sources/thelib/src/protocols/ssl/inboundsslprotocol.cpp  
     950        ${MKDIR} -p ${OBJECTDIR}/_ext/1124563255 
     951        ${RM} $@.d 
     952        $(COMPILE.cc) -O2 -DOSX -DNET_KQUEUE -DLITTLE_ENDIAN_BYTE_ALIGNED -DHAS_PROTOCOL_RTMP -DHAS_PROTOCOL_HTTP -DHAS_PROTOCOL_TS -DHAS_PROTOCOL_RTP -DHAS_PROTOCOL_VAR -DHAS_PROTOCOL_LIVEFLV -DHAS_MEDIA_MP4 -DHAS_MEDIA_MP3 -DHAS_MEDIA_FLV -I/opt/local/include -I../../../../sources/common/include -I../../../../sources/thelib/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1124563255/inboundsslprotocol.o ../../../../sources/thelib/src/protocols/ssl/inboundsslprotocol.cpp 
    941953 
    942954${OBJECTDIR}/_ext/1636055853/streamsmanager.o: ../../../../sources/thelib/src/streaming/streamsmanager.cpp  
  • trunk/builders/netbeans/osx/thelib/nbproject/configurations.xml

    r77 r87  
    190190          <itemPath>../../../../sources/thelib/include/protocols/rtp/sdp.h</itemPath> 
    191191        </logicalFolder> 
     192        <logicalFolder name="ssl" displayName="ssl" projectFiles="true"> 
     193          <itemPath>../../../../sources/thelib/include/protocols/ssl/basesslprotocol.h</itemPath> 
     194          <itemPath>../../../../sources/thelib/include/protocols/ssl/inboundsslprotocol.h</itemPath> 
     195          <itemPath>../../../../sources/thelib/include/protocols/ssl/outboundsslprotocol.h</itemPath> 
     196        </logicalFolder> 
    192197        <logicalFolder name="timer" displayName="timer" projectFiles="true"> 
    193198          <itemPath>../../../../sources/thelib/include/protocols/timer/basetimerprotocol.h</itemPath> 
     
    217222        <itemPath>../../../../sources/thelib/include/protocols/protocolmanager.h</itemPath> 
    218223        <itemPath>../../../../sources/thelib/include/protocols/protocoltypes.h</itemPath> 
    219         <itemPath>../../../../sources/thelib/include/protocols/sslprotocol.h</itemPath> 
    220224        <itemPath>../../../../sources/thelib/include/protocols/tcpprotocol.h</itemPath> 
    221225        <itemPath>../../../../sources/thelib/include/protocols/udpprotocol.h</itemPath> 
     
    235239        <itemPath>../../../../sources/thelib/include/streaming/streamstypes.h</itemPath> 
    236240      </logicalFolder> 
    237       <itemPath>../../../../sources/thelib/include/thelibglobalcontext.h</itemPath> 
    238241    </logicalFolder> 
    239242    <logicalFolder name="SourceFiles" 
     
    413416          <itemPath>../../../../sources/thelib/src/protocols/rtp/sdp.cpp</itemPath> 
    414417        </logicalFolder> 
     418        <logicalFolder name="ssl" displayName="ssl" projectFiles="true"> 
     419          <itemPath>../../../../sources/thelib/src/protocols/ssl/basesslprotocol.cpp</itemPath> 
     420          <itemPath>../../../../sources/thelib/src/protocols/ssl/inboundsslprotocol.cpp</itemPath> 
     421          <itemPath>../../../../sources/thelib/src/protocols/ssl/outboundsslprotocol.cpp</itemPath> 
     422        </logicalFolder> 
    415423        <logicalFolder name="timer" displayName="timer" projectFiles="true"> 
    416424          <itemPath>../../../../sources/thelib/src/protocols/timer/basetimerprotocol.cpp</itemPath> 
     
    438446        <itemPath>../../../../sources/thelib/src/protocols/protocolfactorymanager.cpp</itemPath> 
    439447        <itemPath>../../../../sources/thelib/src/protocols/protocolmanager.cpp</itemPath> 
    440         <itemPath>../../../../sources/thelib/src/protocols/sslprotocol.cpp</itemPath> 
    441448        <itemPath>../../../../sources/thelib/src/protocols/tcpprotocol.cpp</itemPath> 
    442449        <itemPath>../../../../sources/thelib/src/protocols/udpprotocol.cpp</itemPath> 
  • trunk/sources/androidapplestreaming/include/api.h

    r85 r87  
    2424#include "jniwrapper.h" 
    2525 
     26#ifdef ANDROID 
    2627void EnvRun(string ip, uint16_t port, CallBackInfo ci); 
     28#else 
     29void EnvRun(string ip, uint16_t port); 
     30#endif /* ANDROID */ 
    2731void EnvStop(); 
    2832 
  • trunk/sources/androidapplestreaming/include/jniwrapper.h

    r85 r87  
    1818 */ 
    1919 
     20#ifdef ANDROID 
    2021#ifndef _JNIWRAPPER_H 
    2122#define _JNIWRAPPER_H 
     
    4950 
    5051#endif  /* _JNIWRAPPER_H */ 
    51  
     52#endif /* ANDROID */ 
  • trunk/sources/androidapplestreaming/src/api.cpp

    r85 r87  
    4444}while(0) 
    4545 
    46 void EnvRun(string ip, uint16_t port, CallBackInfo ci) { 
     46#ifdef ANDROID 
     47void EnvRun(string ip, uint16_t port, CallBackInfo ci) 
     48#else 
     49 
     50void EnvRun(string ip, uint16_t port) 
     51#endif /* ANDROID */ 
     52{ 
    4753        //1. Initialize the logger 
    4854        Logger::Init(); 
     
    7884        AppleStreamingClientApplication *pApp = new AppleStreamingClientApplication( 
    7985                        configuration); 
     86#ifdef ANDROID 
    8087        pApp->SetJavaCallBackInterface(ci); 
     88#endif /* ANDROID */ 
    8189        if (!pApp->Initialize()) { 
    8290                ASSERT("Unable to initialize the application"); 
  • trunk/sources/androidapplestreaming/src/main.cpp

    r85 r87  
    4848 
    4949void* worker(void *) { 
     50#ifdef ANDROID 
    5051        CallBackInfo ci; 
    51         EnvRun("0.0.0.0", 5544, ci); 
     52        EnvRun("0.0.0.0", 554, ci); 
     53#else 
     54        EnvRun("0.0.0.0", 554); 
     55#endif /* ANDROID */ 
    5256        return NULL; 
    5357} 
     
    8892//#define MY_KEY "ugkuOk9Qy4HNS5uRxQcQXHfLuAI=" 
    8993 
     94#define MY_URL "http://mlbsegqa.mlb.com/mlbam/2010/08/17/MLB_GAME_VIDEO_DETNYA_HOME_20100817/master_mobile.m3u8" 
     95#define MY_SESSION_ID "playback=HTTP_CLOUD_WIRED&contentId=7320085&appAccountName=mlb&eventId=14-263849-2010-04-08&ipid=11627706&sessionKey=vlPZfM8Rj1TaGDmMrtDSQh1MIWc%3D" 
     96#define MY_KEY "Q8TZUMmOkyVgVSMotTCRMQ==" 
     97 
    9098//#define CONDENSED_CONN_STRING "base64:aHR0cDovL21sYnZvZC1ha2MubWxiLmNvbS9tbGJhbS8yMDEwLzA0LzA4L01MQl9HQU1FX1ZJREVPX0xBTlBJVF9IT01FXzIwMTAwNDA4L21hc3Rlcl93aXJlZC5tM3U4fHlNQmVFcEl6OEJEaUFYV0k0dUdIUm1UaHdIRT18cGxheWJhY2s9SFRUUF9DTE9VRF9XSVJFRCZjb250ZW50SWQ9NzMyMDA4NSZhcHBBY2NvdW50TmFtZT1tbGImZXZlbnRJZD0xNC0yNjM4NDktMjAxMC0wNC0wOCZpcGlkPTExNjI3NzA2JnNlc3Npb25LZXk9cUNveGRIaUlOY3FDbHlEcEZoU2dma3dJSWc0JTNE" 
    91 #define CONDENSED_CONN_STRING "aHR0cDovL21sYnZvZC1ha2MubWxiLmNvbS9tbGJhbS8yMDEwLzA0LzA4L01MQl9HQU1FX1ZJREVPX0xBTlBJVF9IT01FXzIwMTAwNDA4L21hc3Rlcl93aXJlZC5tM3U4fGJsOEQyRUFTRUY4V1VyeloreTNvME5pUXlBaz18cGxheWJhY2s9SFRUUF9DTE9VRF9XSVJFRCZjb250ZW50SWQ9NzMyMDA4NSZhcHBBY2NvdW50TmFtZT1tbGImZXZlbnRJZD0xNC0yNjM4NDktMjAxMC0wNC0wOCZpcGlkPTExNjI3NzA2JnNlc3Npb25LZXk9R0JuY1BzeFJCVjAySUM5bjgwUlAxU2RyOWV3JTNE" 
     99//#define CONDENSED_CONN_STRING "aHR0cDovL21sYnZvZC1ha2MubWxiLmNvbS9tbGJhbS8yMDEwLzA0LzA4L01MQl9HQU1FX1ZJREVPX0xBTlBJVF9IT01FXzIwMTAwNDA4L21hc3Rlcl93aXJlZC5tM3U4fGJsOEQyRUFTRUY4V1VyeloreTNvME5pUXlBaz18cGxheWJhY2s9SFRUUF9DTE9VRF9XSVJFRCZjb250ZW50SWQ9NzMyMDA4NSZhcHBBY2NvdW50TmFtZT1tbGImZXZlbnRJZD0xNC0yNjM4NDktMjAxMC0wNC0wOCZpcGlkPTExNjI3NzA2JnNlc3Npb25LZXk9R0JuY1BzeFJCVjAySUM5bjgwUlAxU2RyOWV3JTNE" 
    92100 
    93101void testCommands() { 
     
    96104 
    97105        uint32_t contextId = (uint32_t) ASC_RES_PARAM(result, "contextId"); 
    98         //      result = CommandPlay(contextId, MY_URL, MY_SESSION_ID, MY_KEY); 
     106        result = CommandPlay(contextId, MY_URL, MY_SESSION_ID, MY_KEY); 
     107        FINEST("result:\n%s", STR(result.ToString())); 
     108        //      result = CommandPlay(contextId, CONDENSED_CONN_STRING); 
    99109        //      FINEST("result:\n%s", STR(result.ToString())); 
    100         result = CommandPlay(contextId, CONDENSED_CONN_STRING); 
    101         FINEST("result:\n%s", STR(result.ToString())); 
    102110 
    103         for (;;) { 
    104                 result = InfoBandwidth(contextId); 
    105                 FINEST("InfoBandwidth:\n%s", STR(result.ToString())); 
    106                 //              result = InfoPlayback(contextId); 
    107                 //              FINEST("InfoBandwidth:\n%s", STR(result.ToString())); 
    108                 sleep(1); 
    109         } 
     111        //      for (;;) { 
     112        //              result = InfoBandwidth(contextId); 
     113        //              FINEST("InfoBandwidth:\n%s", STR(result.ToString())); 
     114        //              //              result = InfoPlayback(contextId); 
     115        //              //              FINEST("InfoBandwidth:\n%s", STR(result.ToString())); 
     116        //              sleep(1); 
     117        //      } 
    110118 
    111119        //      sleep(5); 
  • trunk/sources/applications/applestreamingclient/src/applestreamingclientapplication.cpp

    r85 r87  
    165165} 
    166166 
     167#ifdef ANDROID 
    167168void AppleStreamingClientApplication::SetJavaCallBackInterface(CallBackInfo ci) { 
    168169        _ci.pEnv = ci.pEnv; 
     
    175176        return _ci; 
    176177} 
     178#endif /* ANDROID */ 
    177179 
    178180void AppleStreamingClientApplication::SignalStreamRegistered(BaseStream *pStream) { 
  • trunk/sources/applications/applestreamingclient/src/clientcontext.cpp

    r85 r87  
    230230        pScheduleTimer->AddJob(job, true); 
    231231 
    232         job["type"] = "testJNICallback"; 
    233         pScheduleTimer->AddJob(job, true); 
     232        //      job["type"] = "testJNICallback"; 
     233        //      pScheduleTimer->AddJob(job, true); 
    234234 
    235235        //6. Start the master M3U8 fetching 
     
    640640        } 
    641641 
     642        if ((uri[4] == 'S') || (uri[4] == 's')) { 
     643 
     644                FOR_VECTOR_ITERATOR(uint64_t, protocolStackTypes, i) { 
     645                        if (VECTOR_VAL(i) == PT_INBOUND_HTTP) { 
     646                                protocolStackTypes.insert(i, PT_INBOUND_SSL); 
     647                                break; 
     648                        } else if (VECTOR_VAL(i) == PT_OUTBOUND_HTTP) { 
     649                                protocolStackTypes.insert(i, PT_OUTBOUND_SSL); 
     650                                break; 
     651                        } 
     652                } 
     653        } 
     654 
    642655        //3. Prepare the HTTP info 
    643656        Variant parameters; 
  • trunk/sources/thelib/include/protocols/protocoltypes.h

    r58 r87  
    11/*  
    2 *  Copyright (c) 2010, 
    3 *  Gavriloaie Eugen-Andrei (shiretu@gmail.com) 
    4  
    5 *  This file is part of crtmpserver. 
    6 *  crtmpserver is free software: you can redistribute it and/or modify 
    7 *  it under the terms of the GNU General Public License as published by 
    8 *  the Free Software Foundation, either version 3 of the License, or 
    9 *  (at your option) any later version. 
    10  
    11 *  crtmpserver is distributed in the hope that it will be useful, 
    12 *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    14 *  GNU General Public License for more details. 
    15  
    16 *  You should have received a copy of the GNU General Public License 
    17 *  along with crtmpserver.  If not, see <http://www.gnu.org/licenses/>. 
    18 */ 
     2 *  Copyright (c) 2010, 
     3 *  Gavriloaie Eugen-Andrei (shiretu@gmail.com) 
     4 * 
     5 *  This file is part of crtmpserver. 
     6 *  crtmpserver is free software: you can redistribute it and/or modify 
     7 *  it under the terms of the GNU General Public License as published by 
     8 *  the Free Software Foundation, either version 3 of the License, or 
     9 *  (at your option) any later version. 
     10 * 
     11 *  crtmpserver is distributed in the hope that it will be useful, 
     12 *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
     13 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     14 *  GNU General Public License for more details. 
     15 * 
     16 *  You should have received a copy of the GNU General Public License 
     17 *  along with crtmpserver.  If not, see <http://www.gnu.org/licenses/>. 
     18 */ 
    1919 
    2020 
     
    3434//RTMP protocols 
    3535#define PT_INBOUND_RTMP                 MAKE_TAG2('I','R') 
    36 #define PT_OUTBOUND_RTMP                        MAKE_TAG2('O','R') 
     36#define PT_OUTBOUND_RTMP                MAKE_TAG2('O','R') 
    3737#define PT_MONITOR_RTMP                 MAKE_TAG2('M','R') 
    3838 
    3939//encryption protocols 
    4040#define PT_RTMPE                                MAKE_TAG2('R','E') 
    41 #define PT_SSL                                  MAKE_TAG3('S','S','L') 
     41#define PT_INBOUND_SSL                  MAKE_TAG4('I','S','S','L') 
     42#define PT_OUTBOUND_SSL                 MAKE_TAG4('O','S','S','L') 
    4243 
    4344//Async DNS protocols 
     
    4950 
    5051//HTTP protocols 
    51 #define PT_INBOUND_HTTP                 MAKE_TAG4('I','H','T','T') 
    52 #define PT_INBOUND_HTTP_FOR_RTMP                MAKE_TAG4('I','H','4','R') 
     52#define PT_INBOUND_HTTP                         MAKE_TAG4('I','H','T','T') 
     53#define PT_INBOUND_HTTP_FOR_RTMP        MAKE_TAG4('I','H','4','R') 
    5354#define PT_OUTBOUND_HTTP                        MAKE_TAG4('O','H','T','T') 
    5455#define PT_OUTBOUND_HTTP_FOR_RTMP       MAKE_TAG4('O','H','4','R') 
  • trunk/sources/thelib/include/protocols/rtp/connectivity/outboundconnectivity.h

    r49 r87  
    8484        bool FeedAudioDataUDP(msghdr &message); 
    8585        bool FeedAudioDataTCP(msghdr &message); 
     86        bool CreateRTCPPacket(uint8_t *pDest, uint8_t *pSrc, 
     87                        uint32_t ssrc, uint32_t rate, uint32_t packetsCount, 
     88                        uint32_t bytesCount, bool isAudio); 
    8689}; 
    8790 
  • trunk/sources/thelib/include/protocols/ssl/basesslprotocol.h

    r56 r87  
    2424#include "protocols/baseprotocol.h" 
    2525 
    26 class SSLProtocol 
     26class BaseSSLProtocol 
    2727: public BaseProtocol { 
    2828private: 
     29        IOBuffer _inputBuffer; 
     30        IOBuffer _outputBuffer; 
     31protected: 
    2932        static map<string, SSL_CTX *> _pGlobalContexts; 
    3033        static bool _libraryInitialized; 
    31         SSL_CTX *_pGlobalSSLContext1; 
     34        SSL_CTX *_pGlobalSSLContext; 
    3235        SSL *_pSSL; 
    33         IOBuffer _inputBuffer; 
    34         IOBuffer _outputBuffer; 
     36        bool _sslHandshakeCompleted; 
    3537        uint8_t *_pReadBuffer; 
    3638public: 
    37         SSLProtocol(); 
    38         virtual ~SSLProtocol(); 
     39        BaseSSLProtocol(uint64_t type); 
     40        virtual ~BaseSSLProtocol(); 
    3941        virtual bool Initialize(Variant &parameters); 
    4042        virtual bool AllowFarProtocol(uint64_t type); 
     
    4547        virtual bool SignalInputData(int32_t recvAmount); 
    4648        virtual bool SignalInputData(IOBuffer &buffer); 
     49protected: 
     50        virtual bool DoHandshake() = 0; 
     51        virtual bool InitGlobalContext(Variant &parameters) = 0; 
     52        bool PerformIO(); 
     53        string GetSSLErrors(); 
    4754private: 
    4855        string DumpBIO(BIO *pBIO); 
    49         string GetSSLErrors(); 
    5056        void InitRandGenerator(); 
    51         bool PerformIO(); 
    5257}; 
    5358 
  • trunk/sources/thelib/src/protocols/defaultprotocolfactory.cpp

    r56 r87  
    2323#include "protocols/rtmp/inboundrtmpprotocol.h" 
    2424#include "protocols/rtmp/outboundrtmpprotocol.h" 
    25 #include "protocols/sslprotocol.h" 
     25#include "protocols/ssl/inboundsslprotocol.h" 
     26#include "protocols/ssl/outboundsslprotocol.h" 
    2627#include "protocols/dns/inbounddnsresolverprotocol.h" 
    2728#include "protocols/dns/outbounddnsresolverprotocol.h" 
     
    5152        ADD_VECTOR_END(result, PT_TCP); 
    5253        ADD_VECTOR_END(result, PT_UDP); 
    53         ADD_VECTOR_END(result, PT_SSL); 
     54        ADD_VECTOR_END(result, PT_INBOUND_SSL); 
     55        ADD_VECTOR_END(result, PT_OUTBOUND_SSL); 
    5456        ADD_VECTOR_END(result, PT_INBOUND_DNS); 
    5557        ADD_VECTOR_END(result, PT_OUTBOUND_DNS); 
     
    156158        else if (name == CONF_PROTOCOL_INBOUND_RTMPS) { 
    157159                ADD_VECTOR_END(result, PT_TCP); 
    158                 ADD_VECTOR_END(result, PT_SSL); 
     160                ADD_VECTOR_END(result, PT_INBOUND_SSL); 
    159161                ADD_VECTOR_END(result, PT_INBOUND_HTTP); 
    160162                ADD_VECTOR_END(result, PT_INBOUND_HTTP_FOR_RTMP); 
     
    256258                        pResult = new UDPProtocol(); 
    257259                        break; 
    258                 case PT_SSL: 
    259                         pResult = new SSLProtocol(); 
     260                case PT_INBOUND_SSL: 
     261                        pResult = new InboundSSLProtocol(); 
     262                        break; 
     263                case PT_OUTBOUND_SSL: 
     264                        pResult = new OutboundSSLProtocol(); 
    260265                        break; 
    261266                case PT_INBOUND_DNS: 
  • trunk/sources/thelib/src/protocols/http/basehttpprotocol.cpp

    r56 r87  
    5858bool BaseHTTPProtocol::AllowFarProtocol(uint64_t type) { 
    5959        return type == PT_TCP 
    60                         || type == PT_SSL; 
     60                        || type == PT_INBOUND_SSL 
     61                        || type == PT_OUTBOUND_SSL; 
    6162} 
    6263 
  • trunk/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp

    r56 r87  
    118118        if (type == PT_TCP 
    119119                        || type == PT_RTMPE 
    120                         || type == PT_SSL 
     120                        || type == PT_INBOUND_SSL 
    121121                        || type == PT_INBOUND_HTTP_FOR_RTMP) 
    122122                return true; 
  • trunk/sources/thelib/src/protocols/rtp/connectivity/outboundconnectivity.cpp

    r49 r87  
    305305        //uint16_t seq = ntohsp(((uint8_t *) message.msg_iov[0].iov_base) + 2); 
    306306        //FINEST("seq: %d", seq); 
    307         if ((_videoPacketsCount % 300) == 0) { 
    308                 /* 
    309                  0                   1                   2                   3 
    310                  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
    311                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    312                 |V=2|P|    RC   |   PT=SR=200   |             length            | header 
    313                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    314                 |                         SSRC of sender                        | 
    315                 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 
    316                 |              NTP timestamp, most significant word             | sender 
    317                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ info 
    318                 |             NTP timestamp, least significant word             | 
    319                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    320                 |                         RTP timestamp                         | 
    321                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    322                 |                     sender's packet count                     | 
    323                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    324                 |                      sender's octet count                     | 
    325                 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 
    326                  */ 
    327  
    328                 WARN("Video: MUST send SR to %d clients", _udpVideoRTCPClients.size()); 
     307        if (((_videoPacketsCount % 300) == 0) || _videoPacketsCount == 1) { 
    329308                uint8_t buff[28]; 
    330                 buff[0] = 0x80; //V,P,RC 
    331                 buff[1] = 0xc8; //PT 
    332                 buff[2] = 0x00; //length 
    333                 buff[3] = 0x06; //length 
    334                 uint32_t ssrc = _pOutStream->SSRC(); 
    335                 put_htonl(buff + 4, ssrc); //SSRC 
    336                 uint64_t ntp; 
    337                 GETNTP(ntp); 
    338                 put_htonll(buff + 8, ntp); //NTP 
    339                 double rtpDouble; 
    340                 GETCLOCKS(rtpDouble); 
    341                 //              ASSERT("_pOutStream->GetCapabilities()->audioCodecInfo.aac.sampleRate: %d", 
    342                 //                              _pOutStream->GetCapabilities()->audioCodecInfo.aac.sampleRate); 
    343                 put_htonl(buff + 16, (uint32_t) (rtpDouble / CLOCKS_PER_SEC) 
    344                                 * _pOutStream->GetCapabilities()->audioCodecInfo.aac.sampleRate); //RTP ts 
    345                 put_htonl(buff + 20, _videoPacketsCount); //sender's packet count 
    346                 put_htonl(buff + 24, _videoBytesCount); //sender's octet count 
    347  
     309                CreateRTCPPacket(buff, 
     310                                (uint8_t *) message.msg_iov[0].iov_base, 
     311                                _pOutStream->SSRC(), 
     312                                90000, 
     313                                _videoPacketsCount, 
     314                                _videoBytesCount, 
     315                                false); 
    348316                _message.msg_iov[0].iov_base = buff; 
    349317                _message.msg_iov[0].iov_len = 28; 
     
    365333        //uint16_t seq = ntohsp(((uint8_t *) message.msg_iov[0].iov_base) + 2); 
    366334        //FINEST("seq: %d", seq); 
    367         if ((_audioPacketsCount % 300) == 0) { 
    368                 /* 
    369                  0                   1                   2                   3 
    370                  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
    371                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    372                 |V=2|P|    RC   |   PT=SR=200   |             length            | header 
    373                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    374                 |                         SSRC of sender                        | 
    375                 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 
    376                 |              NTP timestamp, most significant word             | sender 
    377                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ info 
    378                 |             NTP timestamp, least significant word             | 
    379                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    380                 |                         RTP timestamp                         | 
    381                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    382                 |                     sender's packet count                     | 
    383                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    384                 |                      sender's octet count                     | 
    385                 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 
    386                  */ 
    387  
    388                 WARN("Audio: MUST send SR to %d clients", _udpAudioRTCPClients.size()); 
     335        if (((_audioPacketsCount % 300) == 0) || (_audioPacketsCount == 1)) { 
    389336                uint8_t buff[28]; 
    390                 buff[0] = 0x80; //V,P,RC 
    391                 buff[1] = 0xc8; //PT 
    392                 buff[2] = 0x00; //length 
    393                 buff[3] = 0x06; //length 
    394                 uint32_t ssrc = _pOutStream->SSRC(); 
    395                 put_htonl(buff + 4, ssrc); //SSRC 
    396                 uint64_t ntp; 
    397                 GETNTP(ntp); 
    398                 put_htonll(buff + 8, ntp); //NTP 
    399                 double rtpDouble; 
    400                 GETCLOCKS(rtpDouble); 
    401                 put_htonl(buff + 16, (uint32_t) (rtpDouble / CLOCKS_PER_SEC)*1000 * 90); //RTP ts 
    402                 put_htonl(buff + 20, _audioPacketsCount); //sender's packet count 
    403                 put_htonl(buff + 24, _audioBytesCount); //sender's octet count 
    404  
     337                CreateRTCPPacket(buff, 
     338                                (uint8_t *) message.msg_iov[0].iov_base, 
     339                                _pOutStream->SSRC(), 
     340                                _pOutStream->GetCapabilities()->audioCodecInfo.aac.sampleRate, 
     341                                _audioPacketsCount, 
     342                                _audioBytesCount, 
     343                                true); 
    405344                _message.msg_iov[0].iov_base = buff; 
    406345                _message.msg_iov[0].iov_len = 28; 
     
    415354        return true; 
    416355} 
     356 
     357bool OutboundConnectivity::CreateRTCPPacket(uint8_t *pDest, uint8_t *pSrc, 
     358                uint32_t ssrc, uint32_t rate, uint32_t packetsCount, uint32_t bytesCount, 
     359                bool isAudio) { 
     360 
     361        /* 
     362         0                   1                   2                   3 
     363         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
     364        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
     365        |V=2|P|    RC   |   PT=SR=200   |             length            | header 
     366        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
     367        |                         SSRC of sender                        | 
     368        +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 
     369        |              NTP timestamp, most significant word             | sender 
     370        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ info 
     371        |             NTP timestamp, least significant word             | 
     372        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
     373        |                         RTP timestamp                         | 
     374        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
     375        |                     sender's packet count                     | 
     376        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
     377        |                      sender's octet count                     | 
     378        +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 
     379         */ 
     380 
     381        //      WARN("%s: MUST send SR to %d clients", 
     382        //                      isAudio ? "Audio" : "Video", 
     383        //                      _udpVideoRTCPClients.size()); 
     384 
     385        //1. V,P,RC 
     386        pDest[0] = 0x80; 
     387 
     388        //2. PT 
     389        pDest[1] = 0xc8; 
     390 
     391        //3. Length 
     392        pDest[2] = 0x00; 
     393        pDest[3] = 0x06; 
     394 
     395        //4. ssrc 
     396        put_htonl(pDest + 4, ssrc); //SSRC 
     397 
     398        //5. NTP 
     399        uint64_t ntp; 
     400        //GETCUSTOMNTP(ntp, (ntohlp(pSrc + 4) / rate)*1000); 
     401        GETNTP(ntp); 
     402        put_htonll(pDest + 8, ntp); 
     403 
     404        //6. RTP 
     405        memcpy(pDest + 16, pSrc + 4, 4); 
     406 
     407        //7. sender's packet count 
     408        put_htonl(pDest + 20, packetsCount); 
     409 
     410        //8. sender's octet count 
     411        put_htonl(pDest + 24, bytesCount); 
     412 
     413        return true; 
     414} 
     415 
    417416#endif /* HAS_PROTOCOL_RTP */ 
  • trunk/sources/thelib/src/protocols/ssl/basesslprotocol.cpp

    r56 r87  
    1818 */ 
    1919 
    20 #include "protocols/sslprotocol.h" 
    21  
    22 #define MAX_SSL_READ_BUFFER 8192 
    23  
    24 map<string, SSL_CTX *> SSLProtocol::_pGlobalContexts; 
    25 bool SSLProtocol::_libraryInitialized = false; 
    26  
    27 SSLProtocol::SSLProtocol() 
    28 : BaseProtocol(PT_SSL) { 
    29         _pGlobalSSLContext1 = NULL; 
     20#include "protocols/ssl/basesslprotocol.h" 
     21 
     22#define MAX_SSL_READ_BUFFER 65536 
     23 
     24map<string, SSL_CTX *> BaseSSLProtocol::_pGlobalContexts; 
     25bool BaseSSLProtocol::_libraryInitialized = false; 
     26 
     27BaseSSLProtocol::BaseSSLProtocol(uint64_t type) 
     28: BaseProtocol(type) { 
     29        _pGlobalSSLContext = NULL; 
    3030        _pSSL = NULL; 
     31        _sslHandshakeCompleted = false; 
    3132        _pReadBuffer = new uint8_t[MAX_SSL_READ_BUFFER]; 
    32         FINEST("SSL protocol created"); 
    33 } 
    34  
    35 SSLProtocol::~SSLProtocol() { 
     33} 
     34 
     35BaseSSLProtocol::~BaseSSLProtocol() { 
    3636        if (_pSSL != NULL) { 
    3737                SSL_free(_pSSL); 
     
    3939        } 
    4040        delete[] _pReadBuffer; 
    41         FINEST("SSL protocol deleted"); 
    42 } 
    43  
    44 bool SSLProtocol::Initialize(Variant &parameters) { 
    45         //1. Comput the hash on key/cert pair and see 
    46         //if we have a global context with that hash 
    47         string hash = ""; 
    48         if (parameters["hash"] != V_STRING) { 
    49                 if (parameters[CONF_SSL_KEY] != V_STRING 
    50                                 || parameters[CONF_SSL_CERT] != V_STRING) { 
    51                         FATAL("No key/cert provided"); 
    52                         return false; 
    53                 } 
    54                 hash = md5((string) parameters[CONF_SSL_KEY] 
    55                                 + (string) parameters[CONF_SSL_CERT], true); 
    56                 parameters["hash"] = hash; 
    57         } else { 
    58                 hash = (string) parameters["hash"]; 
    59         } 
    60         string key = parameters[CONF_SSL_KEY]; 
    61         string cert = parameters[CONF_SSL_CERT]; 
    62         _pGlobalSSLContext1 = _pGlobalContexts[hash]; 
    63  
    64         //2. Initialize the global context based on the specified 
    65         //key/cert pair if we don't have it 
    66         if (_pGlobalSSLContext1 == NULL) { 
    67                 if (!_libraryInitialized) { 
    68                         //3. This is the first time we use the library. So we have to 
    69                         //initialize it first 
    70                         SSL_library_init(); 
    71  
    72                         //init readable error messages 
    73                         SSL_load_error_strings(); 
    74                         ERR_load_SSL_strings(); 
    75                         ERR_load_CRYPTO_strings(); 
    76                         ERR_load_crypto_strings(); 
    77                         OpenSSL_add_all_algorithms(); 
    78                         OpenSSL_add_all_ciphers(); 
    79                         OpenSSL_add_all_digests(); 
    80  
    81                         //initialize the random numbers generator 
    82                         InitRandGenerator(); 
    83                         _libraryInitialized = false; 
    84                 } 
    85  
    86                 //4. prepare the global ssl context 
    87                 _pGlobalSSLContext1 = SSL_CTX_new(SSLv23_method()); 
    88                 if (_pGlobalSSLContext1 == NULL) { 
    89                         FATAL("Unable to create global SSL context"); 
    90                         return false; 
    91                 } 
    92  
    93                 //5. setup the certificate 
    94                 if (SSL_CTX_use_certificate_file(_pGlobalSSLContext1, STR(cert), 
    95                                 SSL_FILETYPE_PEM) <= 0) { 
    96                         FATAL("Unable to load certificate %s; Error(s) was: %s", 
    97                                         STR(cert), 
    98                                         STR(GetSSLErrors())); 
    99                         SSL_CTX_free(_pGlobalSSLContext1); 
    100                         _pGlobalSSLContext1 = NULL; 
    101                         return false; 
    102                 } 
    103  
    104                 //6. setup the private key 
    105                 if (SSL_CTX_use_PrivateKey_file(_pGlobalSSLContext1, STR(key), 
    106                                 SSL_FILETYPE_PEM) <= 0) { 
    107                         FATAL("Unable to load key %s; Error(s) was: %s", 
    108                                         STR(key), 
    109                                         STR(GetSSLErrors())); 
    110                         SSL_CTX_free(_pGlobalSSLContext1); 
    111                         _pGlobalSSLContext1 = NULL; 
    112                         return false; 
    113                 } 
    114  
    115                 //7. disable client certificate authentication 
    116                 SSL_CTX_set_verify(_pGlobalSSLContext1, SSL_VERIFY_NONE, NULL); 
    117  
    118                 //8. Store the global context for later usage 
    119                 _pGlobalContexts[hash] = _pGlobalSSLContext1; 
    120         } 
    121  
    122         //9. create connection SSL context 
    123         _pSSL = SSL_new(_pGlobalSSLContext1); 
     41} 
     42 
     43bool BaseSSLProtocol::Initialize(Variant &parameters) { 
     44        //1. Initialize the SSL library 
     45        if (!_libraryInitialized) { 
     46                //3. This is the first time we use the library. So we have to 
     47                //initialize it first 
     48                SSL_library_init(); 
     49 
     50                //init readable error messages 
     51                SSL_load_error_strings(); 
     52                ERR_load_SSL_strings(); 
     53                ERR_load_CRYPTO_strings(); 
     54                ERR_load_crypto_strings(); 
     55                OpenSSL_add_all_algorithms(); 
     56                OpenSSL_add_all_ciphers(); 
     57                OpenSSL_add_all_digests(); 
     58 
     59                //initialize the random numbers generator 
     60                InitRandGenerator(); 
     61                _libraryInitialized = false; 
     62        } 
     63 
     64        //2. Initialize the global context 
     65        if (!InitGlobalContext(parameters)) { 
     66                FATAL("Unable to initialize global context"); 
     67                return false; 
     68        } 
     69 
     70        //3. create connection SSL context 
     71        _pSSL = SSL_new(_pGlobalSSLContext); 
    12472        if (_pSSL == NULL) { 
    12573                FATAL("Unable to create SSL connection context"); 
     
    12775        } 
    12876 
     77        //4. setup the I/O buffers 
    12978        SSL_set_bio(_pSSL, BIO_new(BIO_s_mem()), BIO_new(BIO_s_mem())); 
    130         SSL_set_accept_state(_pSSL); 
    131  
    132         return true; 
    133 } 
    134  
    135 bool SSLProtocol::AllowFarProtocol(uint64_t type) { 
     79 
     80        return DoHandshake(); 
     81} 
     82 
     83bool BaseSSLProtocol::AllowFarProtocol(uint64_t type) { 
    13684        if (type == PT_TCP) 
    13785                return true; 
     
    14088} 
    14189 
    142 bool SSLProtocol::AllowNearProtocol(uint64_t type) { 
     90bool BaseSSLProtocol::AllowNearProtocol(uint64_t type) { 
    14391        return true; 
    14492} 
    14593 
    146 bool SSLProtocol::EnqueueForOutbound() { 
     94bool BaseSSLProtocol::EnqueueForOutbound() { 
     95        //1. Is the SSL handshake completed? 
     96        if (!_sslHandshakeCompleted) { 
     97                return DoHandshake(); 
     98        } 
     99 
     100        //2. Do we have some outstanding data? 
    147101        IOBuffer *pBuffer = _pNearProtocol->GetOutputBuffer(); 
    148102        if (pBuffer == NULL) 
    149103                return true; 
     104 
     105        //3. Encrypt the outstanding data 
    150106        if (SSL_write(_pSSL, GETIBPOINTER(*pBuffer), GETAVAILABLEBYTESCOUNT(*pBuffer)) 
    151107                        != (int32_t) GETAVAILABLEBYTESCOUNT(*pBuffer)) { 
     
    154110        } 
    155111        pBuffer->IgnoreAll(); 
     112 
     113        //4. Do the actual I/O 
    156114        return PerformIO(); 
    157115} 
    158116 
    159 IOBuffer * SSLProtocol::GetOutputBuffer() { 
     117IOBuffer * BaseSSLProtocol::GetOutputBuffer() { 
    160118        if (GETAVAILABLEBYTESCOUNT(_outputBuffer) > 0) 
    161119                return &_outputBuffer; 
     
    163121} 
    164122 
    165 IOBuffer * SSLProtocol::GetInputBuffer() { 
     123IOBuffer * BaseSSLProtocol::GetInputBuffer() { 
    166124        return &_inputBuffer; 
    167125} 
    168126 
    169 bool SSLProtocol::SignalInputData(int32_t recvAmount) { 
     127bool BaseSSLProtocol::SignalInputData(int32_t recvAmount) { 
    170128        ASSERT("OPERATION NOT SUPPORTED"); 
    171129        return false; 
    172130} 
    173131 
    174 bool SSLProtocol::SignalInputData(IOBuffer &buffer) { 
    175         //2. get the SSL input buffer 
     132bool BaseSSLProtocol::SignalInputData(IOBuffer &buffer) { 
     133        //1. get the SSL input buffer 
    176134        BIO *pInBio = SSL_get_rbio(_pSSL); 
    177135 
    178         //3. dump all the data from the network inside the ssl input 
     136        //2. dump all the data from the network inside the ssl input 
    179137        BIO_write(pInBio, GETIBPOINTER(buffer), 
    180138                        GETAVAILABLEBYTESCOUNT(buffer)); 
    181139        buffer.IgnoreAll(); 
    182140 
    183         //4. Try to do the handshake 
    184         int32_t errorCode = SSL_ERROR_NONE; 
    185         if (!SSL_is_init_finished(_pSSL)) { 
    186                 errorCode = SSL_accept(_pSSL); 
    187                 if (errorCode < 0) { 
    188                         int32_t error = SSL_get_error(_pSSL, errorCode); 
    189                         if (error != SSL_ERROR_WANT_READ && 
    190                                         error != SSL_ERROR_WANT_WRITE) { 
    191                                 FATAL("Unable to accept SSL connection: %d; %s", 
    192                                                 error, STR(GetSSLErrors())); 
    193                                 return false; 
    194                         } 
    195                 } 
    196         } 
    197  
    198         //5. if the init is made, read the actual data an put it in the 
    199         //descrypted input buffer 
    200         if (SSL_is_init_finished(_pSSL)) { 
    201                 int32_t read = 0; 
    202                 while ((read = SSL_read(_pSSL, _pReadBuffer, MAX_SSL_READ_BUFFER)) > 0) { 
    203                         _inputBuffer.ReadFromBuffer(_pReadBuffer, (uint32_t) read); 
    204                 } 
    205                 if (read < 0) { 
    206                         int32_t error = SSL_get_error(_pSSL, read); 
    207                         if (error != SSL_ERROR_WANT_READ && 
    208                                         error != SSL_ERROR_WANT_WRITE) { 
    209                                 FATAL("Unable to read data: %d", error); 
    210                                 return false; 
    211                         } 
    212                 } 
    213         } 
    214  
    215         //6. If we have pending data inside the decrypted buffer, bubble it up 
    216         //on the protocol stack 
     141        //3. Do we have to do some handshake? 
     142        if (!_sslHandshakeCompleted) { 
     143                if (!DoHandshake()) { 
     144                        FATAL("Unable to do the SSL handshake"); 
     145                        return false; 
     146                } 
     147                if (!_sslHandshakeCompleted) { 
     148                        //WARN("SSL handshake not completed yet"); 
     149                        return true; 
     150                } 
     151        } 
     152 
     153        //4. Read the actual data an put it in the descrypted input buffer 
     154        int32_t read = 0; 
     155        while ((read = SSL_read(_pSSL, _pReadBuffer, MAX_SSL_READ_BUFFER)) > 0) { 
     156                _inputBuffer.ReadFromBuffer(_pReadBuffer, (uint32_t) read); 
     157        } 
     158        if (read < 0) { 
     159                int32_t error = SSL_get_error(_pSSL, read); 
     160                if (error != SSL_ERROR_WANT_READ && 
     161                                error != SSL_ERROR_WANT_WRITE) { 
     162                        FATAL("Unable to read data: %d", error); 
     163                        return false; 
     164                } 
     165        } 
     166 
     167        //6. If we have pending data inside the decrypted buffer, bubble it up on the protocol stack 
     168        //FINEST("_inputBuffer:\n%s", STR(_inputBuffer)); 
    217169        if (GETAVAILABLEBYTESCOUNT(_inputBuffer) > 0) { 
    218170                if (_pNearProtocol != NULL) { 
     
    225177 
    226178        //7. After the data was sent on the upper layers, we might have outstanding 
    227         //data that needs to be sent. Also this outstanding data might come from 
    228         //the ssl handshake itself. So we do I/O 
     179        //data that needs to be sent. 
    229180        return PerformIO(); 
    230181} 
    231182 
    232 string SSLProtocol::DumpBIO(BIO *pBIO) { 
     183bool BaseSSLProtocol::PerformIO() { 
     184        //1. Put the data from SSL output buffer inside our protocol output buffer 
     185        if (!_outputBuffer.ReadFromBIO(SSL_get_wbio(_pSSL))) { 
     186                FATAL("Unable to transfer data from outBIO to outputBuffer"); 
     187                return false; 
     188        } 
     189 
     190        //2. Enqueue the protocol for outbound if we have data that needs to be sent 
     191        if (GETAVAILABLEBYTESCOUNT(_outputBuffer) > 0) { 
     192                if (_pFarProtocol != NULL) { 
     193                        return _pFarProtocol->EnqueueForOutbound(); 
     194                } 
     195        } 
     196 
     197        //3. Done 
     198        return true; 
     199} 
     200 
     201string BaseSSLProtocol::GetSSLErrors() { 
     202        string result = ""; 
     203        uint32_t errorCode; 
     204        char *pTempBuffer = new char[4096]; 
     205        while ((errorCode = ERR_get_error()) != 0) { 
     206                memset(pTempBuffer, 0, 4096); 
     207                ERR_error_string_n(errorCode, pTempBuffer, 4095); 
     208                result += "\n"; 
     209                result += pTempBuffer; 
     210        } 
     211        delete[] pTempBuffer; 
     212        return result; 
     213} 
     214 
     215string BaseSSLProtocol::DumpBIO(BIO *pBIO) { 
    233216        string formatString; 
    234217        formatString = "method: %p\n"; 
     
    263246} 
    264247 
    265 string SSLProtocol::GetSSLErrors() { 
    266         string result = ""; 
    267         uint32_t errorCode; 
    268         char *pTempBuffer = new char[4096]; 
    269         while ((errorCode = ERR_get_error()) != 0) { 
    270                 memset(pTempBuffer, 0, 4096); 
    271                 ERR_error_string_n(errorCode, pTempBuffer, 4095); 
    272                 result += "\n"; 
    273                 result += pTempBuffer; 
    274         } 
    275         delete[] pTempBuffer; 
    276         return result; 
    277 } 
    278  
    279 void SSLProtocol::InitRandGenerator() { 
     248void BaseSSLProtocol::InitRandGenerator() { 
    280249        srand((uint32_t) time(NULL)); 
    281250 
     
    294263} 
    295264 
    296 bool SSLProtocol::PerformIO() { 
    297         //1. Put the data from SSL output buffer inside our 
    298         //protocol output buffer 
    299         if (!_outputBuffer.ReadFromBIO(SSL_get_wbio(_pSSL))) { 
    300                 FATAL("Unable to transfer data from outBIO to outputBuffer"); 
    301                 return false; 
    302         } 
    303  
    304         //2. Enqueue the protocol for outbound if we have data that needs 
    305         //to be sent 
    306         if (GETAVAILABLEBYTESCOUNT(_outputBuffer) > 0) { 
    307                 if (_pFarProtocol != NULL) { 
    308                         return _pFarProtocol->EnqueueForOutbound(); 
    309                 } 
    310         } 
    311  
    312         //3. Done 
    313         return true; 
    314 } 
    315  
    316  
     265 
  • trunk/sources/thelib/src/protocols/variant/basevariantappprotocolhandler.cpp

    r56 r87  
    5454 
    5555void BaseVariantAppProtocolHandler::RegisterProtocol(BaseProtocol *pProtocol) { 
    56         FINEST("BaseVariantAppProtocolHandler::RegisterProtocol"); 
     56        //FINEST("BaseVariantAppProtocolHandler::RegisterProtocol"); 
    5757} 
    5858 
    5959void BaseVariantAppProtocolHandler::UnRegisterProtocol(BaseProtocol *pProtocol) { 
    60         FINEST("BaseVariantAppProtocolHandler::UnRegisterProtocol"); 
     60        //FINEST("BaseVariantAppProtocolHandler::UnRegisterProtocol"); 
    6161} 
    6262 
Note: See TracChangeset for help on using the changeset viewer.