Merge: Basename fix
[nit.git] / lib / libevent.nit
index 7db0169..7794ed5 100644 (file)
@@ -157,7 +157,7 @@ class Connection
        # Write a string to the connection
        redef fun write(str)
        do
-               native_buffer_event.write(str.to_cstring, str.length)
+               native_buffer_event.write(str.to_cstring, str.bytelen)
        end
 
        redef fun write_byte(byte) do native_buffer_event.write_byte(byte)
@@ -186,9 +186,9 @@ extern class NativeBufferEvent `{ struct bufferevent * `}
        `}
 
        # Write the byte `value`
-       fun write_byte(value: Int): Int `{
+       fun write_byte(value: Byte): Int `{
                unsigned char byt = (unsigned char)value;
-               return bufferevent_write(recv, &byt, 1);
+               return bufferevent_write(self, &byt, 1);
        `}
 
        # Check if we have anything left in our buffers. If so, we set our connection to be closed