if (!socket->s)
goto connection_closed;
- oc = si_oc(&socket->s->si[0]);
+ oc = &socket->s->res;
if (wanted == HLSR_READ_LINE) {
/* Read line. */
nblk = bo_getline_nc(oc, &blk1, &len1, &blk2, &len2);
}
/* Check for avalaible space. */
- len = buffer_total_space(si_ib(&socket->s->si[0]));
+ len = buffer_total_space(socket->s->req.buf);
if (len <= 0)
goto hlua_socket_write_yield_return;
/* send data */
if (len < send_len)
send_len = len;
- len = bi_putblk(si_ic(&socket->s->si[0]), buf+sent, send_len);
+ len = bi_putblk(&socket->s->req, buf+sent, send_len);
/* "Not enough space" (-1), "Buffer too little to contain
* the data" (-2) are not expected because the available length
*/
if (len <= 0) {
if (len == -1)
- si_ic(&socket->s->si[0])->flags |= CF_WAKE_WRITE;
+ socket->s->req.flags |= CF_WAKE_WRITE;
MAY_LJMP(hlua_socket_close(L));
lua_pop(L, 1);
/* update buffers. */
si_update(&socket->s->si[0]);
- si_ic(&socket->s->si[0])->rex = TICK_ETERNITY;
- si_oc(&socket->s->si[0])->wex = TICK_ETERNITY;
+ socket->s->req.rex = TICK_ETERNITY;
+ socket->s->res.wex = TICK_ETERNITY;
/* Update length sent. */
lua_pop(L, 1);
MAY_LJMP(check_args(L, 1, "close"));
s = MAY_LJMP(hlua_checktxn(L, 1));
- ic = si_ic(&s->s->si[0]);
- oc = si_oc(&s->s->si[0]);
+ ic = &s->s->req;
+ oc = &s->s->res;
channel_abort(ic);
channel_auto_close(ic);