commented out decodeURL(), and minor code clean up

This commit is contained in:
SJ 2012-07-23 16:20:01 +02:00
parent b6228ce8a3
commit a4be8eef0d
2 changed files with 4 additions and 13 deletions

View File

@ -419,6 +419,7 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, int
} }
/* remove all HTML tags */
if(state->texthtml == 1 && state->message_state == MSG_BODY) markHTML(buf, state); if(state->texthtml == 1 && state->message_state == MSG_BODY) markHTML(buf, state);
if(state->message_state == MSG_BODY && state->qp == 1){ if(state->message_state == MSG_BODY && state->qp == 1){
@ -426,7 +427,8 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, int
decodeQP(buf); decodeQP(buf);
} }
decodeURL(buf); /* I believe that we can live without this function call */
//decodeURL(buf);
if(state->texthtml == 1) decodeHTML(buf); if(state->texthtml == 1) decodeHTML(buf);

View File

@ -306,9 +306,7 @@ void fixupSoftBreakInQuotedPritableLine(char *buf, struct _state *state){
if(p){ if(p){
memset(state->qpbuf, 0, MAX_TOKEN_LEN); memset(state->qpbuf, 0, MAX_TOKEN_LEN);
if(strlen(p) < MAX_TOKEN_LEN-1){ if(strlen(p) < MAX_TOKEN_LEN-1){
//snprintf(state->qpbuf, MAX_TOKEN_LEN-1, "%s", p);
memcpy(&(state->qpbuf[0]), p, MAX_TOKEN_LEN-1); memcpy(&(state->qpbuf[0]), p, MAX_TOKEN_LEN-1);
*p = '\0'; *p = '\0';
} }
@ -334,9 +332,7 @@ void fixupBase64EncodedLine(char *buf, struct _state *state){
if(buf[strlen(buf)-1] != '\n'){ if(buf[strlen(buf)-1] != '\n'){
p = strrchr(buf, ' '); p = strrchr(buf, ' ');
if(p){ if(p){
//strncpy(state->miscbuf, p+1, MAX_TOKEN_LEN-1);
memcpy(&(state->miscbuf[0]), p+1, MAX_TOKEN_LEN-1); memcpy(&(state->miscbuf[0]), p+1, MAX_TOKEN_LEN-1);
*p = '\0'; *p = '\0';
} }
} }
@ -478,17 +474,10 @@ void translateLine(unsigned char *p, struct _state *state){
if(strncasecmp((char *)p, "http://", 7) == 0){ p += 7; url = 1; continue; } if(strncasecmp((char *)p, "http://", 7) == 0){ p += 7; url = 1; continue; }
if(strncasecmp((char *)p, "https://", 8) == 0){ p += 8; url = 1; continue; } if(strncasecmp((char *)p, "https://", 8) == 0){ p += 8; url = 1; continue; }
if(url == 1 && (*p == '.' || *p == '-' || *p == '_' || *p == '/' || isalnum(*p)) ) continue; if(url == 1 && (*p == '.' || *p == '-' || *p == '_' || *p == '/' || *p == '%' || *p == '?' || isalnum(*p)) ) continue;
if(url == 1) url = 0; if(url == 1) url = 0;
} }
if(state->texthtml == 1 && state->message_state == MSG_BODY && strncmp((char *)p, "HTML*", 5) == 0){
p += 5;
while(isspace(*p) == 0){
p++;
}
}
if(delimiter_characters[(unsigned int)*p] != ' ') *p = ' '; if(delimiter_characters[(unsigned int)*p] != ' ') *p = ' ';
/* we MUSTN'T convert it to lowercase in the 'else' case, because it breaks utf-8 encoding! */ /* we MUSTN'T convert it to lowercase in the 'else' case, because it breaks utf-8 encoding! */