Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(701)

Delta Between Two Patch Sets: src/pkg/http/spdy/read.go

Issue 4661051: code review 4661051: strings.Split: make the default to split all. (Closed)
Left Patch Set: Created 12 years, 9 months ago
Right Patch Set: diff -r eaa696629d4d https://go.googlecode.com/hg/ Created 12 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/http/server.go ('k') | src/pkg/http/transfer.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package spdy 5 package spdy
6 6
7 import ( 7 import (
8 "compress/zlib" 8 "compress/zlib"
9 "encoding/binary" 9 "encoding/binary"
10 "http" 10 "http"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 if h[name] != nil { 167 if h[name] != nil {
168 e = &Error{DuplicateHeaders, streamId} 168 e = &Error{DuplicateHeaders, streamId}
169 } 169 }
170 if err := binary.Read(r, binary.BigEndian, &length); err != nil { 170 if err := binary.Read(r, binary.BigEndian, &length); err != nil {
171 return nil, err 171 return nil, err
172 } 172 }
173 value := make([]byte, length) 173 value := make([]byte, length)
174 if _, err := io.ReadFull(r, value); err != nil { 174 if _, err := io.ReadFull(r, value); err != nil {
175 return nil, err 175 return nil, err
176 } 176 }
177 » » valueList := strings.Split(string(value), "\x00", -1) 177 » » valueList := strings.Split(string(value), "\x00")
178 for _, v := range valueList { 178 for _, v := range valueList {
179 h.Add(name, v) 179 h.Add(name, v)
180 } 180 }
181 } 181 }
182 if e != nil { 182 if e != nil {
183 return h, e 183 return h, e
184 } 184 }
185 return h, nil 185 return h, nil
186 } 186 }
187 187
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 var frame DataFrame 304 var frame DataFrame
305 frame.StreamId = streamId 305 frame.StreamId = streamId
306 frame.Flags = DataFlags(length >> 24) 306 frame.Flags = DataFlags(length >> 24)
307 length &= 0xffffff 307 length &= 0xffffff
308 frame.Data = make([]byte, length) 308 frame.Data = make([]byte, length)
309 if _, err := io.ReadFull(f.r, frame.Data); err != nil { 309 if _, err := io.ReadFull(f.r, frame.Data); err != nil {
310 return nil, err 310 return nil, err
311 } 311 }
312 return &frame, nil 312 return &frame, nil
313 } 313 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b