summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-01-10 09:17:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:50:01 -0500
commit4222bee0ee079079da78f3d43a99a9427d732316 (patch)
tree868f5b4d2f12c3cd28561af169f964367c8a809a
parent1d95bcf3f884072e3d719aa719d46a8ad688d34c (diff)
downloadsamba-4222bee0ee079079da78f3d43a99a9427d732316.tar.gz
samba-4222bee0ee079079da78f3d43a99a9427d732316.tar.bz2
samba-4222bee0ee079079da78f3d43a99a9427d732316.zip
r12817: Create a ESP variable with the struct socket_address * in it, so we
can pass that do the auth subsystem. Andrew Bartlett (This used to be commit 699f06e5e8ef326808d010fadb51da04972ab385)
-rw-r--r--source4/web_server/http.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/web_server/http.c b/source4/web_server/http.c
index 8779007f86..b2b75c8148 100644
--- a/source4/web_server/http.c
+++ b/source4/web_server/http.c
@@ -401,7 +401,7 @@ static void http_setup_arrays(struct esp_state *esp)
struct esp_data *edata = talloc_get_type(web->task->private, struct esp_data);
struct EspRequest *req = esp->req;
struct socket_address *socket_address = socket_get_my_addr(web->conn->socket, esp);
- struct socket_address *peer_address = socket_get_my_addr(web->conn->socket, esp);
+ struct socket_address *peer_address = socket_get_peer_addr(web->conn->socket, esp);
char *p;
#define SETVAR(type, name, value) do { \
@@ -418,6 +418,10 @@ static void http_setup_arrays(struct esp_state *esp)
SETVAR(ESP_REQUEST_OBJ, "SCRIPT_NAME", p+1);
SETVAR(ESP_REQUEST_OBJ, "SCRIPT_FILENAME", web->input.url);
if (peer_address) {
+ struct MprVar mpv = mprObject("socket_address");
+ mprSetPtrChild(&mpv, "socket_address", peer_address);
+ espSetVar(req, ESP_REQUEST_OBJ, "REMOTE_SOCKET_ADDRESS", mpv);
+
SETVAR(ESP_REQUEST_OBJ, "REMOTE_ADDR", peer_address->addr);
}
p = socket_get_peer_name(web->conn->socket, esp);