Commit ab4018d7 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make the waiter per session pool

parent b2731b84
......@@ -970,6 +970,7 @@ void VRG_dorange(struct req *req, struct busyobj *bo, const char *r);
/* cache_session.c [SES] */
void SES_Close(struct sess *sp, enum sess_close reason);
void SES_Wait(struct sess *sp);
void SES_Delete(struct sess *sp, enum sess_close reason, double now);
struct sesspool *SES_NewPool(struct pool *pp, unsigned pool_no);
void SES_DeletePool(struct sesspool *sp);
......
......@@ -211,7 +211,6 @@ child_main(void)
Lck_New(&vxid_lock, lck_vxid);
WAIT_Init(SES_Handle);
PAN_Init();
CLI_Init();
VFP_Init();
......
......@@ -44,7 +44,6 @@
#include "vcl.h"
#include "vtcp.h"
#include "vtim.h"
#include "waiter/waiter.h"
/*----------------------------------------------------------------------
* Collect a request from the client.
......@@ -113,11 +112,8 @@ http1_wait(struct sess *sp, struct worker *wrk, struct req *req)
SES_ReleaseReq(req);
if (VTCP_nonblocking(sp->fd))
SES_Close(sp, SC_REM_CLOSE);
else if (WAIT_Enter(sp)) {
VSC_C_main->sess_pipe_overflow++;
SES_Delete(sp, SC_SESS_PIPE_OVERFLOW,
NAN);
}
else
SES_Wait(sp);
return (REQ_FSM_DONE);
}
} else {
......
......@@ -38,8 +38,6 @@
#include "waiter/waiter.h"
static void *waiter_priv;
const char *
WAIT_GetName(void)
{
......@@ -50,7 +48,7 @@ WAIT_GetName(void)
return ("no_waiter");
}
void
void *
WAIT_Init(waiter_handle_f *func)
{
......@@ -58,11 +56,11 @@ WAIT_Init(waiter_handle_f *func)
AN(waiter->name);
AN(waiter->init);
AN(waiter->pass);
waiter_priv = waiter->init(func);
return (waiter->init(func));
}
int
WAIT_Enter(struct sess *sp)
WAIT_Enter(void *waiter_priv, struct sess *sp)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
......
......@@ -132,7 +132,7 @@ vwe_eev(struct vwe *vwe, const struct epoll_event *ep, double now)
CAST_OBJ_NOTNULL(sp, ep->data.ptr, SESS_MAGIC);
if (ep->events & EPOLLIN || ep->events & EPOLLPRI) {
VTAILQ_REMOVE(&vwe->sesshead, sp, list);
vwe->func(sp, sp->fd, WAITER_ACTION, now)
vwe->func(sp, sp->fd, WAITER_ACTION, now);
} else if (ep->events & EPOLLERR) {
VTAILQ_REMOVE(&vwe->sesshead, sp, list);
vwe->func(sp, sp->fd, WAITER_REMCLOSE, now);
......
......@@ -48,11 +48,9 @@ struct waiter {
waiter_pass_f *pass;
};
waiter_handle_f SES_Handle;
/* cache_waiter.c */
int WAIT_Enter(struct sess *sp);
void WAIT_Init(waiter_handle_f *);
int WAIT_Enter(void *waiter_priv, struct sess *sp);
void *WAIT_Init(waiter_handle_f *);
const char *WAIT_GetName(void);
int WAIT_Write_Session(struct sess *sp, int fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment