SentHeaderBytes 计算发送的Header字节数
()
| 827 | |
| 828 | // SentHeaderBytes 计算发送的Header字节数 |
| 829 | func (this *HTTPWriter) SentHeaderBytes() int64 { |
| 830 | if this.sentHeaderBytes > 0 { |
| 831 | return this.sentHeaderBytes |
| 832 | } |
| 833 | for k, v := range this.Header() { |
| 834 | for _, v1 := range v { |
| 835 | this.sentHeaderBytes += int64(len(k) + 2 + len(v1) + 1) |
| 836 | } |
| 837 | } |
| 838 | return this.sentHeaderBytes |
| 839 | } |
| 840 | |
| 841 | func (this *HTTPWriter) SetSentHeaderBytes(sentHeaderBytes int64) { |
| 842 | this.sentHeaderBytes = sentHeaderBytes |