mirror of
https://github.com/containers/skopeo.git
synced 2025-04-28 11:14:08 +00:00
proxy: Add various debug logging
To aid debugging https://github.com/ostreedev/ostree-rs-ext/issues/657 Signed-off-by: Colin Walters <walters@verbum.org>
This commit is contained in:
parent
5fece3398f
commit
3f66d002f2
@ -687,6 +687,7 @@ func (h *proxyHandler) FinishPipe(args []any) (replyBuf, error) {
|
|||||||
|
|
||||||
// Wait for the goroutine to complete
|
// Wait for the goroutine to complete
|
||||||
f.wg.Wait()
|
f.wg.Wait()
|
||||||
|
logrus.Debug("Completed pipe goroutine")
|
||||||
// And only now do we close the write half; this forces the client to call this API
|
// And only now do we close the write half; this forces the client to call this API
|
||||||
f.w.Close()
|
f.w.Close()
|
||||||
// Propagate any errors from the goroutine worker
|
// Propagate any errors from the goroutine worker
|
||||||
@ -708,6 +709,7 @@ func (h *proxyHandler) close() {
|
|||||||
|
|
||||||
// send writes a reply buffer to the socket
|
// send writes a reply buffer to the socket
|
||||||
func (buf replyBuf) send(conn *net.UnixConn, err error) error {
|
func (buf replyBuf) send(conn *net.UnixConn, err error) error {
|
||||||
|
logrus.Debugf("Sending reply: err=%v value=%v pipeid=%v", err, buf.value, buf.pipeid)
|
||||||
replyToSerialize := reply{
|
replyToSerialize := reply{
|
||||||
Success: err == nil,
|
Success: err == nil,
|
||||||
Value: buf.value,
|
Value: buf.value,
|
||||||
@ -782,6 +784,8 @@ func (h *proxyHandler) processRequest(readBytes []byte) (rb replyBuf, terminate
|
|||||||
err = fmt.Errorf("invalid request: %v", err)
|
err = fmt.Errorf("invalid request: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
logrus.Debugf("Executing method %s", req.Method, err)
|
||||||
|
|
||||||
// Dispatch on the method
|
// Dispatch on the method
|
||||||
switch req.Method {
|
switch req.Method {
|
||||||
case "Initialize":
|
case "Initialize":
|
||||||
@ -845,6 +849,7 @@ func (opts *proxyOptions) run(args []string, stdout io.Writer) error {
|
|||||||
|
|
||||||
rb, terminate, err := handler.processRequest(readbuf)
|
rb, terminate, err := handler.processRequest(readbuf)
|
||||||
if terminate {
|
if terminate {
|
||||||
|
logrus.Debug("terminating")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user