Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
81a5e3f3
Commit
81a5e3f3
authored
Jun 19, 2011
by
valenok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added mg_send_file() to python binding
parent
29a38875
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
example.py
bindings/python/example.py
+3
-0
mongoose.py
bindings/python/mongoose.py
+3
-0
No files found.
bindings/python/example.py
View file @
81a5e3f3
...
...
@@ -39,6 +39,9 @@ def EventHandler(event, conn, info):
'<input type="submit"/>'
'</form>'
)
return
True
elif
event
==
mongoose
.
NEW_REQUEST
and
info
.
uri
==
'/secret'
:
conn
.
send_file
(
'/etc/passwd'
)
return
True
else
:
return
False
...
...
bindings/python/mongoose.py
View file @
81a5e3f3
...
...
@@ -110,6 +110,9 @@ class Connection(object):
n
=
self
.
m
.
dll
.
mg_read
(
self
.
conn
,
buf
,
size
)
return
n
<=
0
and
None
or
buf
[:
n
]
def
send_file
(
self
,
path
):
self
.
m
.
dll
.
mg_send_file
(
self
.
conn
,
path
)
class
Mongoose
(
object
):
"""A wrapper class for Mongoose shared library."""
...
...
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