rem: runner->Stop();
add: runner->Stop(true);
context: IMAP4Client::IMAP4Client(BMessage *settings, BMailChainRunner *run) : BRemoteMailStorageProtocol(settings,run), noop(NULL), commandCount(0), net(-1), selected_mb(""), force_reselect(false) {	err = B_OK;		mb_root = settings->FindString("root");	#ifdef USESSL		use_ssl = (settings->FindInt32("flavor") == 1);		ssl = NULL;		ctx = NULL;	#endif		int port = settings->FindInt32("port");		if (port <= 0)		#ifdef USESSL			port = use_ssl ? 993 : 143;		#else			port = 143;		#endif//-----Open TCP link		runner->ReportProgress(0,0,MDR_DIALECT_CHOICE ("Opening connection...","接続中..."));		uint32 hostIP = inet_addr(settings->FindString("server"));  // first see if we can parse it as a numeric address	if ((hostIP == 0)||(hostIP == (uint32)-1)) {		struct hostent * he = gethostbyname(settings->FindString("server"));		hostIP = he ? *((uint32*)he->h_addr) : 0;	}   	if (hostIP == 0) {		BString error;		error << "Could not connect to IMAP server " << settings->FindString("server");		if ((port != 143) && (port != 993))			error << ":" << port;		error << ": Host not found.";		runner->ShowError(error.String());	#ifdef USESSL		if (use_ssl) {			if (ssl)				SSL_shutdown(ssl);			if (ctx)				SSL_CTX_free(ctx);		}	#endif	#ifdef BONE		close(net);	#else		closesocket(net);	#endif		net = -1;		runner->Stop();		return;	}	#ifdef BONE	net = socket(AF_INET, SOCK_STREAM, 0);#else	net = socket(AF_INET, 2, 0);#endif	if (net >= 0) {		struct sockaddr_in saAddr;		memset(&saAddr, 0, sizeof(saAddr));		saAddr.sin_family      = AF_INET;		saAddr.sin_port        = htons(port);		saAddr.sin_addr.s_addr = hostIP;		int result = connect(net, (struct sockaddr *) &saAddr, sizeof(saAddr));		if (result < 0) {		#ifdef USESSL			if (use_ssl) {				if (ssl)					SSL_shutdown(ssl);				if (ctx)					SSL_CTX_free(ctx);			}		#endif		#ifdef BONE			close(net);		#else			closesocket(net);		#endif			net = -1;			BString error;			error << "Could not connect to IMAP server " << settings->FindString("server");			if ((port != 143) && (port != 993))				error << ":" << port;			error << '.';			runner->ShowError(error.String());			runner->Stop();			return;		}	} else {		BString error;		error << "Could not connect to IMAP server " << settings->FindString("server");		if ((port != 143) && (port != 993))			error << ":" << port;		error << ". (" << strerror(errno) << ')';		runner->ShowError(error.String());		net = -1;		runner->Stop();		return;	}	#ifdef USESSL	if (use_ssl) {		SSL_library_init();    	SSL_load_error_strings();    	RAND_seed(this,sizeof(IMAP4Client));    	/*--- Because we're an add-on loaded at an unpredictable time, all    	      the memory addresses and things contained in ourself are    	      esssentially random. */    	    	ctx = SSL_CTX_new(SSLv23_method());    	ssl = SSL_new(ctx);    	sbio=BIO_new_socket(net,BIO_NOCLOSE);    	SSL_set_bio(ssl,sbio,sbio);    	    	if (SSL_connect(ssl) <= 0) {    		BString error;			error << "Could not connect to IMAP server " << settings->FindString("server");			if (port != 993)				error << ":" << port;			error << ". (SSL Connection Error)";			runner->ShowError(error.String());			SSL_CTX_free(ctx);			#ifdef BONE				close(net);			#else				closesocket(net);			#endif			runner->Stop();			return;		}	}		#endif	//-----Wait for welcome message	BString response;	ReceiveLine(response);//-----Log in	runner->ReportProgress(0,0,MDR_DIALECT_CHOICE ("Authenticating...","認証中..."));		const char *password = settings->FindString("password");	{		char *passwd = get_passwd(settings,"cpasswd");		if (passwd)			password = passwd;	}	BString command = "LOGIN ";	command << "\"" << settings->FindString("username") << "\" ";	command << "\"" << password << "\"";	SendCommand(command.String());	if (!WasCommandOkay(response)) {		response.Prepend("Login failed. Please check your username and password.\n(");		response << ')';		runner->ShowError(response.String());		err = B_ERROR;		runner->Stop();		return;	}		runner->ReportProgress(0,0,"Logged in");		InitializeMailboxes();	GetUniqueIDs();		BStringList to_dl;	unique_ids->NotThere(*manifest,&to_dl);		noop = new NoopWorker(this);	runner->AddHandler(noop);	nooprunner = new BMessageRunner(BMessenger(noop,runner),new BMessage('impn'),10e6);		if (to_dl.CountItems() > 0)		runner->GetMessages(&to_dl,-1);}