dtmail: remove DEAD_WOOD code
This commit is contained in:
@@ -548,26 +548,6 @@ DtMailEnv::vSetError(const DTMailError_t minor_code,
|
||||
delete [] messageBuffer;
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
const char *
|
||||
DtMailEnv::implGetMessage()
|
||||
{
|
||||
if (_client != NULL && _implMessageFunc != NULL) {
|
||||
return((*_implMessageFunc)(_client));
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
int
|
||||
DtMailEnv::implGetError()
|
||||
{
|
||||
if (_client != NULL && _implErrorFunc != NULL) {
|
||||
return((*_implErrorFunc)(_client));
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
void
|
||||
DtMailEnv::logError(DtMailBoolean criticalError, const char *format, ...) const
|
||||
{
|
||||
@@ -598,17 +578,3 @@ DtMailEnv::logError(DtMailBoolean criticalError, const char *format, ...) const
|
||||
NULL, messageBuffer);
|
||||
delete [] messageBuffer;
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
void
|
||||
DtMailEnv::logFatalError(DtMailBoolean criticalError, const char *format, ...)
|
||||
{
|
||||
_fatal = DTM_TRUE;
|
||||
|
||||
va_list var_args;
|
||||
|
||||
va_start(var_args, format);
|
||||
logError(criticalError, format, var_args);
|
||||
va_end(var_args);
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
@@ -111,41 +111,12 @@ DtMailValue::toDate(void)
|
||||
return(date);
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
void
|
||||
DtMailValue::fromDate(const DtMailValueDate & date)
|
||||
{
|
||||
if (_value) {
|
||||
free(_value);
|
||||
}
|
||||
|
||||
_value = (char *)malloc(64);
|
||||
|
||||
tm result;
|
||||
|
||||
SafeLocaltime(&date.dtm_date, result);
|
||||
|
||||
/* NL_COMMENT
|
||||
* The %C is the time and date format, please refer to strftime man page for
|
||||
* explanation of each format.
|
||||
*/
|
||||
SafeStrftime(_value, 64, DtMailError::getMessageText(2, 1, "%C"), &result);
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
DtMailAddressSeq *
|
||||
DtMailValue::toAddress(void)
|
||||
{
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
void
|
||||
DtMailValue::fromAddress(const DtMailAddressSeq &)
|
||||
{
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
const char *
|
||||
DtMailValue::raw(void)
|
||||
{
|
||||
|
||||
@@ -457,14 +457,6 @@ FileShare::readWriteOverride(DtMailEnv & error)
|
||||
return(answer);
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailBoolean
|
||||
FileShare::locked(void)
|
||||
{
|
||||
return(_have_write_access);
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
Tt_message
|
||||
FileShare::fileCB(Tt_message msg,
|
||||
Tttk_op op,
|
||||
|
||||
@@ -61,57 +61,6 @@ ObjectKey::~ObjectKey(void)
|
||||
delete _type;
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
int
|
||||
ObjectKey::operator==(ObjectKey &)
|
||||
{
|
||||
assert(!"Pure virtual ObjectKey::operator== called");
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
ObjectKey::operator!=(ObjectKey &)
|
||||
{
|
||||
assert(!"Pure virtual ObjectKey::operator!= called\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
ObjectKey::operator<(ObjectKey &)
|
||||
{
|
||||
assert(!"Pure virtual ObjectKey::operator< called\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
ObjectKey::operator<=(ObjectKey &)
|
||||
{
|
||||
assert(!"Pure virtual ObjectKey::operator<= called\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
ObjectKey::operator>(ObjectKey &)
|
||||
{
|
||||
assert(!"Pure virtual ObjectKey::operator> called\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
ObjectKey::operator>=(ObjectKey &)
|
||||
{
|
||||
assert(!"Pure virtual ObjectKey::operator>= called\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
HashVal
|
||||
ObjectKey::hashValue(void)
|
||||
{
|
||||
assert(!"Pure virtual ObjectKey::hashValue called\n");
|
||||
return(0);
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
HashVal
|
||||
ObjectKey::genericHashValue(void * buf, int len)
|
||||
{
|
||||
|
||||
@@ -851,15 +851,6 @@ DtMail::Session::registerDisableGroupPrivilegesCallback(
|
||||
_disableGroupPrivileges_cb_data = cb_data;
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
void
|
||||
DtMail::Session::unregisterDisableGroupPrivilegesCallback(void)
|
||||
{
|
||||
_disableGroupPrivileges_cb = NULL;
|
||||
_disableGroupPrivileges_cb_data = NULL;
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
void
|
||||
DtMail::Session::disableGroupPrivileges(void)
|
||||
{
|
||||
@@ -877,15 +868,6 @@ DtMail::Session::registerEnableGroupPrivilegesCallback(
|
||||
_enableGroupPrivileges_cb_data = cb_data;
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
void
|
||||
DtMail::Session::unregisterEnableGroupPrivilegesCallback(void)
|
||||
{
|
||||
_enableGroupPrivileges_cb = NULL;
|
||||
_enableGroupPrivileges_cb_data = NULL;
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
void
|
||||
DtMail::Session::enableGroupPrivileges(void)
|
||||
{
|
||||
@@ -903,15 +885,6 @@ DtMail::Session::registerBusyCallback(DtMailEnv&,
|
||||
_busy_cb_data = cb_data;
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
void
|
||||
DtMail::Session::unregisterBusyCallback(DtMailEnv & error)
|
||||
{
|
||||
_busy_cb = NULL;
|
||||
_busy_cb_data = NULL;
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
void
|
||||
DtMail::Session::setBusyState(DtMailEnv &error, DtMailBusyState busy_state)
|
||||
{
|
||||
|
||||
@@ -368,91 +368,6 @@ Condition::waitTrue(void)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
void
|
||||
Condition::waitFalse(void)
|
||||
{
|
||||
// Wait for the condition to become true.
|
||||
//
|
||||
#if defined(POSIX_THREADS)
|
||||
MutexLock lock_scope(_mutex);
|
||||
|
||||
while(_state) {
|
||||
cond_wait((cond_t *)_condition, (mutex_t *)_mutex);
|
||||
}
|
||||
#else
|
||||
_state = 0;
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
Condition::waitFor(int new_state)
|
||||
{
|
||||
// Wait for the condition to become true.
|
||||
//
|
||||
#if defined(POSIX_THREADS)
|
||||
MutexLock lock_scope(_mutex);
|
||||
|
||||
while(_state != new_state) {
|
||||
cond_wait((cond_t *)_condition, (mutex_t *)_mutex);
|
||||
}
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
Condition::waitGT(int new_state)
|
||||
{
|
||||
// Wait for the condition to become true.
|
||||
//
|
||||
#if defined(POSIX_THREADS)
|
||||
MutexLock lock_scope(_mutex);
|
||||
|
||||
while(_state > new_state) {
|
||||
cond_wait((cond_t *)_condition, (mutex_t *)_mutex);
|
||||
}
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
Condition::waitLT(int new_state)
|
||||
{
|
||||
// Wait for the condition to become true.
|
||||
//
|
||||
#if defined(POSIX_THREADS)
|
||||
MutexLock lock_scope(_mutex);
|
||||
|
||||
while(_state < new_state) {
|
||||
cond_wait((cond_t *)_condition, (mutex_t *)_mutex);
|
||||
}
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
Condition::waitProcStatus(void)
|
||||
{
|
||||
// Wait for the condition to become true.
|
||||
//
|
||||
#if defined(POSIX_THREADS)
|
||||
MutexLock lock_scope(_mutex);
|
||||
|
||||
while(_state < 0) {
|
||||
cond_wait((cond_t *)_condition, (mutex_t *)_mutex);
|
||||
}
|
||||
#else
|
||||
_state = 0;
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
Thread
|
||||
ThreadCreate(
|
||||
|
||||
@@ -187,70 +187,6 @@ MIMEBodyPart::~MIMEBodyPart(void)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailChecksumState
|
||||
MIMEBodyPart::checksum(DtMailEnv & error)
|
||||
{
|
||||
error.clear();
|
||||
|
||||
// Look for the Content-MD5 header. If it is not present, then
|
||||
// the state is unknown and we can punt.
|
||||
//
|
||||
DtMailEnv my_error;
|
||||
DtMailValueSeq value;
|
||||
_body_env->getHeader(my_error, "Content-MD5", DTM_FALSE, value);
|
||||
if (my_error.isSet()) {
|
||||
return(DtMailCheckUnknown);
|
||||
}
|
||||
|
||||
|
||||
if (_body_type == NULL) {
|
||||
getDtType(error);
|
||||
if (error.isSet()) {
|
||||
return(DtMailCheckUnknown);
|
||||
}
|
||||
}
|
||||
|
||||
char stored_digest[32];
|
||||
int stored_size = 0;
|
||||
RFCMIME::readBase64(stored_digest, stored_size,
|
||||
*(value[0]), strlen(*(value[0])));
|
||||
if (stored_size != 16) {
|
||||
// The MD5 sum must be 16 bytes, or we have a bad checksum.
|
||||
//
|
||||
return(DtMailCheckBad);
|
||||
}
|
||||
|
||||
// See if we call this text. We need to handle md5 checksums
|
||||
// different for text. They must be computed with CRLF line
|
||||
// termination.
|
||||
//
|
||||
char * text_type = DtDtsDataTypeToAttributeValue(_body_type,
|
||||
DtDTS_DA_IS_TEXT,
|
||||
NULL);
|
||||
|
||||
unsigned char digest[16];
|
||||
if (text_type && strcasecmp(text_type, "true") == 0) {
|
||||
RFCMIME::md5PlainText(_body, _body_decoded_len, digest);
|
||||
}
|
||||
else {
|
||||
MD5_CTX context;
|
||||
MD5Init(&context);
|
||||
MD5Update(&context, (unsigned char *)_body, _body_decoded_len);
|
||||
MD5Final(digest, &context);
|
||||
}
|
||||
|
||||
free(text_type);
|
||||
|
||||
if (memcmp(digest, stored_digest, sizeof(digest)) == 0) {
|
||||
return(DtMailCheckGood);
|
||||
}
|
||||
else {
|
||||
return(DtMailCheckBad);
|
||||
}
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
static int
|
||||
countTypes(char ** types)
|
||||
{
|
||||
|
||||
@@ -127,12 +127,6 @@ class RFCMessage : public DtMail::Message {
|
||||
virtual DtMail::BodyPart * newBodyPart(DtMailEnv &,
|
||||
DtMail::BodyPart *);
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
virtual void newBodyPartOrder(DtMailEnv &,
|
||||
DtMail::BodyPart *,
|
||||
const int) { };
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
virtual void setFlag(DtMailEnv &,
|
||||
const DtMailMessageState);
|
||||
|
||||
@@ -460,10 +454,6 @@ class RFCBodyPart : public DtMail::BodyPart {
|
||||
virtual char *csFromContentType(DtMailValueSeq & value) = 0;
|
||||
// End of For CHARSET
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
virtual DtMailChecksumState checksum(DtMailEnv &) = 0;
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
// Methods below this point are specific to RFCBodyPart.
|
||||
//
|
||||
virtual char *writeBodyParts(char * buf) = 0;
|
||||
@@ -529,10 +519,6 @@ class MIMEBodyPart : public RFCBodyPart {
|
||||
const char ** end,
|
||||
const char * boundary);
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
virtual DtMailChecksumState checksum(DtMailEnv &);
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
char *writeBodyParts(char * buf);
|
||||
|
||||
int rfcSize(const char * boundary, DtMailBoolean &);
|
||||
@@ -573,10 +559,6 @@ class V3BodyPart : public RFCBodyPart {
|
||||
const char * start,
|
||||
const char ** end);
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
virtual DtMailChecksumState checksum(DtMailEnv &);
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
char *writeBodyParts(char * buf);
|
||||
|
||||
int rfcSize(const char * boundary, DtMailBoolean &);
|
||||
@@ -657,9 +639,6 @@ class RFCMailBox : public DtMail::MailBox
|
||||
const DtMailHeaderRequest &,
|
||||
DtMailHeaderLine &);
|
||||
virtual const char *impl(DtMailEnv & error);
|
||||
#ifdef DEAD_WOOD
|
||||
virtual int messageCount(DtMailEnv &);
|
||||
#endif /* DEAD_WOOD */
|
||||
virtual DtMail::Message *newMessage(DtMailEnv &);
|
||||
virtual DtMailCallbackOp retrieveNewMail(DtMailEnv&);
|
||||
virtual void updateMailRetrievalPassword(char *passwd=NULL);
|
||||
@@ -897,14 +876,8 @@ class RFCValue : public DtMailValue {
|
||||
virtual const char * operator= (const char *);
|
||||
|
||||
virtual DtMailValueDate toDate(void);
|
||||
#ifdef DEAD_WOOD
|
||||
virtual void fromDate(const DtMailValueDate &) { }
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
virtual DtMailAddressSeq * toAddress(void);
|
||||
#ifdef DEAD_WOOD
|
||||
virtual void fromAddress(const DtMailAddressSeq &) { }
|
||||
#endif /* DEAD_WOOD */
|
||||
virtual const char * raw(void);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -243,10 +243,6 @@ RFCMIME::getEncodingType(const char * body,
|
||||
}
|
||||
|
||||
if (curChar == '\n') {
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailProcessClientEvents();
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
if ((cur - last_nl) > 76) {
|
||||
encode = DTM_TRUE;
|
||||
qprint_growth += 2;
|
||||
@@ -352,10 +348,6 @@ RFCMIME::getEncodingType(const char * body,
|
||||
}
|
||||
|
||||
if (*cur == '\n') {
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailProcessClientEvents();
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
if (strict_mime && ((cur - last_nl) > 76)) {
|
||||
qprint_growth += 2;
|
||||
}
|
||||
@@ -786,9 +778,6 @@ RFCMIME::writeBase64(Buffer & buf, const char * bp, const unsigned long len)
|
||||
|
||||
if (lf == 72) {
|
||||
buf.appendData(line, lf);
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailProcessClientEvents();
|
||||
#endif /* DEAD_WOOD */
|
||||
crlf(buf);
|
||||
lf = 0;
|
||||
}
|
||||
@@ -1042,9 +1031,6 @@ RFCMIME::writeQPrint(Buffer & buf, const char * bp, const unsigned long bp_len)
|
||||
if (off > 72) {
|
||||
line_buf[off++] = '=';
|
||||
buf.appendData(line_buf, off);
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailProcessClientEvents();
|
||||
#endif /* DEAD_WOOD */
|
||||
crlf(buf);
|
||||
off = 0;
|
||||
last_nl = 0;
|
||||
@@ -1058,9 +1044,6 @@ RFCMIME::writeQPrint(Buffer & buf, const char * bp, const unsigned long bp_len)
|
||||
if (off) {
|
||||
line_buf[off++] = '=';
|
||||
buf.appendData(line_buf, off);
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailProcessClientEvents();
|
||||
#endif /* DEAD_WOOD */
|
||||
crlf(buf);
|
||||
last_nl = 0;
|
||||
off = 0;
|
||||
@@ -1109,9 +1092,6 @@ RFCMIME::writeQPrint(Buffer & buf, const char * bp, const unsigned long bp_len)
|
||||
}
|
||||
|
||||
buf.appendData(line_buf, off);
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailProcessClientEvents();
|
||||
#endif /* DEAD_WOOD */
|
||||
last_nl = 0;
|
||||
off = 0;
|
||||
|
||||
@@ -1175,9 +1155,6 @@ RFCMIME::writePlainText(Buffer & buf, const char * bp, const unsigned long len)
|
||||
}
|
||||
|
||||
buf.appendData(line_start, real_end - line_start);
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailProcessClientEvents();
|
||||
#endif /* DEAD_WOOD */
|
||||
line_start = cur + 1;
|
||||
crlf(buf);
|
||||
}
|
||||
@@ -1212,9 +1189,6 @@ RFCMIME::md5PlainText(const char * bp, const unsigned long len, unsigned char *
|
||||
const char * cur;
|
||||
for (cur = bp; cur < (bp + len); cur++) {
|
||||
if (*cur == '\n') {
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailProcessClientEvents();
|
||||
#endif /* DEAD_WOOD */
|
||||
if (cur == bp || *(cur - 1) == '\r') {
|
||||
MD5Update(&context, (unsigned char *)last,
|
||||
cur - last + 1);
|
||||
@@ -1354,9 +1328,6 @@ RFCMIME::formatBodies(DtMailEnv & error,
|
||||
(unsigned char *)bp_contents,
|
||||
(unsigned int) bp_len);
|
||||
MD5Final(digest, &context);
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailProcessClientEvents();
|
||||
#endif /* DEAD_WOOD */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1484,9 +1455,6 @@ RFCMIME::formatBodies(DtMailEnv & error,
|
||||
(unsigned char *)bp_contents,
|
||||
(unsigned int) bp_len);
|
||||
MD5Final(digest, &context);
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailProcessClientEvents();
|
||||
#endif /* DEAD_WOOD */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1638,10 +1606,6 @@ RFCMIME::getHdrEncodingType(const char * body,
|
||||
}
|
||||
|
||||
if (curChar == '\n') {
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailProcessClientEvents();
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
if ((cur - last_nl) > 76) {
|
||||
encode = DTM_TRUE;
|
||||
qprint_growth += 2;
|
||||
|
||||
@@ -924,23 +924,6 @@ RFCMailBox::save()
|
||||
CheckPointEvent();
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
int
|
||||
RFCMailBox::messageCount(DtMailEnv & error)
|
||||
{
|
||||
error.clear();
|
||||
|
||||
_at_eof.waitTrue();
|
||||
|
||||
if (_object_valid->state() <= 0) {
|
||||
error.setError(DTME_ObjectInvalid);
|
||||
return(0);
|
||||
}
|
||||
|
||||
return(_msg_list.length());
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
DtMailMessageHandle
|
||||
RFCMailBox::getFirstMessageSummary(DtMailEnv & error,
|
||||
const DtMailHeaderRequest & request,
|
||||
|
||||
@@ -103,10 +103,6 @@ writeToFileDesc(const char * buf, int len, va_list args)
|
||||
|
||||
if (status < 0 && errno != 0) // Did an error occur??
|
||||
saveErrno = (unsigned long)errno; // Yes: remember "last" errno
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailProcessClientEvents();
|
||||
#endif /* DEAD_WOOD */
|
||||
}
|
||||
|
||||
return(saveErrno); // return last error recorded
|
||||
|
||||
@@ -1025,9 +1025,6 @@ SunV3::uuencode(Buffer & buf,
|
||||
for (cur = ubp; cur < (ubp + whole_lines - 2); cur += 45) {
|
||||
buf.appendData("M", 1);
|
||||
encode_uue_line(buf, cur, 45);
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailProcessClientEvents();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Write the partial line.
|
||||
|
||||
@@ -315,16 +315,6 @@ V3BodyPart::~V3BodyPart(void)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailChecksumState
|
||||
V3BodyPart::checksum(DtMailEnv & error)
|
||||
{
|
||||
error.clear();
|
||||
|
||||
return(DtMailCheckUnknown);
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
static int
|
||||
countTypes(char ** types)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user