Skip to content

Commit baae546

Browse files
Save notes
1 parent 1eaa53a commit baae546

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

missions/PullRequests-20160331-1233.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,22 @@ If the exception appears again, then we'll use atexit.register(self._heartbeat_t
119119

120120
The issue is that packet_text has utf-8 but we need a bytestring and six.b only encodes using latin-1.
121121

122-
_ Option 1: Encode packet_text into a bytestring using utf-8, but then we won't be working with unicode.
122+
Option 1: Encode packet_text into a bytestring using utf-8, but then we won't be working with unicode.
123123
Option 2: Leave packet_text alone and handle it differently based on whether it is unicode or a bytestring.
124124

125125
20160715-1315
126126

127127
After thinking about it a bit, I think the second approach is more robust, because we'll just leave the packet data as it is mostly and just handle it verbatim. The first option can be vulnerable to cases where the packet type might be wrong?
128+
129+
20160715-1700
130+
131+
If I ever do revisit binary support, I should try to generate a log of the binary protocol using Chrome Developer Tools. There were some notes about XHR2 vs base64.
132+
133+
- https://github.com/socketio/engine.io-protocol
134+
- https://github.com/socketio/socket.io-protocol
135+
136+
The feus4177 repository has a working solution for binary support, but I didn't completely understand how it worked and I felt uncomfortable about merging something without full understanding.
137+
138+
I also wanted to address unicode support and the decision was to keep everything as an encoded bytestring and only decode for non-binary events. I tried the approach of leaving the packet alone and just handling unicode or bytestring on a case by case basis, but it proved too messy.
139+
140+
Perhaps when my life becomes less complex, I'll revisit both binary and unicode support. But for now, I have too many things in my head and my capacity for extra complexity is becoming rather limited.

0 commit comments

Comments
 (0)