Beispiel #1
0
func (m *initMessage) write(w *typed.WriteBuffer) error {
	w.WriteUint16(m.Version)
	w.WriteUint16(uint16(len(m.initParams)))

	for k, v := range m.initParams {
		w.WriteLen16String(k)
		w.WriteLen16String(v)
	}

	return w.Err()
}
Beispiel #2
0
func writeHeaders(wb *typed.WriteBuffer, form http.Header) {
	numHeadersDeferred := wb.DeferUint16()
	numHeaders := uint16(0)
	for k, values := range form {
		for _, v := range values {
			wb.WriteLen16String(k)
			wb.WriteLen16String(v)
			numHeaders++
		}
	}
	numHeadersDeferred.Update(numHeaders)
}
Beispiel #3
0
func (m *errorMessage) write(w *typed.WriteBuffer) error {
	w.WriteSingleByte(byte(m.errCode))
	m.tracing.write(w)
	w.WriteLen16String(m.message)
	return w.Err()
}