Browse Source

speed up file transfers with bigger buffers

Jonas Pflanzer 4 năm trước cách đây
mục cha
commit
2bc3e28768
4 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 1 1
      cli/include/fileman.h
  2. 1 1
      cli/src/ioman.cpp
  3. 1 1
      daemon/include/FileManager.h
  4. 1 1
      daemon/include/Server.h

+ 1 - 1
cli/include/fileman.h

@@ -30,7 +30,7 @@ private:
 	std::fstream getfile;
 	std::vector<std::string> listdata;
 	std::string getpath, getname, putpath, putname;
-	const unsigned int max_read_len = 256;
+	const unsigned int max_read_len = 4096;
 	int putsize;
 	int putchunks;
 	int putchunksRemaining;

+ 1 - 1
cli/src/ioman.cpp

@@ -36,7 +36,7 @@ IoMan::IoMan(char *ipcstring, bool enablessl) : IoMan(ipcstring) {
 	}
 }
 
-IoMan::IoMan(char *ipcstring) : cmdman(fileman, &ioman_externalDebugPrint) {
+IoMan::IoMan(char *ipcstring) : cmdman(fileman, &ioman_externalDebugPrint), recvbuf(16384) {
 	ipstring = std::string(ipcstring);
 	port = 1234;
 	tcpsock = new tcp::socket(ios);

+ 1 - 1
daemon/include/FileManager.h

@@ -60,7 +60,7 @@ private:
 	std::vector<std::vector<std::string>> list;
 
 public:
-	enum { max_data_length = 512 };
+	enum { max_data_length = 4096 };
 
 	/**
 	 * FileManager Errors

+ 1 - 1
daemon/include/Server.h

@@ -54,7 +54,7 @@ private:
 	/**
 	 * max buffer length
 	 */
-	enum { max_length = 1024 };
+	enum { max_length = 16384 };
 
 	/**
 	 * data buffer