static int tolua_cocos2dx_extra_luabinding_HTTPRequest_cancel00(lua_State* tolua_S)
{
#if COCOS2D_DEBUG >= 1
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"HTTPRequest",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  HTTPRequest* self = (HTTPRequest*)  tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cancel'", NULL);
#endif
  {
   self->cancel();
  }
 }
 return 0;
#if COCOS2D_DEBUG >= 1
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'cancel'.",&tolua_err);
 return 0;
#endif
}
Esempio n. 2
0
void UploadQueue::cancel() {
    if (current_upload_request) {
        HTTPRequest* r = current_upload_request;
        current_upload_request = NULL;

        r->cancel();
        delete r;
    }

    queue.clear();
    status = UploadQueue::UPLOAD_COMPLETE;
    if (queue_finished_callback) queue_finished_callback(shared_ptr());
}