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.

123456789101112131415161718192021
  1. package fake
  2. import (
  3. "bytes"
  4. "sync"
  5. )
  6. var bytesPool = sync.Pool{
  7. New: func() any {
  8. return &bytes.Buffer{}
  9. },
  10. }
  11. func acquireBuffer() *bytes.Buffer {
  12. return bytesPool.Get().(*bytes.Buffer)
  13. }
  14. func releaseBuffer(b *bytes.Buffer) {
  15. b.Reset()
  16. bytesPool.Put(b)
  17. }