gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/rtmp r9953: track AMF references.


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9953: track AMF references.
Date: Sun, 04 Jan 2009 22:32:18 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9953
committer: address@hidden
branch nick: rtmp
timestamp: Sun 2009-01-04 22:32:18 -0700
message:
  track AMF references.
modified:
  cygnal/rtmp_server.cpp
  cygnal/rtmp_server.h
=== modified file 'cygnal/rtmp_server.cpp'
--- a/cygnal/rtmp_server.cpp    2009-01-02 01:13:56 +0000
+++ b/cygnal/rtmp_server.cpp    2009-01-05 05:32:18 +0000
@@ -744,7 +744,6 @@
        boost::shared_ptr<RTMP::queues_t> que = rtmp->split(*pkt);
        cerr << "FIXME Connect Que size is: " << que->size() << endl;
        que->at(0)->dump();
-       que->at(1)->dump();
 //    RTMP::queues_t *que = rtmp->split(start->reference() + head->head_size, 
start->size());
        if (que->size() > 0) {
            boost::shared_ptr<amf::Buffer> bufptr = que->at(0)->pop();
@@ -780,7 +779,6 @@
        // Read the handshake bytes sent by the client when requesting
        // a connection.
        pkt = rtmp->recvMsg(args->netfd);
-//     pkt->dump();
        // See if we have data in the handshake, we should have 1537 bytes
        if (pkt->allocated() == 0) {
            log_error("failed to read RTMP data from the client.");
@@ -824,34 +822,28 @@
                    return false;
                }
                boost::shared_ptr<RTMP::rtmp_head_t> rthead = 
rtmp->decodeHeader(ptr);
-//    RTMP::queues_t *que = rtmp->split(start->reference() + head->head_size, 
start->size());
                ptr += rthead->head_size; // skip past the header
                if (echo) {
                    boost::shared_ptr<RTMP::queues_t> que = rtmp->split(*buf);
                    boost::shared_ptr<amf::Buffer> bufptr;
                    if (que->size() > 0) {
-                       cerr << "FIXME echo Que size is: " << que->size() << 
endl;
-//                     que->at(0)->dump();
-//                     CQue *cque = que->at(0);
-//                     bufptr = cque->pop();
+//                     cerr << "FIXME echo Que size is: " << que->size() << 
endl;
                        bufptr = que->at(0)->pop();
-//                     bufptr->dump();
                    }
                    // process the echo test request
                    vector<boost::shared_ptr<amf::Element> > request = 
rtmp->parseEchoRequest(
                        bufptr->reference() + rthead->head_size, 
bufptr->allocated() - rthead->head_size);
                    // now build a result
                    if (request[3]) {
-//                     request[3]->dump();
                        boost::shared_ptr<amf::Buffer> result = 
rtmp->formatEchoResponse(request[1]->to_number(), *request[3]);
                        if (rtmp->sendMsg(args->netfd, rthead->channel, 
RTMP::HEADER_8, result->allocated(),
                                          RTMP::INVOKE, RTMPMsg::FROM_SERVER, 
*result)) {
-                           log_debug("Sent echo test response response to 
client.");
                            // If we're in single threaded mode, we Just want 
to stay in
                            // this thread for now and do everything all at 
once. Otherwise
                            // we're done, so we return to the dispatch handler 
waiting for
                            // the next packet. Single threaded mode is 
primarily used by
                            // developers for debugging protocols.
+                           log_debug("Sent echo test response response to 
client.");
                            if (crcfile.getThreadingFlag()) {
                                done = true;
                            } else {

=== modified file 'cygnal/rtmp_server.h'
--- a/cygnal/rtmp_server.h      2008-12-30 22:39:46 +0000
+++ b/cygnal/rtmp_server.h      2009-01-05 05:32:18 +0000
@@ -57,6 +57,8 @@
     boost::shared_ptr<amf::Buffer> formatEchoResponse(double num, amf::Element 
&el);
     boost::shared_ptr<amf::Buffer> formatEchoResponse(double num, amf::Buffer 
&data);
     boost::shared_ptr<amf::Buffer> formatEchoResponse(double num, 
boost::uint8_t *data, size_t size);    
+    void addReference(boost::uint16_t index, amf::Element &el) { 
_references[index] = el; };
+    amf::Element &getReference(boost::uint16_t index) { return 
_references[index]; };
     
     void dump();
   private:
@@ -65,6 +67,7 @@
     gnash::DiskStream::filetype_e  _filetype;
     std::string                _filespec;
     boost::uint32_t     _filesize;
+    std::map<boost::uint16_t, amf::Element &> _references;
 };
 
 // This is the thread for all incoming RTMP connections


reply via email to

[Prev in Thread] Current Thread [Next in Thread]