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
+7 -1
View File
@@ -290,7 +290,13 @@ func setInboundSubmitResponse(packet any, messageID uint64, result uint32) {
func (s Server) submit(remote net.Addr, payload submitRequest) (submitResponse, error) {
payload.RemoteIP = remoteIP(remote)
var result submitResponse
err := s.post(context.Background(), "/gateway/events/inbound/submit", payload, &result)
client := s.SubmitHTTPClient
if client == nil {
client = s.HTTPClient
}
// Submit has a dedicated transport so protocol logs, receipt recovery and
// presence traffic cannot occupy the connections needed for SubmitResp.
err := s.postWithClient(context.Background(), client, "/gateway/events/inbound/submit", payload, &result)
return result, err
}