Queer European MD passionate about IT
Davte 5 năm trước cách đây
mục cha
commit
14992dd19b
2 tập tin đã thay đổi với 3 bổ sung4 xóa
  1. 0 1
      filebridging/client.py
  2. 3 3
      filebridging/server.py

+ 0 - 1
filebridging/client.py

@@ -436,7 +436,6 @@ class Client:
                     force=(new_progress == 100)
                 )
                 if not input_data:
-                    continue
                     break
                 file_to_receive.write(input_data)
         print()  # New line after sys.stdout.write

+ 3 - 3
filebridging/server.py

@@ -96,6 +96,7 @@ class Server:
     async def run_writer(self, writer, connection_token):
         consecutive_interruptions = 0
         errors = 0
+        r = 0
         while connection_token in self.buffers:
             try:
                 input_data = self.buffers[connection_token].popleft()
@@ -109,10 +110,9 @@ class Server:
                 continue
             else:
                 consecutive_interruptions = 0
+            r += len(input_data)
             if not input_data:
-                print("No input data received")
-                await asyncio.sleep(.5)
-                continue
+                print(r)
                 break
             try:
                 writer.write(input_data)