File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ type Receiver struct {
28
28
MergeCleanupInterval time.Duration // How often to cleanup expired message parts
29
29
TLS * tls.Config
30
30
Handler HandlerFunc
31
+ SkipAutoRespondIDs []pdu.ID
31
32
32
33
chanClose chan struct {}
33
34
@@ -134,6 +135,15 @@ func (r *Receiver) bindFunc(c Conn) error {
134
135
return nil
135
136
}
136
137
138
+ func idInList (id pdu.ID , list []pdu.ID ) bool {
139
+ for _ , x := range list {
140
+ if x == id {
141
+ return true
142
+ }
143
+ }
144
+ return false
145
+ }
146
+
137
147
func (r * Receiver ) handlePDU () {
138
148
var (
139
149
ok bool
@@ -143,6 +153,7 @@ func (r *Receiver) handlePDU() {
143
153
mh * MergeHolder
144
154
orderedBodies []* bytes.Buffer
145
155
)
156
+ autoRespondDeliver := ! idInList (pdu .DeliverSMID , r .SkipAutoRespondIDs )
146
157
147
158
loop:
148
159
for {
@@ -151,7 +162,7 @@ loop:
151
162
break
152
163
}
153
164
154
- if p .Header ().ID == pdu .DeliverSMID { // Send DeliverSMResp
165
+ if p .Header ().ID == pdu .DeliverSMID && autoRespondDeliver { // Send DeliverSMResp
155
166
pResp := pdu .NewDeliverSMRespSeq (p .Header ().Seq )
156
167
r .cl .Write (pResp )
157
168
}
You can’t perform that action at this time.
0 commit comments