summaryrefslogtreecommitdiff
path: root/src/mod_magnet.c
diff options
context:
space:
mode:
authorKrzysztof Krzyżaniak <eloy@debian.org>2009-03-18 10:20:09 +0000
committerKrzysztof Krzyżaniak <eloy@debian.org>2009-03-18 10:20:09 +0000
commitba7de25b4464c5bdc25e2c559c3760f19e2b240a (patch)
treeb49c5aa3b3ac6be16de774f8ae502c21ae7b0626 /src/mod_magnet.c
parentfd9cddc7b9d8062a6f8ba4b506c41a86ff22e2df (diff)
downloadlighttpd-ba7de25b4464c5bdc25e2c559c3760f19e2b240a.tar.gz
new upstream version
Diffstat (limited to 'src/mod_magnet.c')
-rw-r--r--src/mod_magnet.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/mod_magnet.c b/src/mod_magnet.c
index 4fd0795..02bcaed 100644
--- a/src/mod_magnet.c
+++ b/src/mod_magnet.c
@@ -414,10 +414,16 @@ static buffer *magnet_env_get_buffer(server *srv, connection *con, const char *k
case MAGNET_ENV_URI_AUTHORITY: dest = con->uri.authority; break;
case MAGNET_ENV_URI_QUERY: dest = con->uri.query; break;
- case MAGNET_ENV_REQUEST_METHOD: break;
+ case MAGNET_ENV_REQUEST_METHOD:
+ buffer_copy_string(srv->tmp_buf, get_http_method_name(con->request.http_method));
+ dest = srv->tmp_buf;
+ break;
case MAGNET_ENV_REQUEST_URI: dest = con->request.uri; break;
case MAGNET_ENV_REQUEST_ORIG_URI: dest = con->request.orig_uri; break;
- case MAGNET_ENV_REQUEST_PROTOCOL: break;
+ case MAGNET_ENV_REQUEST_PROTOCOL:
+ buffer_copy_string(srv->tmp_buf, get_http_version_name(con->request.http_version));
+ dest = srv->tmp_buf;
+ break;
case MAGNET_ENV_UNSET: break;
}
@@ -647,6 +653,7 @@ static handler_t magnet_attract(server *srv, connection *con, plugin_data *p, bu
assert(lua_gettop(L) == 0); /* only the function should be on the stack */
con->http_status = 500;
+ con->mode = DIRECT;
return HANDLER_FINISHED;
}
@@ -744,6 +751,7 @@ static handler_t magnet_attract(server *srv, connection *con, plugin_data *p, bu
assert(lua_gettop(L) == 1); /* only the function should be on the stack */
con->http_status = 500;
+ con->mode = DIRECT;
return HANDLER_FINISHED;
}
@@ -766,9 +774,13 @@ static handler_t magnet_attract(server *srv, connection *con, plugin_data *p, bu
/* try { ...*/
if (0 == setjmp(exceptionjmp)) {
magnet_attach_content(srv, con, p, L);
+ if (!chunkqueue_is_empty(con->write_queue)) {
+ con->mode = p->id;
+ }
} else {
/* } catch () { */
con->http_status = 500;
+ con->mode = DIRECT;
}
assert(lua_gettop(L) == 1); /* only the function should be on the stack */