Skip to content

Commit 12d305e

Browse files
committed
Fix merge conflicts
2 parents 095644a + 3ebcaab commit 12d305e

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44
- Remove bitsyntax dependency - See https://github.com/amqp-node/amqplib/pull/785. Thanks @ikenfin
5+
<<<<<<< HEAD
6+
=======
7+
- Stop checking if frame max is exceeded when parsing frames - See https://github.com/amqp-node/amqplib/pull/784. Thanks @ohroy
8+
>>>>>>> ohroy-main
59
610
## v0.10.6
711
- Replace references to the old squaremo/amqp.name repo with ones to amqp-node/amqplib

lib/connection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ class Connection extends EventEmitter {
553553

554554
recvFrame () {
555555
// %%% identifying invariants might help here?
556-
var frame = parseFrame(this.rest, this.frameMax);
556+
var frame = parseFrame(this.rest);
557557

558558
if (!frame) {
559559
var incoming = this.stream.read();

lib/frame.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ module.exports.makeBodyFrame = function (channel, payload) {
9999
* @arg { number } max
100100
* @returns { FrameStructure | boolean }
101101
*/
102-
function parseFrame(bin, max) {
102+
function parseFrame(bin) {
103103
if (bin.length < FRAME_HEADER_BYTES) {
104104
return false
105105
}
@@ -108,10 +108,6 @@ function parseFrame(bin, max) {
108108
const channel = bin.readUInt16BE(1)
109109
const size = bin.readUInt32BE(3)
110110

111-
if (size > max) {
112-
throw new Error('Frame size exceeds frame max');
113-
}
114-
115111
const totalSize = FRAME_HEADER_BYTES + size + FRAME_END_BYTES
116112

117113
if (bin.length < totalSize) {
@@ -176,4 +172,4 @@ module.exports.HEARTBEAT_BUF = Buffer.from([constants.FRAME_HEARTBEAT,
176172
0, 0, // channel = 0
177173
constants.FRAME_END]);
178174

179-
module.exports.HEARTBEAT = HEARTBEAT;
175+
module.exports.HEARTBEAT = HEARTBEAT;

test/frame.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ suite("Explicit parsing", function() {
6969
0,0,0,0, // garbage ID
7070
defs.constants.FRAME_END]);
7171

72-
testBogusFrame('> max frame',
73-
[defs.constants.FRAME_BODY,
74-
0,0, 0,0,0,6, // too big!
75-
65,66,67,68,69,70,
76-
defs.constants.FRAME_END]);
77-
7872
});
7973

8074
// Now for a bit more fun.

0 commit comments

Comments
 (0)