You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from wayfire import WayfireSocket
import json as js
from wayfire.core.template import get_msg_template
def send_json_with_incomplete_data(msg):
if 'method' not in msg:
raise Exception("Malformed json request: missing method!")
data = js.dumps(msg).encode("utf8")
header = len(data).to_bytes(4, byteorder="little")
# Send header
sock.client.send(header)
# Simulate incomplete data transmission
incomplete_data = data[:len(data) // 2] # Send only half of the data
sock.client.send(incomplete_data)
while True:
response = sock.read_message()
if 'event' in response:
sock.pending_events.append(response)
continue
return response
send_json_with_incomplete_data(get_msg_template("window-rules/list-views"))
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: