@@ -190,13 +190,29 @@ func addTransactionLogs(s *svgsequence.Sequence, ts vsl.TransactionSet, tx *vsl.
190190 case "deliver" :
191191 switch tx .TXType {
192192 case vsl .TxTypeRequest :
193- lastStatus := tx .LastRecordByTag (tags .RespStatus , i )
193+ status := tx .LastRecordByTag (tags .RespStatus , i )
194+ reason := tx .LastRecordByTag (tags .RespReason , i )
194195 // If a RespStatus is not found, we are probably serving a cache hit
195- if lastStatus != nil {
196- s1 := "DELIVER\n " + lastStatus .GetRawValue ()
197- lastReason := tx .LastRecordByTag (tags .RespReason , i )
198- if lastReason != nil {
199- s1 += " " + wrapAndTruncate (lastReason .GetRawValue (), truncateLen , 100 )
196+ if status != nil {
197+ s1 := "DELIVER\n " + status .GetRawValue ()
198+ if reason != nil {
199+ s1 += " " + wrapAndTruncate (reason .GetRawValue (), truncateLen , 100 )
200+ }
201+ s .AddStep (svgsequence.Step {Source : V , Target : client , Text : s1 })
202+ }
203+
204+ // Handle 200 --> 206 (partial content) by checking the next status
205+ status = tx .NextRecordByTag (tags .RespStatus , i )
206+ reason = tx .NextRecordByTag (tags .RespReason , i )
207+ contentRange := tx .RespHeaders .Get ("Content-Range" , false )
208+ if status != nil {
209+ s1 := "DELIVER\n "
210+ if contentRange != "" {
211+ s1 += "Content-Range: " + contentRange + "\n "
212+ }
213+ s1 += status .GetRawValue ()
214+ if reason != nil {
215+ s1 += " " + wrapAndTruncate (reason .GetRawValue (), truncateLen , 100 )
200216 }
201217 s .AddStep (svgsequence.Step {Source : V , Target : client , Text : s1 })
202218 }
0 commit comments