diff options
| author | Sam Varshavchik | 2013-11-25 21:10:58 -0500 | 
|---|---|---|
| committer | Sam Varshavchik | 2013-11-25 22:32:37 -0500 | 
| commit | dfec2956983783aab0aaa4f05379926092ce6202 (patch) | |
| tree | 77104f9f9aebdd024e7a0d59acf11f5425417e69 /imap/mainloop.c | |
| parent | 39ce29711f39afa228868f9b9cf2cc851fe6d3d7 (diff) | |
| download | courier-libs-dfec2956983783aab0aaa4f05379926092ce6202.tar.bz2 | |
Flush stdin after STARTTLS
Diffstat (limited to 'imap/mainloop.c')
| -rw-r--r-- | imap/mainloop.c | 7 | 
1 files changed, 5 insertions, 2 deletions
| diff --git a/imap/mainloop.c b/imap/mainloop.c index b58ae6f..f2224a8 100644 --- a/imap/mainloop.c +++ b/imap/mainloop.c @@ -19,7 +19,7 @@  #include	"numlib/numlib.h" -extern int do_imap_command(const char *); +extern int do_imap_command(const char *, int *);  extern unsigned long header_count, body_count;  extern unsigned long bytes_received_count, bytes_sent_count; @@ -119,18 +119,21 @@ void mainloop(void)  			curtoken->tokentype == IT_NUMBER)  		{  		int	rc; +		int	flushflag=0;  			if (strlen(tag)+strlen(curtoken->tokenbuf) > IT_MAX_ATOM_SIZE)  				write_error_exit("max atom size too small");  			strncat(tag, curtoken->tokenbuf, IT_MAX_ATOM_SIZE); -			rc=do_imap_command(tag); +			rc=do_imap_command(tag, &flushflag);  			if (rc == 0)  			{  				noerril = 0;  				writeflush();  				read_eol(); +				if (flushflag) +					readflush();  				continue;  			}  			if (rc == -2) | 
