Skip to content

Commit 05147e5

Browse files
committed
Fix. Raise error form progress function.
1 parent bd2cbd6 commit 05147e5

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/lceasy.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,11 +775,14 @@ static int lcurl_xferinfo_callback(void *arg, curl_off_t dltotal, curl_off_t dln
775775
assert(lua_gettop(L) >= top);
776776
lua_pushlightuserdata(L, (void*)LCURL_ERROR_TAG);
777777
lua_insert(L, top+1);
778-
return 0;
778+
return 1;
779779
}
780780

781781
if(lua_gettop(L) > top){
782-
if(lua_isnil(L, top + 1)) return 1;
782+
if(lua_isnil(L, top + 1)){
783+
if(lua_gettop(L) == (top+1)) lua_settop(L, top);
784+
return 1;
785+
}
783786
if(lua_isboolean(L, top + 1))
784787
ret = lua_toboolean(L, top + 1)?0:1;
785788
else ret = (size_t)lua_tonumber(L, top + 1);

0 commit comments

Comments
 (0)