{
if (cl->dispatch.free)
cl->dispatch.free(cl);
+ if (cl->dispatch.req_free)
+ cl->dispatch.req_free(cl);
}
static void client_timeout(struct uloop_timeout *timeout)
{
uh_chunk_eof(cl);
uh_dispatch_done(cl);
- cl->us->notify_write = NULL;
memset(&cl->dispatch, 0, sizeof(cl->dispatch));
if (!conf.http_keepalive || cl->request.connection_close)
if (!newline)
return false;
+ if (newline == buf)
+ return true;
+
*newline = 0;
blob_buf_init(&cl->hdr, 0);
cl->state = client_parse_request(cl, buf);
static void client_ustream_read_cb(struct ustream *s, int bytes)
{
- struct client *cl = container_of(s, struct client, sfd);
+ struct client *cl = container_of(s, struct client, sfd.stream);
uh_client_read_cb(cl);
}
static void client_ustream_write_cb(struct ustream *s, int bytes)
{
- struct client *cl = container_of(s, struct client, sfd);
+ struct client *cl = container_of(s, struct client, sfd.stream);
if (cl->dispatch.write_cb)
cl->dispatch.write_cb(cl);
static void client_notify_state(struct ustream *s)
{
- struct client *cl = container_of(s, struct client, sfd);
+ struct client *cl = container_of(s, struct client, sfd.stream);
uh_client_notify_state(cl);
}