mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-29 08:19:42 +08:00
This commit is contained in:
parent
ec15f2da2b
commit
4619c1a71e
@ -57,6 +57,7 @@ class mg_header(ctypes.Structure):
|
|||||||
class mg_request_info(ctypes.Structure):
|
class mg_request_info(ctypes.Structure):
|
||||||
"""A wrapper for struct mg_request_info."""
|
"""A wrapper for struct mg_request_info."""
|
||||||
_fields_ = [
|
_fields_ = [
|
||||||
|
('user_data', ctypes.c_char_p),
|
||||||
('request_method', ctypes.c_char_p),
|
('request_method', ctypes.c_char_p),
|
||||||
('uri', ctypes.c_char_p),
|
('uri', ctypes.c_char_p),
|
||||||
('http_version', ctypes.c_char_p),
|
('http_version', ctypes.c_char_p),
|
||||||
@ -91,7 +92,7 @@ class Connection(object):
|
|||||||
return ctypes.c_char_p(val).value
|
return ctypes.c_char_p(val).value
|
||||||
|
|
||||||
def get_var(self, data, name):
|
def get_var(self, data, name):
|
||||||
size = len(data)
|
size = data and len(data) or 0
|
||||||
buf = ctypes.create_string_buffer(size)
|
buf = ctypes.create_string_buffer(size)
|
||||||
n = self.m.dll.mg_get_var(data, size, name, buf, size)
|
n = self.m.dll.mg_get_var(data, size, name, buf, size)
|
||||||
return n >= 0 and buf or None
|
return n >= 0 and buf or None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user