Skip to content

Commit

Permalink
fix udt_array > 252 as input parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
sijms committed May 8, 2024
1 parent f87ead8 commit 6c7cc4d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion v2/parameter_encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,12 @@ func (par *ParameterInfo) encodePrimValue(conn *Connection) error {
arrayBuffer := bytes.Buffer{}
if par.DataType == XMLType {
arrayBuffer.Write([]byte{1, 3})
session.WriteUint(&arrayBuffer, par.MaxNoOfArrayElements, 2, true, false)
if par.MaxNoOfArrayElements > 0xFC {
session.WriteUint(&arrayBuffer, 0xFE, 2, true, false)
session.WriteUint(&arrayBuffer, par.MaxNoOfArrayElements, 4, true, false)
} else {
session.WriteUint(&arrayBuffer, par.MaxNoOfArrayElements, 2, true, false)
}
} else {
session.WriteUint(&arrayBuffer, par.MaxNoOfArrayElements, 4, true, true)
}
Expand Down

0 comments on commit 6c7cc4d

Please sign in to comment.