AZ(setsockopt(sp->fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof tv));
}
#endif
+#ifdef SO_RCVTIMEO
+ {
+ struct timeval tv;
+
+ tv.tv_sec = params->sess_timeout;
+ tv.tv_usec = 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);
WRK_QueueSession(sp);
}
+void
+vca_handfirst(struct sess *sp)
+{
+ sp->step = STP_FIRST;
+ VSL_stats->client_req++;
+ sp->xid = xids++;
+ VSL(SLT_ReqStart, sp->fd, "XID %u", sp->xid);
+ WRK_QueueSession(sp);
+}
+
/*--------------------------------------------------------------------*/
void
INCOMPL();
}
+static int
+cnt_first(struct sess *sp)
+{
+ int i;
+
+ for (;;) {
+ i = http_RecvSome(sp->fd, sp->http);
+ switch (i) {
+ case -1:
+ continue;
+ case 0:
+ sp->step = STP_RECV;
+ return (0);
+ case 1:
+ vca_close_session(sp, "overflow");
+ SES_Charge(sp);
+ vca_return_session(sp);
+ sp->step = STP_DONE;
+ return (1);
+ case 2:
+ vca_close_session(sp, "no request");
+ SES_Charge(sp);
+ vca_return_session(sp);
+ sp->step = STP_DONE;
+ return (1);
+ default:
+ INCOMPL();
+ }
+ }
+}
/*--------------------------------------------------------------------
* We had a cache hit. Ask VCL, then march off as instructed.