moonbridge

changeset 82:069ee3f5ab17

Non-blocking write methods shall return io handle
author jbe
date Mon Apr 06 03:41:30 2015 +0200 (2015-04-06)
parents e1aec772a6ab
children 697cdf8e2000
files moonbridge_io.c
line diff
     1.1 --- a/moonbridge_io.c	Mon Apr 06 03:36:37 2015 +0200
     1.2 +++ b/moonbridge_io.c	Mon Apr 06 03:41:30 2015 +0200
     1.3 @@ -170,10 +170,11 @@
     1.4        }
     1.5      }
     1.6      handle->writebufcnt = 0;
     1.7 -    lua_pushinteger(L, 0);
     1.8 +    if (nonblocking) lua_pushinteger(L, 0);
     1.9    } else {
    1.10 -    lua_pushinteger(L, handle->writeleft - handle->writebufcnt);
    1.11 +    if (nonblocking) lua_pushinteger(L, handle->writeleft - handle->writebufcnt);
    1.12    }
    1.13 +  if (!nonblocking) lua_pushvalue(L, 1);
    1.14    return 1;
    1.15    moonbr_io_write_impl_block:
    1.16    if (flush) lua_pushinteger(L, handle->writeleft);

Impressum / About Us