add: return B_TIMED_OUT;
context: int IMAP4Client::GetResponse(BString &tag, NestedString *parsed_response, bool report_literals, bool internal_flag) {	if (net < 0)		return net;		uint8 c = 0;	int32 r;	int8 delimiters_passed = internal_flag ? 2 : 0;	int answer = NOT_COMMAND_RESPONSE;	BString out;	bool in_quote = false;	bool was_cr = false;	int result;		{		struct timeval tv;		struct fd_set fds; 			tv.tv_sec = long(kIMAP4ClientTimeout / 1e6); 		tv.tv_usec = long(kIMAP4ClientTimeout-(tv.tv_sec * 1e6)); 				/* Initialize (clear) the socket mask. */ 		FD_ZERO(&fds);				/* Set the socket in the mask. */ 		FD_SET(net, &fds);#ifdef USESSL		if ((use_ssl) && (SSL_pending(ssl)))			result = 1;		else#endif			result = select(32, &fds, NULL, NULL, &tv);	}		if (result < 0)		return errno;		if (!internal_flag)		PRINT(("S: "));	if(result > 0)	{		while(c != '\n' && c != xEOF)		{#ifdef USESSL			if (use_ssl)				r = SSL_read(ssl,&c,1);			else#endif				r = recv(net,&c,1,0);			if(r <= 0) {				BString error;				error << "Connection to " << settings->FindString("server") << " lost.";				net = -1;				runner->Stop();				runner->ShowError(error.String());				return -1;			}						#if DEBUG				putchar(c);			#endif						if ((isspace(c) || (internal_flag && (c == ')' || c == ']'))) && !in_quote) {				if (delimiters_passed == 0) {					tag = out;					out = "";					delimiters_passed ++;					continue;				}				if (delimiters_passed == 1) {										if (out == "NO")						answer = NO;					else if (out == "BAD")						answer = BAD;					else if (out == "OK")						answer = OK;					else if (parsed_response != NULL && out != "")						*parsed_response += out;										out = "";					delimiters_passed ++;					continue;				}								if (c == '\r') {					was_cr = true;					continue;				}				if (c == '\n' && was_cr) {					if (out.Length() == 0)						return answer;					if (out[0] == '{' && out[out.Length() - 1] == '}') {						int octets_to_read;						out.Truncate(out.Length() - 1);						octets_to_read = atoi(out.String() + 1);						out = "";						char *buffer = new char[octets_to_read+1];						buffer[octets_to_read] = 0;						int read_octets = 0;						int nibble_size;						while (read_octets < octets_to_read) {						  #ifdef USESSL							if (use_ssl)								nibble_size = SSL_read(ssl,buffer + read_octets,octets_to_read - read_octets);							else						  #endif								nibble_size = recv(net,buffer + read_octets,octets_to_read - read_octets,0);							read_octets += nibble_size;							if (report_literals)								runner->ReportProgress(nibble_size,0);						}												if (parsed_response != NULL)							parsed_response->AdoptAndAdd(buffer);						else							delete [] buffer;													c = ' ';						continue;					}				}								if (internal_flag && (c == ')' || c == ']')) {					if (parsed_response != NULL && out != "")						(*parsed_response) += out;					break;				}								was_cr = false;				if (parsed_response != NULL && out != "")					(*parsed_response) += out;				out = "";				continue;			}						was_cr = false;						if (c == '\"') {				in_quote = !in_quote;				continue;			}			if (c == '(' || c == '[') {				if (parsed_response != NULL)					(*parsed_response) += NULL;									BString trash;				GetResponse(trash,&((*parsed_response)[parsed_response->CountItems() - 1]),report_literals,true);				continue;			}						out += (char)c;		}	}else{		// Log an error somewhere instead		runner->ShowError("IMAP Timeout.");	}	return answer;}