()
| 293 | } |
| 294 | |
| 295 | func (ce CloseError) bytes() ([]byte, error) { |
| 296 | p, err := ce.bytesErr() |
| 297 | if err != nil { |
| 298 | err = fmt.Errorf("failed to marshal close frame: %w", err) |
| 299 | ce = CloseError{ |
| 300 | Code: StatusInternalError, |
| 301 | } |
| 302 | p, _ = ce.bytesErr() |
| 303 | } |
| 304 | return p, err |
| 305 | } |
| 306 | |
| 307 | const maxCloseReason = maxControlPayload - 2 |
| 308 |