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 1414use function base64_encode ;
1515use function is_string ;
1616use function ord ;
17+ use function rand ;
1718use function serialize ;
1819use function sprintf ;
1920use function strlen ;
@@ -150,12 +151,13 @@ class Header implements PacketHeaderInterface
150151 protected int $ arcount ;
151152
152153
153- /**
154+ /*
154155 * Maximum 16-bit integer = 65535
155156 *
156157 * @var int
157- */
158+ *
158159 private static int $increment = 0;
160+ */
159161
160162 /**
161163 * Header constructor
@@ -279,11 +281,13 @@ public static function createQueryHeader(
279281 bool $ rdFlag = true
280282 ) : PacketHeaderInterface {
281283 if ($ id === null ) {
284+ $ id = rand (1 , 65535 );
282285 // 160-bit max 65535 -> then reset to 1
283- if (++self ::$ increment > 65535 ) {
286+ /* if (++self::$increment > 65535) {
284287 self::$increment = 1;
285288 }
286289 $id = self::$increment;
290+ */
287291 }
288292
289293 $ id = $ id % 65535 ;
You can’t perform that action at this time.
0 commit comments