perf(cmpp): reserve transport for inbound submit

This commit is contained in:
hectorzhao
2026-08-20 18:23:01 +08:00
parent 6708f1f7c5
commit 229a0b28fd
10 changed files with 61 additions and 9 deletions
+4 -1
View File
@@ -15,7 +15,10 @@ import (
const maxAPIResponseBodyBytes int64 = 4 * 1024 * 1024
func (s Server) post(ctx context.Context, path string, payload any, result any) error {
client := s.HTTPClient
return s.postWithClient(ctx, s.HTTPClient, path, payload, result)
}
func (s Server) postWithClient(ctx context.Context, client *http.Client, path string, payload any, result any) error {
if client == nil {
client = &http.Client{Timeout: defaultHTTPTimeout}
}