Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
79a0d84e
Commit
79a0d84e
authored
Jun 17, 2016
by
Maxime Perrotin
Browse files
Back to swig malloc for the message queue
parent
0549280e
Changes
1
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/gui.py
View file @
79a0d84e
...
...
@@ -27,7 +27,7 @@ import logging
import
argparse
import
time
from
functools
import
partial
from
ctypes
import
CDLL
,
c_void_p
from
ctypes
import
CDLL
log
=
logging
.
getLogger
(
__name__
)
terminal_formatter
=
logging
.
Formatter
(
...
...
@@ -60,7 +60,7 @@ except ImportError:
datamodel
=
None
try
:
from
PythonController
import
(
OpenMsgQueueForReading
,
from
PythonController
import
(
OpenMsgQueueForReading
,
new_byte_SWIG_PTR
,
GetMsgQueueBufferSize
,
DV
,
RetrieveMessageFromQueue
)
python_controller
=
True
except
ImportError
:
...
...
@@ -93,9 +93,6 @@ class MsgQ_Poller(QThread):
self
.
Qname
=
"{uid}_{fvname}_PI_queue"
.
format
(
uid
=
str
(
os
.
geteuid
()),
fvname
=
datamodel
.
FVname
)
self
.
log
.
info
(
'msQ name= '
+
self
.
Qname
)
self
.
libc
=
CDLL
(
'libc.so.6'
)
self
.
malloc
=
self
.
libc
.
malloc
self
.
malloc
.
restype
=
c_void_p
def
run
(
self
):
self
.
log
.
debug
(
'Starting msgQ polling thread'
)
...
...
@@ -111,7 +108,7 @@ class MsgQ_Poller(QThread):
"Retrying..."
.
format
(
Qname
=
self
.
Qname
))
time
.
sleep
(
1
)
bufferSize
=
GetMsgQueueBufferSize
(
self
.
_msgQueue
)
pDataFromMQ
=
self
.
malloc
(
bufferSize
)
# DV.
new_byte_SWIG_PTR(bufferSize)
pDataFromMQ
=
new_byte_SWIG_PTR
(
bufferSize
)
while
not
self
.
_bDie
:
messageReceivedType
=
RetrieveMessageFromQueue
(
self
.
_msgQueue
,
bufferSize
,
pDataFromMQ
)
...
...
Write
Preview
Supports
Markdown
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