Subject: [Simple] MSRP Byte Range scenario

From: <[email-masked]>
Date: Mon, 23 Oct 2006 16:25:23 +0800

Hi All,

Consider scenarios given below. 

1. If receiver receives a messages containing byte range header 1-0/0
but have content in the body. i.e.

MSRP a786hjs2 SEND
To-Path: msrp://biloxi.example.com:12763/kjhd37s2s2;tcp
From-Path: msrp://atlanta.example.com:7654/jshA7we;tcp
Message-ID: 87652
Byte-Range: 1-0/0
Content-Type: text/plain

Hey Bob, are you there?
-------a786hjs2$

2. If the packet has the end line with complete message flag ($) but the
total byte value is greater then received bytes.

MSRP a786hjs2 SEND
To-Path: msrp://biloxi.example.com:12763/kjhd37s2s2;tcp
From-Path: msrp://atlanta.example.com:7654/jshA7we;tcp
Message-ID: 87652
Byte-Range: 1-25/30
Content-Type: text/plain

Hey Bob, are you there?
-------a786hjs2$

3. If the packet has the end line with continuation flag (+) but the
total byte value is equal to received bytes.

MSRP a786hjs2 SEND
To-Path: msrp://biloxi.example.com:12763/kjhd37s2s2;tcp
From-Path: msrp://atlanta.example.com:7654/jshA7we;tcp
Message-ID: 87652
Byte-Range: 1-25/25
Content-Type: text/plain

Hey Bob, are you there?
-------a786hjs2+

All these scenario are valid in terms of receiver.

How will receiver handle these types of scenario? 

Regards,
Amit

_______________________________________________
Simple mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/simple

---

From: Ben Campbell <[email-masked]>
Date: Mon, 23 Oct 2006 08:40:26 -0500

All three cases are errors on the sender's part.

Receiving devices should use the end-line for the purposes of framing  
the request--that is, the incorrect byte-range values should not  
interfere with framing on the connection. But how the recipient deals  
with the error is to some degree an implementation choice. In the  
examples you give, it would be perfectly reasonable to return a 400  
response. An aggressively helpful receiver could attempt to  
reconstruct the message based on these, just to see if it got  
anything useful, but would need to take great care to avoid a buffer- 
overrun situation.

In your final case, such attempt at reconstruction could assume that  
all the bytes have been received, or it could assume that byte-range  
is incorrect and wait around for some period of time for more chunks.

Personally, I would lean towards the 400 response, as trying to  
second guess the sender's intent is difficult and dangerous.

A