Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for recvMessage (0.1 sec)

  1. src/encoding/gob/decoder.go

    	dec.wireType[id] = wire
    }
    
    var errBadCount = errors.New("invalid message length")
    
    // recvMessage reads the next count-delimited item from the input. It is the converse
    // of Encoder.writeMessage. It returns false on EOF or other error reading the message.
    func (dec *Decoder) recvMessage() bool {
    	// Read a count.
    	nbytes, _, err := decodeUintReader(dec.r, dec.countBuf)
    	if err != nil {
    		dec.err = err
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 7.2K bytes
    - Viewed (0)
  2. src/encoding/gob/encoder_test.go

    		if !reflect.DeepEqual(x, y) {
    			t.Errorf("ints: expected %q got %q\n", x, y)
    		}
    		if addr != &y[0] {
    			t.Errorf("ints: unnecessary reallocation")
    		}
    	}
    }
    
    // Used to crash: negative count in recvMessage.
    func TestBadCount(t *testing.T) {
    	b := []byte{0xfb, 0xa5, 0x82, 0x2f, 0xca, 0x1}
    	if err := NewDecoder(bytes.NewReader(b)).Decode(nil); err == nil {
    		t.Error("expected error from bad count")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 29.7K bytes
    - Viewed (0)
Back to top