File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -32,4 +32,4 @@ googleAnalytics = "UA-3512995-9"
32
32
weight = 4
33
33
34
34
[params ]
35
- version = " 2.4.0 "
35
+ version = " 2.4.1 "
Original file line number Diff line number Diff line change 8
8
9
9
# Changelog
10
10
11
+ ## 2.4.1
12
+
13
+ ** Bugfixes:**
14
+
15
+ * Only log in case of UDP read / write errors (instead of breaking out of loop).
16
+
11
17
## 2.4.0
12
18
13
19
** Features:**
Original file line number Diff line number Diff line change @@ -293,7 +293,12 @@ func (b *Backend) readPackets() error {
293
293
for {
294
294
i , addr , err := b .conn .ReadFromUDP (buf )
295
295
if err != nil {
296
- return fmt .Errorf ("gateway: read from udp error: %s" , err )
296
+ if b .closed {
297
+ return nil
298
+ }
299
+
300
+ log .WithError (err ).Error ("gateway: read from udp error" )
301
+ continue
297
302
}
298
303
data := make ([]byte , i )
299
304
copy (data , buf [:i ])
@@ -325,7 +330,11 @@ func (b *Backend) sendPackets() error {
325
330
}).Info ("gateway: sending udp packet to gateway" )
326
331
327
332
if _ , err := b .conn .WriteToUDP (p .data , p .addr ); err != nil {
328
- return err
333
+ log .WithFields (log.Fields {
334
+ "addr" : p .addr ,
335
+ "type" : pt ,
336
+ "protocol_version" : p .data [0 ],
337
+ }).WithError (err ).Error ("gateway: write to udp error" )
329
338
}
330
339
}
331
340
return nil
You can’t perform that action at this time.
0 commit comments