commit changes to build
[libt2n] / src / socket_handler.cpp
index ed37e4d..ed14895 100644 (file)
@@ -126,6 +126,7 @@ bool socket_handler::data_waiting(long long usec_timeout,long long* usec_timeout
     int ret=select (FD_SETSIZE, &active_fd_set, NULL, NULL, timeout_ptr);
 
     // return the timeout we did not use
+    // todo: this is linux specific according to man 2 select
     if (usec_timeout > 0 && usec_timeout_remaining != NULL)
         *usec_timeout_remaining=(tval.tv_sec*1000000)+tval.tv_usec;
 
@@ -190,7 +191,7 @@ bool socket_handler::fill_buffer(std::string& buffer)
     // Data read -> store it
     if (nbytes > 0)
     {
-        buffer.assign(socket_buffer,nbytes);
+        buffer.append(socket_buffer,nbytes);
         LOGSTREAM(debug,nbytes << " bytes read");
     }