Bump the max_forwards type to 64-bit to cope with wider range of values.
NP: still no internal handling of OPTIONS requests, but this will
forward them according to RFC 2616 requirements.
int imslen;
- int max_forwards;
+ int64_t max_forwards;
/* these in_addr's could probably be sockaddr_in's */
return;
}
+ /* TODO: handle OPTIONS request on max_forwards == 0 as well */
+
if (context->http->request->method == METHOD_TRACE) {
if (context->http->request->max_forwards == 0) {
context->traceReply(aNode);
}
#endif
- if (request->method == METHOD_TRACE) {
- request->max_forwards = req_hdr->getInt(HDR_MAX_FORWARDS);
+ if (request->method == METHOD_TRACE || request->method == METHOD_OPTIONS) {
+ request->max_forwards = req_hdr->getInt64(HDR_MAX_FORWARDS);
}
request->flags.cachable = http->request->cacheable();
break;
case HDR_MAX_FORWARDS:
- if (orig_request->method == METHOD_TRACE) {
- const int hops = e->getInt();
+ /* pass only on TRACE or OPTIONS requests */
+ if (orig_request->method == METHOD_TRACE || orig_request->method == METHOD_OPTIONS) {
+ const int64_t hops = e->getInt64();
if (hops > 0)
- hdr_out->putInt(HDR_MAX_FORWARDS, hops - 1);
+ hdr_out->putInt64(HDR_MAX_FORWARDS, hops - 1);
}
break;