Browse Source

flush stdout more

to make sure it is timely written and not interleaved with stderr even
when when redirected.
wip/maildir-uid-dupes-test
Oswald Buddenhagen 12 years ago
parent
commit
8dbb3fe7a9
  1. 6
      src/drv_imap.c
  2. 4
      src/socket.c
  3. 1
      src/util.c

6
src/drv_imap.c

@ -250,6 +250,7 @@ send_imap_cmd( imap_store_t *ctx, struct imap_cmd *cmd )
printf( ">>> %s", buf );
else
printf( ">>> %d LOGIN <user> <pass>\n", cmd->tag );
fflush( stdout );
}
if (socket_write( &ctx->conn, buf, bufl, KeepOwn ) < 0)
goto bail;
@ -573,6 +574,7 @@ parse_imap_list( imap_store_t *ctx, char **sp, parse_list_state_t *sts )
puts( "=========" );
fwrite( cur->val, cur->len, 1, stdout );
puts( "=========" );
fflush( stdout );
}
getline:
@ -1185,8 +1187,10 @@ do_cram_auth( imap_store_t *ctx, struct imap_cmd *cmdp, const char *prompt )
cram( prompt, srvc->user, srvc->pass, &resp, &l );
if (DFlags & VERBOSE)
if (DFlags & VERBOSE) {
printf( ">+> %s\n", resp );
fflush( stdout );
}
return socket_write( &ctx->conn, resp, l, GiveOwn );
}
#endif

4
src/socket.c

@ -539,8 +539,10 @@ socket_read_line( conn_t *b )
if (p != s && p[-1] == '\r')
p--;
*p = 0;
if (DFlags & VERBOSE)
if (DFlags & VERBOSE) {
puts( s );
fflush( stdout );
}
return s;
}

1
src/util.c

@ -37,6 +37,7 @@ flushn( void )
{
if (need_nl) {
putchar( '\n' );
fflush( stdout );
need_nl = 0;
}
}

Loading…
Cancel
Save