Commit 5de6af4
committed
Don't assume stream_select will preserve array keys
It is not guaranteed that stream_select() will preserve the keys in the passed arrays. It seems that if the number of ready bytes is small, the keys are preserved, but for a larger numbers of bytes the array becomes 0-based.
With this patch, stream_select() is called with a copy of the $readSockets array and before returning the original keys are restored.
This fixes issue #301 parent 33369f1 commit 5de6af4
File tree
1 file changed
+13
-1
lines changed- src/Driver/Userland/Connection
1 file changed
+13
-1
lines changedLines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
120 | 126 | | |
121 | 127 | | |
122 | | - | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
130 | 142 | | |
131 | 143 | | |
132 | 144 | | |
| |||
0 commit comments