aboutsummaryrefslogtreecommitdiff
path: root/network/protocol/pktline/encoder.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-28 20:03:38 +0000
committerGravatar Runxi Yu2026-03-28 20:03:38 +0000
commit3f9bd8f121b07e30227dac7005e9072ba1a1bdc5 (patch)
treeabe5b3950f1e170d88c9228f53d8db20ea212b17 /network/protocol/pktline/encoder.go
parentnetwork, internal/progress, format/packfile/ingest: Use WriteFlusher (diff)
signatureNo signature
network: Rename flush (clearly distinguish flushing IO and writing flush packets)
Diffstat (limited to 'network/protocol/pktline/encoder.go')
-rw-r--r--network/protocol/pktline/encoder.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/network/protocol/pktline/encoder.go b/network/protocol/pktline/encoder.go
index 3d92ca19..4c7dcd6e 100644
--- a/network/protocol/pktline/encoder.go
+++ b/network/protocol/pktline/encoder.go
@@ -87,36 +87,36 @@ func (e *Encoder) WriteString(s string) (int, error) {
return len(s), nil
}
-// WriteFlush writes control frame 0000 (flush-pkt).
-func (e *Encoder) WriteFlush() error {
+// WriteFlushPacket writes control frame 0000 (flush-pkt).
+func (e *Encoder) WriteFlushPacket() error {
return e.writeControl(0)
}
-// WriteDelim writes control frame 0001 (delim-pkt).
-func (e *Encoder) WriteDelim() error {
+// WriteDelimPacket writes control frame 0001 (delim-pkt).
+func (e *Encoder) WriteDelimPacket() error {
return e.writeControl(1)
}
-// WriteResponseEnd writes control frame 0002 (response-end-pkt).
-func (e *Encoder) WriteResponseEnd() error {
+// WriteResponseEndPacket writes control frame 0002 (response-end-pkt).
+func (e *Encoder) WriteResponseEndPacket() error {
return e.writeControl(2)
}
-// FlushIO flushes buffered output in the underlying transport.
+// Flush flushes buffered output in the underlying transport.
//
-// FlushIO does not emit any pkt-line control frame.
-func (e *Encoder) FlushIO() error {
+// Flush does not emit any pkt-line control frame.
+func (e *Encoder) Flush() error {
return e.w.Flush()
}
-// WriteFlushAndFlushIO writes a flush-pkt (0000) then flushes transport I/O.
-func (e *Encoder) WriteFlushAndFlushIO() error {
- err := e.WriteFlush()
+// WriteFlushPacketAndFlush writes a flush-pkt (0000) then flushes transport I/O.
+func (e *Encoder) WriteFlushPacketAndFlush() error {
+ err := e.WriteFlushPacket()
if err != nil {
return err
}
- return e.FlushIO()
+ return e.Flush()
}
func (e *Encoder) writeControl(n int) error {