예제 #1
0
func (fh *FrameHeader) read(r *typed.ReadBuffer) error {
	fh.size = r.ReadUint16()
	fh.messageType = messageType(r.ReadSingleByte())
	fh.reserved1 = r.ReadSingleByte()
	fh.ID = r.ReadUint32()
	r.ReadBytes(len(fh.reserved))
	return r.Err()
}
예제 #2
0
파일: buf.go 프로젝트: gosuper/tchannel-go
func readHeaders(rb *typed.ReadBuffer, form http.Header) {
	numHeaders := rb.ReadUint16()
	for i := 0; i < int(numHeaders); i++ {
		k := rb.ReadLen16String()
		v := rb.ReadLen16String()
		form[k] = append(form[k], v)
	}
}
예제 #3
0
func (m *initMessage) read(r *typed.ReadBuffer) error {
	m.Version = r.ReadUint16()

	m.initParams = initParams{}
	np := r.ReadUint16()
	for i := 0; i < int(np); i++ {
		k := r.ReadLen16String()
		v := r.ReadLen16String()
		m.initParams[k] = v
	}

	return r.Err()
}