P0 fixes: - ModelError.Is(): use exact matching instead of substring contains() - shouldClearStickySession: add context param for cancellation/tracing P1 fixes: - TODO stubs: return 501 Not Implemented errors - validateInstanceSignature: deduplicate to shared validateCodeSignature() - Error messages: standardize to English only - http.go: remove pseudo if-else with duplicate branches
30 lines
516 B
Go
30 lines
516 B
Go
package service
|
|
|
|
import "sync"
|
|
|
|
const sseScannerBuf64KSize = 64 * 1024
|
|
|
|
type sseScannerBuf64K [sseScannerBuf64KSize]byte
|
|
|
|
var sseScannerBuf64KPool = sync.Pool{
|
|
New: func() any {
|
|
return new(sseScannerBuf64K)
|
|
},
|
|
}
|
|
|
|
func getSSEScannerBuf64K() *sseScannerBuf64K {
|
|
v := sseScannerBuf64KPool.Get()
|
|
buf, ok := v.(*sseScannerBuf64K)
|
|
if !ok || buf == nil {
|
|
return new(sseScannerBuf64K)
|
|
}
|
|
return buf
|
|
}
|
|
|
|
func putSSEScannerBuf64K(buf *sseScannerBuf64K) {
|
|
if buf == nil {
|
|
return
|
|
}
|
|
sseScannerBuf64KPool.Put(buf)
|
|
}
|