Commit 7220004
committed
Use readline to separate JSON response objects
- JSON responses are newline-delimited by c-lighting and can't contain
newlines, so this achieves the same in a simpler and more efficient manner.
- The previous method would break with something like { "key": "}" }
- The previous method would break if a single JSON response is split across
multiple `data` events (possible with large responses).1 parent 1a8d3ba commit 7220004
1 file changed
+11
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | | - | |
7 | | - | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
70 | 53 | | |
71 | 54 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 55 | + | |
| 56 | + | |
89 | 57 | | |
90 | 58 | | |
91 | 59 | | |
| |||
129 | 97 | | |
130 | 98 | | |
131 | 99 | | |
132 | | - | |
| 100 | + | |
133 | 101 | | |
134 | 102 | | |
135 | 103 | | |
| |||
0 commit comments