Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
python-cellframe
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
python-cellframe
Commits
64b02adc
Commit
64b02adc
authored
5 years ago
by
alexey.stratulat
Browse files
Options
Downloads
Patches
Plain Diff
[+] Added initialize modules Http, EncHttp, Stream, StreamCtl
parent
35a49621
No related branches found
Branches containing commit
No related tags found
1 merge request
!5
Urgently
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/python-cellframe.h
+6
-0
6 additions, 0 deletions
include/python-cellframe.h
libdap-stream-ch-chain-net-srv
+1
-0
1 addition, 0 deletions
libdap-stream-ch-chain-net-srv
src/python-cellframe.c
+48
-1
48 additions, 1 deletion
src/python-cellframe.c
with
55 additions
and
1 deletion
include/python-cellframe.h
+
6
−
0
View file @
64b02adc
...
...
@@ -26,6 +26,12 @@
#include
"wrapping_dap_chain_net_node_info.h"
#include
"wrapping_dap_chain_net_state.h"
// ============
#include
"wrapping_http.h"
#include
"wrapping_dap_enc_http.h"
#include
"wrapping_dap_stream.h"
#include
"wrapping_dap_stream_ctl.h"
#include
"dap_common.h"
...
...
This diff is collapsed.
Click to expand it.
libdap-stream-ch-chain-net-srv
@
1f34d256
Subproject commit 1f34d25645ec14af02ea9e79df4acdf4256f0682
This diff is collapsed.
Click to expand it.
src/python-cellframe.c
+
48
−
1
View file @
64b02adc
...
...
@@ -107,6 +107,43 @@ static PyObject *python_cellframe_init(PyObject *self, PyObject *args){
return
NULL
;
}
}
if
(
strcmp
(
c_value
,
"Http"
)
==
0
){
if
(
dap_http_init
()
!=
0
){
PyErr_SetString
(
CellFrame_error
,
"Failed to initialize Http module. "
);
return
NULL
;
}
}
if
(
strcmp
(
c_value
,
"EncHttp"
)
==
0
){
if
(
enc_http_init
()
!=
0
){
PyErr_SetString
(
CellFrame_error
,
"Failed to initialize EncHttp module. "
);
return
NULL
;
}
}
if
(
strcmp
(
c_value
,
"Stream"
)
==
0
){
PyObject
*
getStreamData
=
PyDict_GetItemString
(
result
,
"Stream"
);
if
(
getStreamData
==
NULL
){
PyErr_SetString
(
CellFrame_error
,
"Initialization failed. Stream object not found in JSON."
" No settings are specified for initializing libdap-stream-python."
);
return
NULL
;
}
PyObject
*
debugDumpStreamHeadersObj
=
PyDict_GetItemString
(
getStreamData
,
"DebugDumpStreamHeaders"
);
if
(
debugDumpStreamHeadersObj
==
NULL
||
!
PyBool_Check
(
debugDumpStreamHeadersObj
)){
PyErr_SetString
(
CellFrame_error
,
"Failed to initialize Stream. "
"Fields DebugDumpStreamHeaders are not boolean type."
);
return
NULL
;
}
bool
res_bollean
=
(
debugDumpStreamHeadersObj
==
Py_True
)
?
true
:
false
;
if
(
dap_stream_init
(
res_bollean
)
!=
0
){
PyErr_SetString
(
CellFrame_error
,
"Failed to initialize Stream module. "
);
return
NULL
;
}
}
if
(
strcmp
(
c_value
,
"StreamCtl"
)
==
0
){
if
(
dap_stream_ctl_init
(
DAP_ENC_KEY_TYPE_OAES
,
32
)
!=
0
){
PyErr_SetString
(
CellFrame_error
,
"Failed to initialize StreamCtl module. "
);
return
NULL
;
}
}
}
return
PyLong_FromLong
(
0
);
}
...
...
@@ -151,8 +188,13 @@ PyMODINIT_FUNC PyInit_CellFrame(void){
PyType_Ready
(
&
DapChainNodeClientObject_DapChainNodeClientObjectType
)
<
0
||
PyType_Ready
(
&
DapChainNodeInfoObject_DapChainNodeInfoObjectType
)
<
0
||
PyType_Ready
(
&
DapChainNetNodeObject_DapChainNetNodeObjectType
)
<
0
||
PyType_Ready
(
&
DapChainNetStateObject_DapChainNetStateObjectType
)
<
0
PyType_Ready
(
&
DapChainNetStateObject_DapChainNetStateObjectType
)
<
0
||
// =============
PyType_Ready
(
&
DapHTTP_DapHTTPType
)
<
0
||
PyType_Ready
(
&
DapEncHTTP_DapEncHTTPType
)
<
0
||
PyType_Ready
(
&
DapStream_DapStreamType
)
<
0
||
PyType_Ready
(
&
DapStreamCtl_DapStreamCtlType
)
<
0
)
return
NULL
;
...
...
@@ -216,6 +258,11 @@ PyMODINIT_FUNC PyInit_CellFrame(void){
PyModule_AddObject
(
module
,
"ChainNetState"
,
(
PyObject
*
)
&
DapChainNetStateObject_DapChainNetStateObjectType
);
// =============
PyModule_AddObject
(
module
,
"Http"
,
(
PyObject
*
)
&
DapHTTP_DapHTTPType
);
PyModule_AddObject
(
module
,
"EncHttp"
,
(
PyObject
*
)
&
DapEncHTTP_DapEncHTTPType
);
PyModule_AddObject
(
module
,
"Stream"
,
(
PyObject
*
)
&
DapStream_DapStreamType
);
PyModule_AddObject
(
module
,
"StreamCtl"
,
(
PyObject
*
)
&
DapStreamCtl_DapStreamCtlType
);
return
module
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment