Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython-lwan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Bryton Lacquement
cython-lwan
Commits
e96824e2
Commit
e96824e2
authored
Jul 06, 2018
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch url map definition to list of dictionaries
parent
f470aa1f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
lwan_wrapper.pyx
lwan_wrapper.pyx
+5
-10
No files found.
lwan_wrapper.pyx
View file @
e96824e2
from
libc.string
cimport
strlen
from
libc.stdlib
cimport
calloc
,
free
cdef
extern
from
"lwan/lwan.h"
nogil
:
struct
lwan
:
...
...
@@ -57,13 +56,11 @@ cdef lwan_http_status handle_fibonacci(lwan_request *request, lwan_response *res
def
run
():
cdef
:
lwan
l
lwan_url_map
*
default_map
=
<
lwan_url_map
*>
calloc
(
3
,
sizeof
(
lwan_url_map
))
default_map
[
0
].
prefix
=
"/"
default_map
[
0
].
handler
=
handle_root
default_map
[
1
].
prefix
=
"/fibonacci"
default_map
[
1
].
handler
=
handle_fibonacci
default_map
[
2
].
prefix
=
NULL
lwan_url_map
*
default_map
=
[
{
"prefix"
:
"/"
,
"handler"
:
handle_root
},
{
"prefix"
:
"/fibonacci"
,
"handler"
:
handle_fibonacci
},
{
"prefix"
:
NULL
}
]
with
nogil
:
lwan_init
(
&
l
)
...
...
@@ -72,5 +69,3 @@ def run():
lwan_main_loop
(
&
l
)
lwan_shutdown
(
&
l
)
free
(
default_map
)
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