static void http_io(IOCHAN i, int event)
{
struct http_channel *hc = iochan_getdata(i);
static void http_io(IOCHAN i, int event)
{
struct http_channel *hc = iochan_getdata(i);
htbuf = http_buf_create(hc->http_server);
res = recv(iochan_getfd(i), htbuf->buf, HTTP_BUF_SIZE -1, 0);
if (res == -1 && errno == EAGAIN)
htbuf = http_buf_create(hc->http_server);
res = recv(iochan_getfd(i), htbuf->buf, HTTP_BUF_SIZE -1, 0);
if (res == -1 && errno == EAGAIN)
- res = send(iochan_getfd(hc->iochan), wb->buf + wb->offset, wb->len, 0);
+ int res;
+ res = send(iochan_getfd(hc->iochan),
+ wb->buf + wb->offset, wb->len, 0);
if (!hc->oqueue && hc->proxy && !hc->proxy->iochan)
http_channel_destroy(i); // Server closed; we're done
if (!hc->oqueue && hc->proxy && !hc->proxy->iochan)
http_channel_destroy(i); // Server closed; we're done