File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 14
14
use function base64_encode ;
15
15
use function is_string ;
16
16
use function ord ;
17
+ use function rand ;
17
18
use function serialize ;
18
19
use function sprintf ;
19
20
use function strlen ;
@@ -150,12 +151,13 @@ class Header implements PacketHeaderInterface
150
151
protected int $ arcount ;
151
152
152
153
153
- /**
154
+ /*
154
155
* Maximum 16-bit integer = 65535
155
156
*
156
157
* @var int
157
- */
158
+ *
158
159
private static int $increment = 0;
160
+ */
159
161
160
162
/**
161
163
* Header constructor
@@ -279,11 +281,13 @@ public static function createQueryHeader(
279
281
bool $ rdFlag = true
280
282
) : PacketHeaderInterface {
281
283
if ($ id === null ) {
284
+ $ id = rand (1 , 65535 );
282
285
// 160-bit max 65535 -> then reset to 1
283
- if (++self ::$ increment > 65535 ) {
286
+ /* if (++self::$increment > 65535) {
284
287
self::$increment = 1;
285
288
}
286
289
$id = self::$increment;
290
+ */
287
291
}
288
292
289
293
$ id = $ id % 65535 ;
You can’t perform that action at this time.
0 commit comments