Page Speed Optimization Libraries  1.7.30.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions
net_instaweb::LoopbackRouteFetcher Class Reference

See file comment. More...

#include "loopback_route_fetcher.h"

Inheritance diagram for net_instaweb::LoopbackRouteFetcher:
net_instaweb::UrlAsyncFetcher

List of all members.

Public Member Functions

 LoopbackRouteFetcher (const RewriteOptions *options, const GoogleString &own_ip, int own_port, UrlAsyncFetcher *backend_fetcher)
virtual bool SupportsHttps () const
virtual void Fetch (const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch)

Static Public Member Functions

static bool IsLoopbackAddr (const apr_sockaddr_t *addr)
 Returns true if the given address is an IPv4 or IPv6 loopback.

Detailed Description

See file comment.


Constructor & Destructor Documentation

net_instaweb::LoopbackRouteFetcher::LoopbackRouteFetcher ( const RewriteOptions options,
const GoogleString &  own_ip,
int  own_port,
UrlAsyncFetcher backend_fetcher 
)

Does not take ownership of anything. own_port is the port the incoming request came in on, and own_ip is the same for the IP. If the backend_fetcher does actual fetching (and is not merely simulating it for testing purposes) it should be the Serf fetcher, as others may not direct requests this class produces properly. (As this fetcher may produce requests that need to connect to some IP but have a Host: and URL from somewhere else).


Member Function Documentation

virtual void net_instaweb::LoopbackRouteFetcher::Fetch ( const GoogleString &  url,
MessageHandler *  message_handler,
AsyncFetch fetch 
) [virtual]

Asynchronously fetch a URL, set the response headers and stream the contents to fetch and call fetch->Done() when the fetch finishes.

There is an unchecked contract that response_headers are set before the response_writer or callback are used. Caution, several implementations do not satisfy this contract (but should).

Todo:

TODO(sligocki): GoogleString -> GoogleUrl or at least StringPiece.

TODO(sligocki): Include the URL in the fetch, like the request headers.

Implements net_instaweb::UrlAsyncFetcher.

virtual bool net_instaweb::LoopbackRouteFetcher::SupportsHttps ( ) const [inline, virtual]

Determine if the fetcher supports fetching using HTTPS. By default we assume a fetcher can.

Reimplemented from net_instaweb::UrlAsyncFetcher.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines