]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/native.cxx
Added a get_type() to the iochannel class so the protocol code can optionally
[flightgear.git] / src / Network / native.cxx
index 957cbe2b2309ee8e34bf33fd2c3f0bd38dea6102..75b8d2b56b22c039a5800b97c978862076dba3aa 100644 (file)
@@ -21,8 +21,9 @@
 // $Id$
 
 
-#include <Debug/logstream.hxx>
-#include <Math/fg_geodesy.hxx>
+#include <simgear/debug/logstream.hxx>
+#include <simgear/math/fg_geodesy.hxx>
+
 #include <Time/fg_time.hxx>
 
 #include "iochannel.hxx"
@@ -70,9 +71,16 @@ bool FGNative::process() {
            return false;
        }
     } else if ( get_direction() == in ) {
-       while ( io->read( (char *)(& buf), length ) == length ) {
-           FG_LOG( FG_IO, FG_ALERT, "Success reading data." );
-           *cur_fdm_state = buf;
+       if ( io->get_type() == fgFileType ) {
+           if ( io->read( (char *)(& buf), length ) == length ) {
+               FG_LOG( FG_IO, FG_ALERT, "Success reading data." );
+               *cur_fdm_state = buf;
+           }
+       } else {
+           while ( io->read( (char *)(& buf), length ) == length ) {
+               FG_LOG( FG_IO, FG_ALERT, "Success reading data." );
+               *cur_fdm_state = buf;
+           }
        }
     }