Commit 9d4dae23 authored by Denis Bilenko's avatar Denis Bilenko

evbuffer: add write()

--HG--
extra : transplant_source : M%C3%AFT%BF%F6%9F%F6XC%3E%D8%91J%5D0L%FD%FC%FE
parent a6aaf49d
......@@ -104,3 +104,9 @@ cdef class buffer:
def readlines(self, hint=-1):
return list(self)
def write(self, bytes data):
cdef int result = evbuffer_add(self.__obj, data, len(data))
if result < 0:
raise IOError("evbuffer_add() returned %s" % result)
return result
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment