Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
V
vidai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SexHackMe
vidai
Commits
5aca4219
Commit
5aca4219
authored
Oct 09, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add debug logging to socket send and receive operations to trace message flow
parent
2fbe9570
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
comm.py
vidai/comm.py
+13
-4
No files found.
vidai/comm.py
View file @
5aca4219
...
@@ -69,7 +69,9 @@ class SocketCommunicator:
...
@@ -69,7 +69,9 @@ class SocketCommunicator:
'msg_id'
:
message
.
msg_id
,
'msg_id'
:
message
.
msg_id
,
'data'
:
message
.
data
'data'
:
message
.
data
})
.
encode
(
'utf-8'
)
})
.
encode
(
'utf-8'
)
self
.
sock
.
sendall
(
data
+
b
'
\n
'
)
full_data
=
data
+
b
'
\n
'
print
(
f
"DEBUG: SocketCommunicator sending: {full_data}"
)
self
.
sock
.
sendall
(
full_data
)
def
receive_message
(
self
)
->
Optional
[
Message
]:
def
receive_message
(
self
)
->
Optional
[
Message
]:
"""Receive a message."""
"""Receive a message."""
...
@@ -150,11 +152,15 @@ class SocketServer:
...
@@ -150,11 +152,15 @@ class SocketServer:
try
:
try
:
while
self
.
running
:
while
self
.
running
:
data
=
client_sock
.
recv
(
4096
)
data
=
client_sock
.
recv
(
4096
)
print
(
f
"DEBUG: SocketServer received raw data: {data}"
)
if
not
data
:
if
not
data
:
break
break
messages
=
data
.
decode
(
'utf-8'
)
.
split
(
'
\n
'
)
decoded
=
data
.
decode
(
'utf-8'
)
print
(
f
"DEBUG: SocketServer decoded data: {repr(decoded)}"
)
messages
=
decoded
.
split
(
'
\n
'
)
for
msg_str
in
messages
:
for
msg_str
in
messages
:
if
msg_str
.
strip
():
if
msg_str
.
strip
():
print
(
f
"DEBUG: Processing message: {repr(msg_str)}"
)
try
:
try
:
msg_data
=
json
.
loads
(
msg_str
)
msg_data
=
json
.
loads
(
msg_str
)
message
=
Message
(
message
=
Message
(
...
@@ -162,6 +168,7 @@ class SocketServer:
...
@@ -162,6 +168,7 @@ class SocketServer:
msg_id
=
msg_data
[
'msg_id'
],
msg_id
=
msg_data
[
'msg_id'
],
data
=
msg_data
[
'data'
]
data
=
msg_data
[
'data'
]
)
)
print
(
f
"DEBUG: Parsed message: {message}"
)
response
=
self
.
message_handler
(
message
)
response
=
self
.
message_handler
(
message
)
if
response
:
if
response
:
resp_data
=
json
.
dumps
({
resp_data
=
json
.
dumps
({
...
@@ -170,9 +177,11 @@ class SocketServer:
...
@@ -170,9 +177,11 @@ class SocketServer:
'data'
:
response
.
data
'data'
:
response
.
data
})
.
encode
(
'utf-8'
)
})
.
encode
(
'utf-8'
)
client_sock
.
sendall
(
resp_data
+
b
'
\n
'
)
client_sock
.
sendall
(
resp_data
+
b
'
\n
'
)
except
json
.
JSONDecodeError
:
except
json
.
JSONDecodeError
as
e
:
print
(
f
"DEBUG: JSON decode error: {e}"
)
pass
pass
except
:
except
Exception
as
e
:
print
(
f
"DEBUG: Exception in _handle_client: {e}"
)
pass
pass
finally
:
finally
:
client_sock
.
close
()
client_sock
.
close
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment