// virtual bool LLHTTPAssetStorage::deletePendingRequest(LLAssetStorage::ERequestType rt, LLAssetType::EType asset_type, const LLUUID& asset_id) { // Try removing this from the running list first. request_list_t* running = getRunningList(rt); if (running) { LLAssetRequest* req = findRequest(running, asset_type, asset_id); if (req) { // Remove this request from the running list to get it out of curl. running->remove(req); // Find this request in the pending list, so we can move it to the end of the line. request_list_t* pending = getRequestList(rt); if (pending) { request_list_t::iterator result = std::find_if(pending->begin(), pending->end(), std::bind2nd(ll_asset_request_equal<LLAssetRequest*>(), req)); if (pending->end() != result) { // This request was found in the pending list. Move it to the end! LLAssetRequest* pending_req = *result; pending->remove(pending_req); if (!pending_req->mIsUserWaiting) //A user is waiting on this request. Toss it. { pending->push_back(pending_req); } else { if (pending_req->mUpCallback) //Clean up here rather than _callUploadCallbacks because this request is already cleared the req. { pending_req->mUpCallback(pending_req->getUUID(), pending_req->mUserData, -1, LL_EXSTAT_REQUEST_DROPPED); } } llinfos << "Asset " << getRequestName(rt) << " request for " << asset_id << "." << LLAssetType::lookup(asset_type) << " removed from curl and placed at the end of the pending queue." << llendl; } else { llwarns << "Unable to find pending " << getRequestName(rt) << " request for " << asset_id << "." << LLAssetType::lookup(asset_type) << llendl; } } delete req; return true; } } return LLAssetStorage::deletePendingRequest(rt, asset_type, asset_id); }
// virtual bool LLHTTPAssetStorage::deletePendingRequest(LLAssetStorage::ERequestType rt, LLAssetType::EType asset_type, const LLUUID& asset_id) { // Try removing this from the running list first. request_list_t* running = getRunningList(rt); if (running) { LLAssetRequest* req = findRequest(running, asset_type, asset_id); if (req) { // Remove this request from the running list to get it out of curl. running->remove(req); // Find this request in the pending list, so we can move it to the end of the line. request_list_t* pending = getRequestList(rt); if (pending) { request_list_t::iterator result = std::find_if(pending->begin(), pending->end(), std::bind2nd(ll_asset_request_equal<LLAssetRequest*>(), req)); if (pending->end() != result) { // This request was found in the pending list. Move it to the end! LLAssetRequest* pending_req = *result; pending->remove(pending_req); pending->push_back(pending_req); llinfos << "Asset " << getRequestName(rt) << " request for " << asset_id << "." << LLAssetType::lookup(asset_type) << " removed from curl and placed at the end of the pending queue." << llendl; } else { llwarns << "Unable to find pending " << getRequestName(rt) << " request for " << asset_id << "." << LLAssetType::lookup(asset_type) << llendl; } } delete req; return true; } } return LLAssetStorage::deletePendingRequest(rt, asset_type, asset_id); }
void LLAssetStorage::_cleanupRequests(BOOL all, S32 error) { F64 mt_secs = LLMessageSystem::getMessageTimeSeconds(); request_list_t timed_out; S32 rt; for (rt = 0; rt < RT_COUNT; rt++) { request_list_t* requests = getRequestList((ERequestType)rt); for (request_list_t::iterator iter = requests->begin(); iter != requests->end(); ) { request_list_t::iterator curiter = iter++; LLAssetRequest* tmp = *curiter; // if all is true, we want to clean up everything // otherwise just check for timed out requests // EXCEPT for upload timeouts if (all || ((RT_DOWNLOAD == rt) && LL_ASSET_STORAGE_TIMEOUT < (mt_secs - tmp->mTime))) { llwarns << "Asset " << getRequestName((ERequestType)rt) << " request " << (all ? "aborted" : "timed out") << " for " << tmp->getUUID() << "." << LLAssetType::lookup(tmp->getType()) << llendl; timed_out.push_front(tmp); iter = requests->erase(curiter); } } } LLAssetInfo info; for (request_list_t::iterator iter = timed_out.begin(); iter != timed_out.end(); ) { request_list_t::iterator curiter = iter++; LLAssetRequest* tmp = *curiter; if (tmp->mUpCallback) { tmp->mUpCallback(tmp->getUUID(), tmp->mUserData, error, LL_EXSTAT_NONE); } if (tmp->mDownCallback) { tmp->mDownCallback(mVFS, tmp->getUUID(), tmp->getType(), tmp->mUserData, error, LL_EXSTAT_NONE); } if (tmp->mInfoCallback) { tmp->mInfoCallback(&info, tmp->mUserData, error); } delete tmp; } }
// virtual bool LLAssetStorage::deletePendingRequest(LLAssetStorage::ERequestType rt, LLAssetType::EType asset_type, const LLUUID& asset_id) { request_list_t* requests = getRequestList(rt); if (deletePendingRequestImpl(requests, asset_type, asset_id)) { llinfos << "Asset " << getRequestName(rt) << " request for " << asset_id << "." << LLAssetType::lookup(asset_type) << " removed from pending queue." << llendl; return true; } return false; }
void doGreatTopLevel() /* intermediate page for formats printed directly from top form */ { struct dyString *name = getRequestName(); htmlOpen("Send BED data to GREAT as %s", dyStringContents(name)); freeDyString(&name); verifyGreatAssemblies(); startGreatForm(); cgiMakeHiddenVar(hgtaDoTopSubmit, "get output"); printGreatSubmitButtons(); hPrintf("<div style='height:.9em;'></div>\n"); htmlClose(); }
void doSubmitToGreat(const char *path) /* Send a URL to GREAT that it can use to retrieve the results. */ { struct dyString *requestName = getRequestName(); struct dyString *requestURL = dyStringCreate("http://%s/%s", cgiServerNamePort(), path); struct dyString *greatRequest; greatRequest = dyStringCreate( "<meta http-equiv='refresh' content='0;url=http://great.stanford.edu/public/cgi-bin/greatStart.php?requestURL=%s&requestSpecies=%s&requestName=%s&requestSender=UCSC%20Table%20Browser'>", dyStringContents(requestURL), database, dyStringContents(requestName)); hPrintf("<b>GREAT</b> is processing BED data from \"%s\"...please wait.\n", dyStringContents(requestName)); hWrites(dyStringContents(greatRequest)); freeDyString(&greatRequest); freeDyString(&requestName); freeDyString(&requestURL); }