Data Structures | Defines | Typedefs | Functions | Variables

ReverseProxy.cc File Reference

Definitions for reverse proxy. More...

#include "libts.h"
#include <dlfcn.h>
#include "Main.h"
#include "Error.h"
#include "P_EventSystem.h"
#include "StatSystem.h"
#include "P_Cache.h"
#include "ProxyConfig.h"
#include "ReverseProxy.h"
#include "MatcherUtils.h"
#include "Tokenizer.h"
#include "api/ts/remap.h"
#include "RemapPluginInfo.h"
#include "RemapProcessor.h"
#include "UrlRewrite.h"
#include "UrlMapping.h"
Include dependency graph for ReverseProxy.cc:

Go to the source code of this file.

Data Structures

struct  UR_UpdateContinuation

Defines

#define URL_REWRITE_TIMEOUT   (HRTIME_SECOND*60)
 Time till we free the old stuff after a reconfiguration.
#define FILE_CHANGED   0
#define REVERSE_CHANGED   1
#define TSNAME_CHANGED   2
#define AC_PORT_CHANGED   3
#define TRANS_CHANGED   4
#define DEFAULT_TO_PAC_CHANGED   5
#define DEFAULT_TO_PAC_PORT_CHANGED   7
#define URL_REMAP_MODE_CHANGED   8
#define HTTP_DEFAULT_REDIRECT_CHANGED   9

Typedefs

typedef int(UR_UpdateContinuation::* UR_UpdContHandler )(int, void *)

Functions

int init_reverse_proxy ()
bool request_url_remap (HttpTransact::State *, HTTPHdr *, char **, unsigned int)
mapping_type request_url_remap_redirect (HTTPHdr *request_header, URL *redirect_url)
 This function is used to figure out if a URL needs to be remapped according to the rules in remap.config.
bool response_url_remap (HTTPHdr *response_header)
void reloadUrlRewrite ()
 Called when the remap.config file changes.
int url_rewrite_CB (const char *, RecDataT, RecData data, void *cookie)

Variables

static Ptr< ProxyMutexreconfig_mutex
UrlRewriterewrite_table = NULL
remap_plugin_inforemap_pi_list
int url_remap_mode

Detailed Description

Definitions for reverse proxy.

License

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Details

Implements code necessary for Reverse Proxy which mostly consists of general purpose hostname substitution in URLs.

Definition in file ReverseProxy.cc.


Define Documentation

#define AC_PORT_CHANGED   3

Definition at line 59 of file ReverseProxy.cc.

Referenced by init_reverse_proxy(), and url_rewrite_CB().

#define DEFAULT_TO_PAC_CHANGED   5

Definition at line 61 of file ReverseProxy.cc.

Referenced by init_reverse_proxy(), and url_rewrite_CB().

#define DEFAULT_TO_PAC_PORT_CHANGED   7

Definition at line 62 of file ReverseProxy.cc.

Referenced by init_reverse_proxy(), and url_rewrite_CB().

#define FILE_CHANGED   0

Definition at line 56 of file ReverseProxy.cc.

Referenced by init_reverse_proxy(), and url_rewrite_CB().

#define HTTP_DEFAULT_REDIRECT_CHANGED   9

Definition at line 64 of file ReverseProxy.cc.

Referenced by init_reverse_proxy(), and url_rewrite_CB().

#define REVERSE_CHANGED   1

Definition at line 57 of file ReverseProxy.cc.

Referenced by init_reverse_proxy(), and url_rewrite_CB().

#define TRANS_CHANGED   4

Definition at line 60 of file ReverseProxy.cc.

#define TSNAME_CHANGED   2

Definition at line 58 of file ReverseProxy.cc.

Referenced by init_reverse_proxy(), and url_rewrite_CB().

#define URL_REMAP_MODE_CHANGED   8

Definition at line 63 of file ReverseProxy.cc.

Referenced by init_reverse_proxy(), and url_rewrite_CB().

#define URL_REWRITE_TIMEOUT   (HRTIME_SECOND*60)

Time till we free the old stuff after a reconfiguration.

Definition at line 48 of file ReverseProxy.cc.

Referenced by reloadUrlRewrite().


Typedef Documentation

typedef int(UR_UpdateContinuation::* UR_UpdContHandler)(int, void *)

Definition at line 133 of file ReverseProxy.cc.


Function Documentation

int init_reverse_proxy (  ) 
void reloadUrlRewrite (  ) 

Called when the remap.config file changes.

Since it called infrequently, we do the load of new file as blocking I/O and lock aquire is also blocking.

Definition at line 156 of file ReverseProxy.cc.

References Debug, UrlRewrite::is_valid(), new_Deleter(), URL_REWRITE_TIMEOUT, and Warning.

Referenced by UR_UpdateContinuation::file_update_handler().

bool request_url_remap ( HttpTransact::State ,
HTTPHdr ,
char **  ,
unsigned int   
)

Definition at line 102 of file ReverseProxy.cc.

Referenced by HttpTransact::HandleBlindTunnel(), and how_to_open_connection().

mapping_type request_url_remap_redirect ( HTTPHdr request_header,
URL redirect_url 
)

This function is used to figure out if a URL needs to be remapped according to the rules in remap.config.

Definition at line 114 of file ReverseProxy.cc.

References UrlRewrite::Remap_redirect().

Referenced by HttpTransact::handleIfRedirect().

bool response_url_remap ( HTTPHdr response_header  ) 

Definition at line 120 of file ReverseProxy.cc.

References UrlRewrite::ReverseMap().

Referenced by HttpTransact::build_response().

int url_rewrite_CB ( const char *  ,
RecDataT  ,
RecData  data,
void *  cookie 
)

Variable Documentation

Definition at line 51 of file ReverseProxy.cc.

Definition at line 53 of file ReverseProxy.cc.

Referenced by remap_load_plugin().