// A Request is a (usually HTTP) request from a client to a proxy and
// the results of that request.  ie. Was the URL fetched from 
// the server or supplied from cache?  What was the HTTP result code?

#if !defined(_DecRequest_h)
#define _DecRequest_h

#include <stdio.h>
#include "proxytrace2txt_v2.h"

class DecRequest
{
public:
  enum HttpResultCode {
    unknownHttpResult = 0,
    ok                = 200, // c
    movedPermenently  = 300, // C
    movedTemporarily  = 302, // t
    notModified       = 304, // -
    badRequest        = 400, // E
    unauthorized      = 401, // -
    forbidden         = 403, // E
    notFound          = 404, // E
    // Notes:
    // * HTTP 1.1
    // c Cached unless a query response without expiry information
    // C Cached
    // E Negatively cached if no expiry headers.
    // t Cached only if expiry information
    // - Not cached
  };


  // Time request started in s since 1970
  long startTime;
  
  // Indentifier of client.
  unsigned long client;

  // Real time used to process request, in s.
  long processingTime;

  // Result code from HTTP
  HttpResultCode httpResult;

  // Number of bytes sent to client, including headers.
  int size;

  // Request URL
  unsigned long urlHash;

  unsigned long lastModified;

  // Entry as read from disk
  TEntry_v2 entry;

};
#endif
