Skip to content

Commit d715976

Browse files
committed
Merge pull request #12 from heroku/small_cleanup
Small cleanup
2 parents b1cc05f + 06b4277 commit d715976

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

rfc6587_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func TestBadSplit(t *testing.T) {
6161
if err := scanner.Err(); err == nil {
6262
t.Error("Expected an error, but didn't get one")
6363
} else {
64-
t.Log("Error: ", err)
64+
t.Log("Error was: ", err)
6565
}
6666

6767
}

server.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,10 @@ func rfc6587ScannerSplit(data []byte, atEOF bool) (advance int, token []byte, er
169169
if err != nil {
170170
return 0, nil, err
171171
}
172-
if len(data) >= length+i+1 {
172+
end := length + i + 1
173+
if len(data) >= end {
173174
//Return the frame with the length removed
174-
return length + i + 1, data[i+1 : length+i+1], nil
175+
return end, data[i+1 : end], nil
175176
}
176177
}
177178

0 commit comments

Comments
 (0)