Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
c810a2b8
Commit
c810a2b8
authored
Sep 21, 2022
by
oroulet
Committed by
oroulet
Sep 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix wrong limit tests
parent
1240d7b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
asyncua/common/connection.py
asyncua/common/connection.py
+5
-5
No files found.
asyncua/common/connection.py
View file @
c810a2b8
...
...
@@ -36,18 +36,18 @@ class TransportLimits:
return
hint
return
ua
.
UInt32
(
limit
)
def
check_max_msg_size
(
self
,
sz
:
int
)
->
bool
:
def
is_msg_size_within_limit
(
self
,
sz
:
int
)
->
bool
:
if
self
.
max_message_size
==
0
:
return
True
within_limit
=
s
elf
.
max_message_size
<=
sz
within_limit
=
s
z
<=
self
.
max_message_size
if
not
within_limit
:
logger
.
error
(
"Message size: %s is > configured max message size: %s"
,
sz
,
self
.
max_message_size
)
return
within_limit
def
check_max_chunk_coun
t
(
self
,
sz
:
int
)
->
bool
:
def
is_chunk_count_within_limi
t
(
self
,
sz
:
int
)
->
bool
:
if
self
.
max_chunk_count
==
0
:
return
True
within_limit
=
s
elf
.
max_chunk_count
<=
sz
within_limit
=
s
z
<=
self
.
max_chunk_count
if
not
within_limit
:
logger
.
error
(
"Number of message chunks: %s is > configured max chunk count: %s"
,
sz
,
self
.
max_chunk_count
)
return
within_limit
...
...
@@ -430,7 +430,7 @@ class SecureConnection:
raise
ua
.
UaStatusCodeError
(
ua
.
StatusCodes
.
BadRequestTooLarge
)
self
.
_check_incoming_chunk
(
msg
)
self
.
_incoming_parts
.
append
(
msg
)
if
not
self
.
_limits
.
check_max_chunk_coun
t
(
len
(
self
.
_incoming_parts
)):
if
not
self
.
_limits
.
is_chunk_count_within_limi
t
(
len
(
self
.
_incoming_parts
)):
self
.
_incoming_parts
=
[]
raise
ua
.
UaStatusCodeError
(
ua
.
StatusCodes
.
BadRequestTooLarge
)
if
msg
.
MessageHeader
.
ChunkType
==
ua
.
ChunkType
.
Intermediate
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment