Skip to content

Commit dde186c

Browse files
torsmcopybara-github
authored andcommitted
Add missing error check to streaming communicator
PiperOrigin-RevId: 756783228
1 parent 144466f commit dde186c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fleetspeak/src/client/https/streaming.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ func (c *StreamingCommunicator) connect(ctx context.Context, host string, maxLif
313313
canceled <- true
314314
}
315315
}()
316-
// We also need to feed the intital data into the pipe while Do
316+
// We also need to feed the initial data into the pipe while Do
317317
// executes.
318318
ret.working.Add(1)
319319
go func() {
@@ -390,7 +390,7 @@ type connection struct {
390390
pendingLock sync.Mutex
391391

392392
serverDone chan struct{} // done message received from server
393-
writingDone chan struct{} // writeloop finished
393+
writingDone chan struct{} // writeLoop finished
394394

395395
// Used to wait until everything is done.
396396
working sync.WaitGroup
@@ -523,7 +523,7 @@ func (c *connection) writeLoop(bw BodyWriter) {
523523
return
524524
}
525525
bufWritten, err := bw.Write(buf)
526-
bw.Flush()
526+
err = errors.Join(err, bw.Flush())
527527
c.cctx.Stats().OutboundContactData(c.host, bufWritten, err)
528528
if err != nil {
529529
if c.ctx.Err() == nil {

0 commit comments

Comments
 (0)