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.
This commit is contained in:
parent
184cd24426
commit
e43eb4da7b
1 changed files with 4 additions and 4 deletions
|
|
@ -245,8 +245,8 @@ func (k *Koji) uploadChunk(chunk []byte, filepath, filename string, offset uint6
|
||||||
}
|
}
|
||||||
|
|
||||||
var reply struct {
|
var reply struct {
|
||||||
Size int `xmlrpc:"size"`
|
Size int `xmlrpc:"size"`
|
||||||
Adler32 string `xmlrpc:"hexdigest"`
|
HexDigest string `xmlrpc:"hexdigest"`
|
||||||
}
|
}
|
||||||
|
|
||||||
err = xmlrpc.Response.Unmarshal(body, &reply)
|
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))
|
digest := fmt.Sprintf("%08x", adler32.Checksum(chunk))
|
||||||
if reply.Adler32 != digest {
|
if reply.HexDigest != digest {
|
||||||
return fmt.Errorf("Sent a chunk with Adler32 digest %s, but server computed digest %s", digest, reply.Adler32)
|
return fmt.Errorf("Sent a chunk with Adler32 digest %s, but server computed digest %s", digest, reply.HexDigest)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue