code: func (c ControlHandler) HandlePing(h ws.Header) error {
  	if h.Length == 0 {
  		// The most common case when ping is empty.
  		// Note that when sending masked frame the mask for empty payload is
  		// just four zero bytes.
  		return ws.WriteHeader(c.Dst, ws.Header{
  			Fin:    true,
  			OpCode: ws.OpPong,
  			Masked: c.State.ClientSide(),
  		})
  	}
  
  	// In other way reply with Pong frame with copied payload.
  	p := pbytes.GetLen(int(h.Length) + ws.HeaderSize(ws.Header{
  		Length: h.Length,
  		Masked: c.State.ClientSide(),
  	}))
  	defer pbytes.Put(p)
  
  	// Deal with ciphering i/o:
  	// Masking key is used to mask the "Payload data" defined in the same
  	// section as frame-payload-data, which includes "Extension data" and
  	// "Application data".
  	//
  	// See https://tools.ietf.org/html/rfc6455#section-5.3
  	//
  	// NOTE: We prefer ControlWriter with preallocated buffer to
  	// ws.WriteHeader because it performs one syscall instead of two.
  	w := NewControlWriterBuffer(c.Dst, c.State, ws.OpPong, p)
  	r := c.Src
  	if c.State.ServerSide() && !c.DisableSrcCiphering {
  		r = NewCipherReader(r, h.Mask)
  	}
  
  	_, err := io.Copy(w, r)
  	if err == nil {
  		err = w.Flush()
  	}
  
  	return err
  }
docs: // HandlePing handles ping frame and writes specification compatible response
  // to the c.Dst.