OLD | NEW |
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 implements SPDY protocol which is described in | 5 // Package spdy implements SPDY protocol which is described in |
6 // draft-mbelshe-httpbis-spdy-00. | 6 // draft-mbelshe-httpbis-spdy-00. |
7 // | 7 // |
8 // http://tools.ietf.org/html/draft-mbelshe-httpbis-spdy-00 | 8 // http://tools.ietf.org/html/draft-mbelshe-httpbis-spdy-00 |
9 package spdy | 9 package spdy |
10 | 10 |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 type ErrorCode string | 308 type ErrorCode string |
309 | 309 |
310 const ( | 310 const ( |
311 UnlowercasedHeaderName ErrorCode = "header was not lowercased" | 311 UnlowercasedHeaderName ErrorCode = "header was not lowercased" |
312 DuplicateHeaders ErrorCode = "multiple headers with same name" | 312 DuplicateHeaders ErrorCode = "multiple headers with same name" |
313 WrongCompressedPayloadSize ErrorCode = "compressed payload size was inco
rrect" | 313 WrongCompressedPayloadSize ErrorCode = "compressed payload size was inco
rrect" |
314 UnknownFrameType ErrorCode = "unknown frame type" | 314 UnknownFrameType ErrorCode = "unknown frame type" |
315 InvalidControlFrame ErrorCode = "invalid control frame" | 315 InvalidControlFrame ErrorCode = "invalid control frame" |
316 InvalidDataFrame ErrorCode = "invalid data frame" | 316 InvalidDataFrame ErrorCode = "invalid data frame" |
317 InvalidHeaderPresent ErrorCode = "frame contained invalid header" | 317 InvalidHeaderPresent ErrorCode = "frame contained invalid header" |
| 318 ZeroStreamId ErrorCode = "stream id zero is disallowed" |
318 ) | 319 ) |
319 | 320 |
320 // Error contains both the type of error and additional values. StreamId is 0 | 321 // Error contains both the type of error and additional values. StreamId is 0 |
321 // if Error is not associated with a stream. | 322 // if Error is not associated with a stream. |
322 type Error struct { | 323 type Error struct { |
323 Err ErrorCode | 324 Err ErrorCode |
324 StreamId uint32 | 325 StreamId uint32 |
325 } | 326 } |
326 | 327 |
327 func (e *Error) Error() string { | 328 func (e *Error) Error() string { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 return nil, err | 365 return nil, err |
365 } | 366 } |
366 framer := &Framer{ | 367 framer := &Framer{ |
367 w: w, | 368 w: w, |
368 headerBuf: compressBuf, | 369 headerBuf: compressBuf, |
369 headerCompressor: compressor, | 370 headerCompressor: compressor, |
370 r: r, | 371 r: r, |
371 } | 372 } |
372 return framer, nil | 373 return framer, nil |
373 } | 374 } |
OLD | NEW |