Age | Commit message (Collapse) | Author |
|
|
|
limits.WriteTimeout
If
Timeout : 3s
ReadTimeout : 2s
WriteTimeout : 2s
Then before the effective total Timeout was 2s+2s=4s. That is wrong. It
should only be that the Write phase gets to use the full 2s if the Read
phase uses <= 1s.
|
|
|
|
Added types:
nslcd_server: type Limits struct { ...}
nslcd_server: type Conn interface{ ... } // a subset of net.Conn
nslcd_server.HandleRequest() signature change:
-func HandleRequest(backend Backend, in io.Reader, out io.Writer, cred unix.Ucred) (err error) {
+func HandleRequest(backend Backend, limits Limits, conn Conn, cred unix.Ucred) (err error) {
The `limits Limits` argument is added, and `conn Conn` replaces `in io.Reader` and `out io.Writer`.
nslcd_systemd.Main() signature change:
-func Main(backend Backend) uint8 {
+func Main(backend Backend, limits nslcd_server.Limits) uint8 {
The `limits Limits` argument is added.
|
|
Instead of having a separate channel+goroutine for the backend, just call
.Write() right where we get results from the backend, but don't let an
error cause us to stop reading from the backend, an error should just cause
us to stop writing. This ensures that the backend now always has its
output chan drained; before if there were a write error, the backend chan
wouldn't get drained, and the resources never released.
|
|
nslcd_proto.Read() and .Write() panic() with any errors that they may
need to emit. This made composition really simple, I was OK with it
being against the normal Go style.
But, I'm not happy with it anymore; have them return errors now.
This leads us in to nslcd_server.HandleRequest() using those panics
for control flow. Add a maybePanic(error) function to wrap all of the
proto.Read() and proto.Write() calls to restore the panicing behavior.
|
|
|
|
|
|
While it mostly played nice with autothing before, by having autothing
treat `go generate` as an opaque step, it didn't populate `files.src.gen`.
|
|
|
|
|
|
|
|
This is just a search/replace s/syscall/unix/g in the broken code.
|
|
|