dtmail: remove DEAD_WOOD code
This commit is contained in:
@@ -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