static struct acceptor *vca_act;
-static unsigned xids;
static pthread_t vca_thread_acct;
static struct sess *
struct sockaddr addr[2]; /* XXX: IPv6 hack */
struct sess *sp;
int i;
- struct linger linger;
VSL_stats->client_conn++;
sp = SES_New(addr, l);
XXXAN(sp);
- (void)clock_gettime(CLOCK_REALTIME, &sp->t_open);
- sp->acct.first = sp->t_open.tv_sec;
sp->fd = i;
sp->id = i;
+ (void)clock_gettime(CLOCK_REALTIME, &sp->t_open);
+
+ return (sp);
+}
+
+void
+VCA_Prep(struct sess *sp)
+{
+ struct linger linger;
+ TCP_name(sp->sockaddr, sp->sockaddrlen,
+ sp->addr, sizeof sp->addr, sp->port, sizeof sp->port);
+ VSL(SLT_SessionOpen, sp->fd, "%s %s", sp->addr, sp->port);
+ sp->acct.first = sp->t_open.tv_sec;
#ifdef SO_LINGER /* XXX Linux*/
linger.l_onoff = 0;
linger.l_linger = 0;
AZ(setsockopt(sp->fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv));
}
#endif
-
- TCP_name(addr, l, sp->addr, sizeof sp->addr, sp->port, sizeof sp->port);
- VSL(SLT_SessionOpen, sp->fd, "%s %s", sp->addr, sp->port);
- return (sp);
}
void
}
sp->step = STP_RECV;
VSL_stats->client_req++;
- sp->xid = xids++;
- VSL(SLT_ReqStart, sp->fd, "XID %u", sp->xid);
WRK_QueueSession(sp);
}
http_RecvPrep(sp->http);
sp->step = STP_FIRST;
VSL_stats->client_req++;
- sp->xid = xids++;
- VSL(SLT_ReqStart, sp->fd, "XID %u", sp->xid);
WRK_QueueSession(sp);
}
}
VCA_Init(void)
{
- srandomdev();
- xids = random();
/* XXX: Add selector mechanism at some point */
vca_act = vca_acceptors[0];
#include "vcl.h"
#include "cache.h"
+static unsigned xids;
/*--------------------------------------------------------------------
* We have a refcounted object on the session, now deliver it.
{
int i;
+ VCA_Prep(sp);
for (;;) {
i = http_RecvSome(sp->fd, sp->http);
switch (i) {
int done;
clock_gettime(CLOCK_REALTIME, &sp->t_req);
+ sp->xid = ++xids;
+ VSL(SLT_ReqStart, sp->fd, "XID %u", sp->xid);
AZ(sp->vcl);
sp->vcl = VCL_Get();
/*
DOT }
*/
+
+void
+CNT_Init(void)
+{
+
+ srandomdev();
+ xids = random();
+}