Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223
  1. package packetack
  2. import (
  3. "bytes"
  4. "sync"
  5. )
  6. var (
  7. poolClientBytesBuffer = sync.Pool{
  8. New: func() interface{} {
  9. return &bytes.Buffer{}
  10. },
  11. }
  12. )
  13. func acquireClientBytesBuffer() *bytes.Buffer {
  14. return poolClientBytesBuffer.Get().(*bytes.Buffer)
  15. }
  16. func releaseClientBytesBuffer(buf *bytes.Buffer) {
  17. buf.Reset()
  18. poolClientBytesBuffer.Put(buf)
  19. }