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"
3232 weight = 4
3333
3434[params ]
35- version = " 2.4.0 "
35+ version = " 2.4.1 "
Original file line number Diff line number Diff line change 88
99# Changelog
1010
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+
1117## 2.4.0
1218
1319** Features:**
Original file line number Diff line number Diff line change @@ -293,7 +293,12 @@ func (b *Backend) readPackets() error {
293293 for {
294294 i , addr , err := b .conn .ReadFromUDP (buf )
295295 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
297302 }
298303 data := make ([]byte , i )
299304 copy (data , buf [:i ])
@@ -325,7 +330,11 @@ func (b *Backend) sendPackets() error {
325330 }).Info ("gateway: sending udp packet to gateway" )
326331
327332 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" )
329338 }
330339 }
331340 return nil
You can’t perform that action at this time.
0 commit comments