void NetworkJob::handleNotifyStatusReceived(int status, const String& message) { // Check for messages out of order or after cancel. if ((m_statusReceived && m_extendedStatusCode != 401) || m_responseSent || m_cancelled) return; if (isInfo(status)) return; // ignore m_statusReceived = true; // Convert non-HTTP status codes to generic HTTP codes. m_extendedStatusCode = status; if (!status) m_response.setHTTPStatusCode(200); else if (status < 0) m_response.setHTTPStatusCode(404); else m_response.setHTTPStatusCode(status); m_response.setHTTPStatusText(message); }
bool_t nlm_block_data_to_fsal_context(state_block_data_t * block_data, fsal_op_context_t * fsal_context) { exportlist_t * pexport = NULL; short exportid; fsal_status_t fsal_status; state_nlm_block_data_t * nlm_block_data = &block_data->sbd_block_data.sbd_nlm_block_data; /* Get export ID from handle */ exportid = nlm4_FhandleToExportId(&nlm_block_data->sbd_nlm_fh); /* Get export matching export ID */ if(exportid < 0 || (pexport = nfs_Get_export_by_id(nfs_param.pexportlist, exportid)) == NULL || (pexport->export_perms.options & EXPORT_OPTION_NFSV3) == 0) { /* Reject the request for authentication reason (incompatible file handle) */ if(isInfo(COMPONENT_NLM)) { char dumpfh[1024]; char *reason; char addrbuf[SOCK_NAME_MAX]; sprint_sockaddr(&nlm_block_data->sbd_nlm_hostaddr, addrbuf, sizeof(addrbuf)); if(exportid < 0) reason = "has badly formed handle"; else if(pexport == NULL) reason = "has invalid export"; else reason = "V3 not allowed on this export"; sprint_fhandle_nlm(dumpfh, &nlm_block_data->sbd_nlm_fh); LogMajor(COMPONENT_NLM, "NLM4 granted lock from host %s %s, FH=%s", addrbuf, reason, dumpfh); } return FALSE; } LogFullDebug(COMPONENT_NLM, "Found export entry for path=%s as exportid=%d", pexport->fullpath, pexport->id); /* Build the credentials */ fsal_status = FSAL_GetClientContext(fsal_context, &pexport->FS_export_context, block_data->sbd_credential.user, block_data->sbd_credential.group, block_data->sbd_credential.alt_groups, block_data->sbd_credential.nbgroups); if(FSAL_IS_ERROR(fsal_status)) { LogEvent(COMPONENT_NLM, "Could not get credentials for (uid=%d,gid=%d), fsal error=(%d,%d)", block_data->sbd_credential.user, block_data->sbd_credential.group, fsal_status.major, fsal_status.minor); return FALSE; } else LogDebug(COMPONENT_NLM, "FSAL Cred acquired for (uid=%d,gid=%d)", block_data->sbd_credential.user, block_data->sbd_credential.group); return TRUE; }