return;
}
- if (r->method == METHOD_PURGE) {
+ if (r->method == Http::METHOD_PURGE) {
removeClientStoreReference(&sc, http);
e = NULL;
purgeRequest();
}
/** Check if its a PURGE request to be actioned. */
- if (r->method == METHOD_PURGE) {
+ if (r->method == Http::METHOD_PURGE) {
purgeRequest();
return;
}
/** Check if its an 'OTHER' request. Purge all cached entries if so and continue. */
- if (r->method == METHOD_OTHER) {
+ if (r->method == Http::METHOD_OTHER) {
purgeAllCached();
}
// TODO: can we use purgeAllCached() here instead of doing the
// getPublicByRequestMethod() dance?
- StoreEntry::getPublicByRequestMethod(this, http->request, METHOD_GET);
+ StoreEntry::getPublicByRequestMethod(this, http->request, Http::METHOD_GET);
}
// Purges all entries with a given url
bool get_or_head_sent = false;
#endif
- for (HttpRequestMethod m(METHOD_NONE); m != METHOD_ENUM_END; ++m) {
- if (m.isCacheble()) {
+ for (HttpRequestMethod m(Http::METHOD_NONE); m != Http::METHOD_ENUM_END; ++m) {
+ if (m.respMaybeCacheable()) {
if (StoreEntry *entry = storeGetPublic(url, m)) {
debugs(88, 5, "purging " << RequestMethodStr(m) << ' ' << url);
#if USE_HTCP
neighborsHtcpClear(entry, url, req, m, HTCP_CLR_INVALIDATION);
- if (m == METHOD_GET || m == METHOD_HEAD) {
+ if (m == Http::METHOD_GET || m == Http::METHOD_HEAD) {
get_or_head_sent = true;
}
#endif
#if USE_HTCP
if (!get_or_head_sent) {
- neighborsHtcpClear(NULL, url, req, HttpRequestMethod(METHOD_GET), HTCP_CLR_INVALIDATION);
+ neighborsHtcpClear(NULL, url, req, HttpRequestMethod(Http::METHOD_GET), HTCP_CLR_INVALIDATION);
}
#endif
}
{
if (newEntry->isNull()) {
lookingforstore = 2;
- StoreEntry::getPublicByRequestMethod(this, http->request, METHOD_HEAD);
+ StoreEntry::getPublicByRequestMethod(this, http->request, Http::METHOD_HEAD);
} else
purgeFoundObject (newEntry);
}
{
http->logType = LOG_TCP_MISS;
lookingforstore = 3;
- StoreEntry::getPublicByRequestMethod(this,http->request, METHOD_GET);
+ StoreEntry::getPublicByRequestMethod(this,http->request, Http::METHOD_GET);
}
void
/* Release the cached URI */
debugs(88, 4, "clientPurgeRequest: GET '" << newEntry->url() << "'" );
#if USE_HTCP
- neighborsHtcpClear(newEntry, NULL, http->request, HttpRequestMethod(METHOD_GET), HTCP_CLR_PURGE);
+ neighborsHtcpClear(newEntry, NULL, http->request, HttpRequestMethod(Http::METHOD_GET), HTCP_CLR_PURGE);
#endif
newEntry->release();
purgeStatus = HTTP_OK;
}
lookingforstore = 4;
- StoreEntry::getPublicByRequestMethod(this, http->request, METHOD_HEAD);
+ StoreEntry::getPublicByRequestMethod(this, http->request, Http::METHOD_HEAD);
}
void
if (newEntry && !newEntry->isNull()) {
debugs(88, 4, "clientPurgeRequest: HEAD '" << newEntry->url() << "'" );
#if USE_HTCP
- neighborsHtcpClear(newEntry, NULL, http->request, HttpRequestMethod(METHOD_HEAD), HTCP_CLR_PURGE);
+ neighborsHtcpClear(newEntry, NULL, http->request, HttpRequestMethod(Http::METHOD_HEAD), HTCP_CLR_PURGE);
#endif
newEntry->release();
purgeStatus = HTTP_OK;
if (http->request->vary_headers
&& !strstr(http->request->vary_headers, "=")) {
- StoreEntry *entry = storeGetPublic(urlCanonical(http->request), METHOD_GET);
+ StoreEntry *entry = storeGetPublic(urlCanonical(http->request), Http::METHOD_GET);
if (entry) {
debugs(88, 4, "clientPurgeRequest: Vary GET '" << entry->url() << "'" );
#if USE_HTCP
- neighborsHtcpClear(entry, NULL, http->request, HttpRequestMethod(METHOD_GET), HTCP_CLR_PURGE);
+ neighborsHtcpClear(entry, NULL, http->request, HttpRequestMethod(Http::METHOD_GET), HTCP_CLR_PURGE);
#endif
entry->release();
purgeStatus = HTTP_OK;
}
- entry = storeGetPublic(urlCanonical(http->request), METHOD_HEAD);
+ entry = storeGetPublic(urlCanonical(http->request), Http::METHOD_HEAD);
if (entry) {
debugs(88, 4, "clientPurgeRequest: Vary HEAD '" << entry->url() << "'" );
#if USE_HTCP
- neighborsHtcpClear(entry, NULL, http->request, HttpRequestMethod(METHOD_HEAD), HTCP_CLR_PURGE);
+ neighborsHtcpClear(entry, NULL, http->request, HttpRequestMethod(Http::METHOD_HEAD), HTCP_CLR_PURGE);
#endif
entry->release();
purgeStatus = HTTP_OK;
return;
}
- if (context->http->request->method == METHOD_PURGE) {
+ if (context->http->request->method == Http::METHOD_PURGE) {
context->purgeRequest();
return;
}
// OPTIONS with Max-Forwards:0 handled in clientProcessRequest()
- if (context->http->request->method == METHOD_TRACE) {
+ if (context->http->request->method == Http::METHOD_TRACE) {
if (context->http->request->header.getInt64(HDR_MAX_FORWARDS) == 0) {
context->traceReply(aNode);
return;
void
clientReplyContext::sendNotModifiedOrPreconditionFailedError()
{
- if (http->request->method == METHOD_GET ||
- http->request->method == METHOD_HEAD)
+ if (http->request->method == Http::METHOD_GET ||
+ http->request->method == Http::METHOD_HEAD)
sendNotModified();
else
sendPreconditionFailedError();
#endif
- if (http->request->method == METHOD_HEAD) {
+ if (http->request->method == Http::METHOD_HEAD) {
/* do not forward body for HEAD replies */
body_size = 0;
http->flags.done_copying = 1;