From ba7de25b4464c5bdc25e2c559c3760f19e2b240a Mon Sep 17 00:00:00 2001 From: Krzysztof Krzyżaniak Date: Wed, 18 Mar 2009 10:20:09 +0000 Subject: new upstream version --- src/mod_magnet.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/mod_magnet.c') 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 */ -- cgit v1.2.3