Skip to content

Commit

Permalink
Replaced struct usage for bind_thrads logic in protocol.py for brine …
Browse files Browse the repository at this point in the history
…to be consistent w/ rest of code base
  • Loading branch information
comrumino committed Oct 24, 2022
1 parent d785cca commit 656998f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rpyc/core/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import collections
import concurrent.futures as c_futures
import os
import struct
import threading

from threading import Lock, Condition, RLock
Expand Down Expand Up @@ -253,7 +252,7 @@ def _send(self, msg, seq, args): # IO
data = brine.dump((msg, seq, args))
if self._bind_threads:
this_thread = self._get_thread()
data = struct.pack('<QQ', this_thread.id, this_thread._remote_thread_id) + data
data = brine.I4I4.pack(this_thread.id, this_thread._remote_thread_id) + data
if msg == consts.MSG_REQUEST:
this_thread._occupation_count += 1
else:
Expand Down Expand Up @@ -534,7 +533,7 @@ def _serve_bound(self, timeout, wait_for_lock):

return False

remote_thread_id, local_thread_id = struct.unpack('<QQ', message[:16])
remote_thread_id, local_thread_id = brine.I4I4.unpack(message[:16])
message = message[16:]

this = False
Expand Down

0 comments on commit 656998f

Please sign in to comment.