- if (for_writing) {
- /* if we're forcing indirecttcp, just do it */
- if (self->force_indirecttcp) {
- return indirecttcp_listen(self, addrs);
- }
- if (!ndmp_connection_mover_set_window(self->ndmp, 0, 0)) {
- /* NDMP9_ILLEGAL_ARGS_ERR means the NDMP server doesn't like a zero-byte
- * mover window, so we'll ignore it */
- if (ndmp_connection_err_code(self->ndmp) != NDMP9_ILLEGAL_ARGS_ERR) {
- set_error_from_ndmp(self);
- return FALSE;
- }
-
- g_debug("NDMP Device: cannot set zero-length mover window; "
- "falling back to IndirectTCP");
- /* In this case, we need to set up IndirectTCP */
- return indirecttcp_listen(self, addrs);
- }
- } else {
- /* For reading, set the window to the second mover record, so that the
- * mover will pause immediately when it wants to read the first mover
- * record. */
- if (!ndmp_connection_mover_set_window(self->ndmp,
- DEVICE(self)->block_size,
- DEVICE(self)->block_size)) {
- set_error_from_ndmp(self);
- return FALSE;
- }