timeout_reset(proxy->to_data_idle);
switch (i_stream_read(proxy->data_input)) {
+ case 0:
+ if (!tee_i_stream_child_is_waiting(proxy->data_input)) {
+ /* nothing new read */
+ if (proxy->io != NULL)
+ return FALSE;
+ proxy->io = io_add(i_stream_get_fd(proxy->data_input),
+ IO_READ,
+ lmtp_proxy_data_input, proxy);
+ }
+ /* fall through */
case -2:
/* buffer full. someone's stalling. */
lmtp_proxy_wait_for_output(proxy);
lmtp_proxy_try_finish(proxy);
}
return FALSE;
- case 0:
- /* nothing new read */
- if (proxy->io == NULL) {
- proxy->io = io_add(i_stream_get_fd(proxy->data_input),
- IO_READ,
- lmtp_proxy_data_input, proxy);
- }
- return FALSE;
default:
/* something was read */
(void)i_stream_get_data(proxy->data_input, &size);