Sfoglia il codice sorgente

SendVia: don't emit a zero-length packet when prepareSendVia fails

JackDoan 3 mesi fa
parent
commit
cf2800f7bd
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      inside.go

+ 5 - 0
inside.go

@@ -522,6 +522,11 @@ func (f *Interface) SendVia(via *HostInfo,
 	nocopy bool,
 ) {
 	toSend, err := f.prepareSendVia(via, relay, ad, nb, out, nocopy)
+	if err != nil {
+		// already logged by prepareSendVia
+		return
+	}
+
 	err = f.writers[0].WriteTo(toSend, via.GetRemote())
 	if err != nil {
 		via.logger(f.l).Info("Failed to WriteTo in sendVia", "error", err)