From e43eb4da7b478e14c38d6b14255ddaf702cde285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Thu, 14 May 2020 12:09:56 +0200 Subject: [PATCH] upload/koji: make the hexdigest field consistent We usually try to match the field name with its json/toml/xmlrpc tag. This commit does exactly that. --- internal/upload/koji/koji.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/upload/koji/koji.go b/internal/upload/koji/koji.go index 40376a555..ee7954423 100644 --- a/internal/upload/koji/koji.go +++ b/internal/upload/koji/koji.go @@ -245,8 +245,8 @@ func (k *Koji) uploadChunk(chunk []byte, filepath, filename string, offset uint6 } var reply struct { - Size int `xmlrpc:"size"` - Adler32 string `xmlrpc:"hexdigest"` + Size int `xmlrpc:"size"` + HexDigest string `xmlrpc:"hexdigest"` } err = xmlrpc.Response.Unmarshal(body, &reply) @@ -259,8 +259,8 @@ func (k *Koji) uploadChunk(chunk []byte, filepath, filename string, offset uint6 } digest := fmt.Sprintf("%08x", adler32.Checksum(chunk)) - if reply.Adler32 != digest { - return fmt.Errorf("Sent a chunk with Adler32 digest %s, but server computed digest %s", digest, reply.Adler32) + if reply.HexDigest != digest { + return fmt.Errorf("Sent a chunk with Adler32 digest %s, but server computed digest %s", digest, reply.HexDigest) } return nil