Example #1
0
func pushData(data string, framer *spdy.Framer, frame *spdy.SynStreamFrame) error {
	dataFrame := spdy.DataFrame{
		StreamId: frame.StreamId + 1,
		Flags:    spdy.DataFlagFin,
		Data:     []byte(data),
	}

	err := framer.WriteFrame(&dataFrame)
	if err != nil {
		return err
	}
	debug("push %v", &dataFrame)
	return nil
}
Example #2
0
func sendSynReply(header http.Header, framer *spdy.Framer, frame *spdy.SynStreamFrame) error {

	synReply := spdy.SynReplyFrame{
		CFHeader: spdy.ControlFrameHeader{}, // Flag is 0x00
		StreamId: frame.StreamId,
		Headers:  header,
	}

	err := framer.WriteFrame(&synReply)
	if err != nil {
		return err
	}
	debug("send %v", &synReply)
	return nil
}
Example #3
0
func sendSynStream(header http.Header, framer *spdy.Framer, frame *spdy.SynStreamFrame) error {
	synStreamFrame := spdy.SynStreamFrame{
		CFHeader: spdy.ControlFrameHeader{
			Flags: spdy.ControlFlagUnidirectional,
		},
		StreamId:             frame.StreamId + 1,
		Headers:              header,
		AssociatedToStreamId: frame.StreamId,
	}

	err := framer.WriteFrame(&synStreamFrame)
	if err != nil {
		return err
	}

	debug("push %v", &synStreamFrame)
	return nil
}