gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash libnet/network.h libnet/network.cpp Chang...


From: Rob Savoye
Subject: [Gnash-commit] gnash libnet/network.h libnet/network.cpp Chang...
Date: Sat, 14 Jun 2008 22:23:55 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Rob Savoye <rsavoye>    08/06/14 22:23:55

Modified files:
        libnet         : network.h network.cpp 
        .              : ChangeLog 

Log message:
                * libnet/network.{h,cpp}: Read and write Buffers too. Set _port 
for
                client connections too.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/libnet/network.h?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/libnet/network.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6932&r2=1.6933

Patches:
Index: libnet/network.h
===================================================================
RCS file: /sources/gnash/gnash/libnet/network.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- libnet/network.h    14 Jun 2008 17:49:20 -0000      1.5
+++ libnet/network.h    14 Jun 2008 22:23:54 -0000      1.6
@@ -39,6 +39,10 @@
 #include <cassert>
 #include <string>
 
+namespace amf {
+class Buffer;
+}
+
 namespace gnash {
 
 // Define the ports for the RTMP protocols
@@ -91,14 +95,14 @@
     bool createClient(const std::string &hostname, short port);
 
     // Read from the connection
-//    int readNet(Buffer &buffer);
+    int readNet(amf::Buffer *buffer);
     int readNet(byte_t *buffer, int nbytes);
     int readNet(byte_t *buffer, int nbytes, int timeout);
     int readNet(int fd, byte_t *buffer, int nbytes);
     int readNet(int fd, byte_t *buffer, int nbytes, int timeout);
     
     // Write to the connection
-//    int writeNet(gnash::Buffer &buffer);
+    int writeNet(amf::Buffer *buffer);
     int writeNet(const std::string &buffer);
     int writeNet(const byte_t *buffer, int nbytes);
 //    int writeNet(int fd, const byte_t *buffer);

Index: libnet/network.cpp
===================================================================
RCS file: /sources/gnash/gnash/libnet/network.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- libnet/network.cpp  1 Apr 2008 22:20:38 -0000       1.2
+++ libnet/network.cpp  14 Jun 2008 22:23:54 -0000      1.3
@@ -48,6 +48,8 @@
 # include <sys/select.h>
 #endif
 
+#include "buffer.h"
+
 #ifndef MAXHOSTNAMELEN
 #define MAXHOSTNAMELEN 256
 #endif
@@ -473,6 +475,7 @@
         return false;
     }
 
+    _port = port;    
     log_debug(_("%s: to host %s at port %d"), __FUNCTION__, hostname, port);
 
     memset(&sock_in, 0, sizeof(struct sockaddr_in));
@@ -580,6 +583,7 @@
 #endif
 
     _connected = true;
+    _port = port;
     assert(_sockfd > 0);
     return true;
 }
@@ -680,6 +684,12 @@
 
 // Read from the connection
 int
+Network::readNet(amf::Buffer *buffer)
+{
+    return readNet(_sockfd, buffer->reference(), buffer->size(), _timeout);
+}
+
+int
 Network::readNet(byte_t *buffer, int nbytes)
 {
     return readNet(_sockfd, buffer, nbytes, _timeout);
@@ -764,6 +774,12 @@
 
 // Write to the connection
 int
+Network::writeNet(amf::Buffer *buffer)
+{
+    return writeNet(buffer->reference(), buffer->size());
+};
+
+int
 Network::writeNet(const std::string& buffer)
 {
     return writeNet(reinterpret_cast<const byte_t *>(buffer.c_str()), 
buffer.size());

Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6932
retrieving revision 1.6933
diff -u -b -r1.6932 -r1.6933
--- ChangeLog   14 Jun 2008 22:12:14 -0000      1.6932
+++ ChangeLog   14 Jun 2008 22:23:54 -0000      1.6933
@@ -1,5 +1,8 @@
 2008-06-14  Rob Savoye  <address@hidden>
 
+       * libnet/network.{h,cpp}: Read and write Buffers too. Set _port for
+       client connections too.
+       
        * libbase/URL.h: Add method to return the port number, and another
        one to fix the hostname if there is a port number attached.
        * libbase/URL.cpp: Properly parse the optional port number instead




reply via email to

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