basho/riak_kv — pull request #593 by seancribbs (2013-07-02 01:41:44+00:00)
Title: Fix final multipart boundary when streaming 2i with max_results.

In the output below, the "final" marker of the multipart/mixed body is erroneously produced even though there is an additional hunk in the stream that contains the continuation data. This is a simple fix that will allow clients with existing streaming multipart parsers to get the continuation at the end.

```shell
curl localhost:8098/buckets/kqllhzklroqm/index/field1_bin/val0/val5?stream=true\&max_results=3 -i
HTTP/1.1 200 OK
Vary: Accept-Encoding
Transfer-Encoding: chunked
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Date: Tue, 02 Jul 2013 01:35:14 GMT
Content-Type: multipart/mixed;boundary=1G4Fv6rUewvlAQt22mocVUjcHyA

--1G4Fv6rUewvlAQt22mocVUjcHyA
Content-Type: application/json

{"keys":["owdhxphpsezk","tozqrrtrjdnn","bkmmcbnmluvh"]}
--1G4Fv6rUewvlAQt22mocVUjcHyA--
Content-Type: application/json

{"continuation":"g2gCbQAAAAR2YWwzbQAAAAxia21tY2JubWx1dmg="}
--1G4Fv6rUewvlAQt22mocVUjcHyA--
```