Fix. Raise error form progress function.

This commit is contained in:
Alexey Melnichuk 2014-09-05 15:55:23 +05:00
parent bd2cbd6010
commit 05147e5b30

View File

@ -775,11 +775,14 @@ static int lcurl_xferinfo_callback(void *arg, curl_off_t dltotal, curl_off_t dln
assert(lua_gettop(L) >= top);
lua_pushlightuserdata(L, (void*)LCURL_ERROR_TAG);
lua_insert(L, top+1);
return 0;
return 1;
}
if(lua_gettop(L) > top){
if(lua_isnil(L, top + 1)) return 1;
if(lua_isnil(L, top + 1)){
if(lua_gettop(L) == (top+1)) lua_settop(L, top);
return 1;
}
if(lua_isboolean(L, top + 1))
ret = lua_toboolean(L, top + 1)?0:1;
else ret = (size_t)lua_tonumber(L, top + 1);