Commit ff11e2a
authored
protoc-gen-grpc-swift: FileHandle for stdin, stdout (#1361)
This fixes a case where the output response is silently truncated.
Truncation occurs because the `write` syscall is only invoked a single
time, but `write` may return a value indicating a partial write for
various reasons, even in a blocking call. For example, if stdout is a
nonblocking pipe, output is truncated when the pipe is full.
Instead of rewriting Stdout.write to handle this case, let's migrate to
FileHandle for I/O, available as of Swift 3.2.
swift-protobuf has already migrated, and this commit is mostly a port of
github.com/apple/swift-protobuf/commit/2ccad3484e06d180af3bd7be53c96d41e8f03a621 parent d796174 commit ff11e2a
2 files changed
+2
-66
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
0 commit comments