httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Akins, Brian" <Brian.Ak...@turner.com>
Subject [PATCH] mod_wombat: add connection and server to request
Date Wed, 02 May 2007 19:43:42 GMT
Adds ability to get to r.connection and r.server.  Also renamed back to
apw_request_push per discussion with Brian M.

This works now:

function quick_handler(r)
  r.headers_out["Lua"] = "Rulez";
  h = r.headers_out
  val = r.headers_in["User-Agent"];
  h["Test"] = "HELP";
  h["Browser"] = val;

  r:puts("User-Agent: " .. val .. "\n");

  c = r.connection
  r:puts("hello " .. c.remote_ip .. "\n");

  s = r.server
  r:puts("Server name: " .. s.server_hostname .. "\n");

  if string.find(val, "Firefox") then
     r.headers_out["Location"] = "http://www.cnn.com";
     return apache2.HTTP_MOVED_TEMPORARILY
  end
  return apache2.OK
end


-- 
Brian Akins
Chief Operations Engineer
Turner Digital Media Technologies


Mime
View raw message