Author: axeld Date: 2011-10-29 19:38:58 +0200 (Sat, 29 Oct 2011) New Revision: 42973 Changeset: https://dev.haiku-os.org/changeset/42973 Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.h haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.h Log: * More minor cleanup. Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp 2011-10-29 17:35:11 UTC (rev 42972) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp 2011-10-29 17:38:58 UTC (rev 42973) @@ -132,9 +132,9 @@ bigtime_t timeout = 1000 * 1000 * 60 * 29; // 29 min status_t status; while (true) { - int32 commandId = NextCommandId(); + int32 commandID = NextCommandID(); TRACE("IDLE ...\n"); - status = SendCommand("IDLE", commandId); + status = SendCommand("IDLE", commandID); if (firstIDLE) { release_sem(startedSem); firstIDLE = false; @@ -142,7 +142,7 @@ if (status != B_OK) break; - status = HandleResponse(commandId, timeout, false); + status = HandleResponse(commandID, timeout, false); ProcessAfterQuacks(kIMAP4ClientTimeout); if (atomic_get(&fWatching) == 0) Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.h =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.h 2011-10-29 17:35:11 UTC (rev 42972) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.h 2011-10-29 17:38:58 UTC (rev 42973) @@ -81,10 +81,10 @@ MinMessageList fMessageList; IMAPStorage& fStorage; - IMAPMailboxListener* fIMAPMailboxListener; - IMAPMailboxListener fNULLListener; + IMAPMailboxListener* fIMAPMailboxListener; + IMAPMailboxListener fNULLListener; - MailboxSelectHandler fMailboxSelectHandler; + MailboxSelectHandler fMailboxSelectHandler; CapabilityHandler fCapabilityHandler; ExistsHandler fExistsHandler; ExpungeHandler fExpungeHandler; Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp 2011-10-29 17:35:11 UTC (rev 42972) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.cpp 2011-10-29 17:38:58 UTC (rev 42973) @@ -1,3 +1,11 @@ +/* + * Copyright 2010-2011, Haiku Inc. All Rights Reserved. + * Copyright 2010 Clemens Zeidler. All rights reserved. + * + * Distributed under the terms of the MIT License. + */ + + #include "IMAPProtocol.h" #include "IMAPHandler.h" @@ -5,12 +13,11 @@ #define DEBUG_IMAP_PROTOCOL - #ifdef DEBUG_IMAP_PROTOCOL -#include <stdio.h> -#define TRACE(x...) printf(x) +# include <stdio.h> +# define TRACE(x...) printf(x) #else -#define TRACE(x...) /* nothing */ +# define TRACE(x...) ; #endif @@ -18,7 +25,6 @@ : fServerConnection(connection) { - } @@ -137,7 +143,7 @@ : fServerConnection(&fOwnServerConnection), fConnectionReader(fServerConnection), - fCommandId(0), + fCommandID(0), fStopNow(0), fIsConnected(false) { @@ -148,7 +154,7 @@ : fServerConnection(connection.fServerConnection), fConnectionReader(fServerConnection), - fCommandId(0), + fCommandID(0), fStopNow(0), fIsConnected(false) { @@ -285,13 +291,13 @@ status_t -IMAPProtocol::SendCommand(const char* command, int32 commandId) +IMAPProtocol::SendCommand(const char* command, int32 commandID) { if (strlen(command) + 10 > 256) return B_NO_MEMORY; static char cmd[256]; - ::sprintf(cmd, "A%.7ld %s"CRLF, commandId, command); + ::sprintf(cmd, "A%.7ld %s"CRLF, commandID, command); TRACE("_SendCommand: %s\n", cmd); int commandLength = strlen(cmd); @@ -301,13 +307,14 @@ return B_ERROR; } - fOngoingCommands.push_back(commandId); + fOngoingCommands.push_back(commandID); return B_OK; } status_t -IMAPProtocol::HandleResponse(int32 commandId, bigtime_t timeout, bool disconnectOnTimeout) +IMAPProtocol::HandleResponse(int32 commandID, bigtime_t timeout, + bool disconnectOnTimeout) { status_t commandStatus = B_ERROR; @@ -342,7 +349,7 @@ static char idString[8]; ::sprintf(idString, "A%.7ld", *it); if (line.FindFirst(idString) >= 0) { - if (*it == commandId) { + if (*it == commandID) { BString result = IMAPParser::ExtractElementAfter(line, idString); if (result == "OK") @@ -379,10 +386,10 @@ int32 -IMAPProtocol::NextCommandId() +IMAPProtocol::NextCommandID() { - fCommandId++; - return fCommandId; + fCommandID++; + return fCommandID; } @@ -408,12 +415,12 @@ IMAPProtocol::_ProcessCommandWithoutAfterQuake(const char* command, bigtime_t timeout) { - int32 commandId = NextCommandId(); - status_t status = SendCommand(command, commandId); + int32 commandID = NextCommandID(); + status_t status = SendCommand(command, commandID); if (status != B_OK) return status; - return HandleResponse(commandId, timeout); + return HandleResponse(commandID, timeout); } Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.h =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.h 2011-10-29 17:35:11 UTC (rev 42972) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPProtocol.h 2011-10-29 17:38:58 UTC (rev 42973) @@ -97,7 +97,7 @@ bigtime_t timeout = kIMAP4ClientTimeout, bool disconnectOnTimeout = true); void ProcessAfterQuacks(bigtime_t timeout); - int32 NextCommandId(); + int32 NextCommandID(); ServerConnection* fServerConnection; ServerConnection fOwnServerConnection; @@ -115,7 +115,7 @@ bigtime_t timeout = kIMAP4ClientTimeout); status_t _Disconnect(); - int32 fCommandId; + int32 fCommandID; std::vector<int32> fOngoingCommands; BString fCommandError;