mail[Wesnoth-commits] r29039 - /trunk/src/network_worker.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by paniemin on August 27, 2008 - 23:58:
Author: suokko
Date: Wed Aug 27 23:58:41 2008
New Revision: 29039

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29039&view=rev
Log:
Removed null terminations from data send to network

Modified:
    trunk/src/network_worker.cpp

Modified: trunk/src/network_worker.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/network_worker.cpp?rev=29039&r1=29038&r2=29039&view=diff
==============================================================================
--- trunk/src/network_worker.cpp (original)
+++ trunk/src/network_worker.cpp Wed Aug 27 23:58:41 2008
@@ -316,10 +316,9 @@
 
 static void make_network_buffer(const char* input, int len, 
std::vector<char>& buf)
 {
-       buf.resize(4 + len + 1);
-       SDLNet_Write32(len + 1, &buf[0]);
+       buf.resize(4 + len);
+       SDLNet_Write32(len, &buf[0]);
        memcpy(&buf[4], input, len);
-       buf.back() = 0;
 }
 
 static SOCKET_STATE send_buffer(TCPsocket sock, std::vector<char>& buf, int 
in_size = -1)
@@ -505,8 +504,6 @@
 
                        if (upto == filesize)
                        {
-                               buf->raw_buffer.push_back(0);
-                               result = send_buffer(buf->sock, 
buf->raw_buffer, 1);
                                break;
                        }
                }
@@ -544,8 +541,6 @@
                }
                if (upto == filesize)
                {
-                       buf->raw_buffer[0] = 0;
-                       result = send_buffer(buf->sock, buf->raw_buffer, 1);
                        break;
                }
 




Related Messages


Powered by MHonArc, Updated Thu Aug 28 00:01:27 2008