projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f00b2e2
)
* fill the migrate buffer so the new sock_getln works
author
Wilfried Göesgens
<willi@citadel.org>
Sun, 21 Feb 2010 21:05:43 +0000
(21:05 +0000)
committer
Wilfried Göesgens
<willi@citadel.org>
Sun, 21 Feb 2010 21:05:43 +0000
(21:05 +0000)
citadel/modules/clamav/serv_virus.c
patch
|
blob
|
history
citadel/modules/network/serv_network.c
patch
|
blob
|
history
citadel/modules/pop3client/serv_pop3client.c
patch
|
blob
|
history
citadel/modules/smtp/serv_smtp.c
patch
|
blob
|
history
citadel/modules/spam/serv_spam.c
patch
|
blob
|
history
diff --git
a/citadel/modules/clamav/serv_virus.c
b/citadel/modules/clamav/serv_virus.c
index 42cfee005465f40594aa9bda1937b1288738e029..7d2aba4c779951bb8d0bb9c34487592ae44b7506 100644
(file)
--- a/
citadel/modules/clamav/serv_virus.c
+++ b/
citadel/modules/clamav/serv_virus.c
@@
-85,6
+85,7
@@
int clamd(struct CtdlMessage *msg) {
int clamhost;
char *msgtext;
size_t msglen;
int clamhost;
char *msgtext;
size_t msglen;
+ CitContext *CCC;
/* Don't care if you're logged in. You can still spread viruses.
*/
/* Don't care if you're logged in. You can still spread viruses.
*/
@@
-117,6
+118,10
@@
int clamd(struct CtdlMessage *msg) {
*/
return(0);
}
*/
return(0);
}
+ CCC=CC;
+ CCC->sReadBuf = NewStrBuf();
+ CCC->sMigrateBuf = NewStrBuf();
+ CCC->sPos = NULL;
/* Command */
CtdlLogPrintf(CTDL_DEBUG, "Transmitting STREAM command\n");
/* Command */
CtdlLogPrintf(CTDL_DEBUG, "Transmitting STREAM command\n");
@@
-143,6
+148,8
@@
int clamd(struct CtdlMessage *msg) {
/* If the service isn't running, just pass the mail
* through. Potentially throwing away mails isn't good.
*/
/* If the service isn't running, just pass the mail
* through. Potentially throwing away mails isn't good.
*/
+ FreeStrBuf(&CCC->sReadBuf);
+ FreeStrBuf(&CCC->sMigrateBuf);
return(0);
}
else {
return(0);
}
else {
@@
-189,6
+196,8
@@
int clamd(struct CtdlMessage *msg) {
}
bail: close(sock);
}
bail: close(sock);
+ FreeStrBuf(&CCC->sReadBuf);
+ FreeStrBuf(&CCC->sMigrateBuf);
return(is_virus);
}
return(is_virus);
}
diff --git
a/citadel/modules/network/serv_network.c
b/citadel/modules/network/serv_network.c
index 2ac84e3afa3159e38b2be0e2bd6e1d130f6400df..db178a4b2a12cb5656e727046dcbab7a074f63b0 100644
(file)
--- a/
citadel/modules/network/serv_network.c
+++ b/
citadel/modules/network/serv_network.c
@@
-2006,6
+2006,7
@@
void network_poll_node(char *node, char *secret, char *host, char *port) {
char buf[SIZ];
char err_buf[SIZ];
char connected_to[SIZ];
char buf[SIZ];
char err_buf[SIZ];
char connected_to[SIZ];
+ CitContext *CCC=CC;
if (network_talking_to(node, NTT_CHECK)) return;
network_talking_to(node, NTT_ADD);
if (network_talking_to(node, NTT_CHECK)) return;
network_talking_to(node, NTT_ADD);
@@
-2019,7
+2020,9
@@
void network_poll_node(char *node, char *secret, char *host, char *port) {
}
CtdlLogPrintf(CTDL_DEBUG, "Connected!\n");
}
CtdlLogPrintf(CTDL_DEBUG, "Connected!\n");
-
+ CCC->sReadBuf = NewStrBuf();
+ CCC->sMigrateBuf = NewStrBuf();
+ CCC->sPos = NULL;
/* Read the server greeting */
if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
CtdlLogPrintf(CTDL_DEBUG, ">%s\n", buf);
/* Read the server greeting */
if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
CtdlLogPrintf(CTDL_DEBUG, ">%s\n", buf);
@@
-2050,6
+2053,8
@@
void network_poll_node(char *node, char *secret, char *host, char *port) {
sock_puts(&sock, "QUIT");
bail:
sock_puts(&sock, "QUIT");
bail:
+ FreeStrBuf(&CCC->sReadBuf);
+ FreeStrBuf(&CCC->sMigrateBuf);
if (sock != -1)
sock_close(sock);
network_talking_to(node, NTT_REMOVE);
if (sock != -1)
sock_close(sock);
network_talking_to(node, NTT_REMOVE);
diff --git
a/citadel/modules/pop3client/serv_pop3client.c
b/citadel/modules/pop3client/serv_pop3client.c
index 775a892ce3c19c46f3eed38c5c57484164d0403e..8a0693304611d418ec46e5ebc71ced13cc3f317d 100644
(file)
--- a/
citadel/modules/pop3client/serv_pop3client.c
+++ b/
citadel/modules/pop3client/serv_pop3client.c
@@
-82,6
+82,7
@@
void pop3_do_fetching(char *roomname, char *pop3host, char *pop3user, char *pop3
char utmsgid[SIZ];
struct cdbdata *cdbut;
struct UseTable ut;
char utmsgid[SIZ];
struct cdbdata *cdbut;
struct UseTable ut;
+ CitContext *CCC=CC;
CtdlLogPrintf(CTDL_DEBUG, "POP3: %s %s %s <password>\n", roomname, pop3host, pop3user);
CtdlLogPrintf(CTDL_NOTICE, "Connecting to <%s>\n", pop3host);
CtdlLogPrintf(CTDL_DEBUG, "POP3: %s %s %s <password>\n", roomname, pop3host, pop3user);
CtdlLogPrintf(CTDL_NOTICE, "Connecting to <%s>\n", pop3host);
@@
-99,6
+100,9
@@
void pop3_do_fetching(char *roomname, char *pop3host, char *pop3user, char *pop3
goto bail;
CtdlLogPrintf(CTDL_DEBUG, "Connected!\n");
goto bail;
CtdlLogPrintf(CTDL_DEBUG, "Connected!\n");
+ CCC->sReadBuf = NewStrBuf();
+ CCC->sMigrateBuf = NewStrBuf();
+ CCC->sPos = NULL;
/* Read the server greeting */
if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
/* Read the server greeting */
if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
@@
-243,6
+247,9
@@
void pop3_do_fetching(char *roomname, char *pop3host, char *pop3user, char *pop3
if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
CtdlLogPrintf(CTDL_DEBUG, ">%s\n", buf);
bail:
if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
CtdlLogPrintf(CTDL_DEBUG, ">%s\n", buf);
bail:
+ FreeStrBuf(&CCC->sReadBuf);
+ FreeStrBuf(&CCC->sMigrateBuf);
+
if (sock != -1)
sock_close(sock);
if (msglist) free(msglist);
if (sock != -1)
sock_close(sock);
if (msglist) free(msglist);
diff --git
a/citadel/modules/smtp/serv_smtp.c
b/citadel/modules/smtp/serv_smtp.c
index a25303e87a3143dfe4af253e3b8bb967561b925b..f0ae5657ee0e1aa3cda8b3d0e14cd60eddf7b5e8 100644
(file)
--- a/
citadel/modules/smtp/serv_smtp.c
+++ b/
citadel/modules/smtp/serv_smtp.c
@@
-978,6
+978,7
@@
void smtp_try(const char *key, const char *addr, int *status,
char *ptr;
size_t msg_size;
int scan_done;
char *ptr;
size_t msg_size;
int scan_done;
+ CitContext *CCC=CC;
/* Parse out the host portion of the recipient address */
/* Parse out the host portion of the recipient address */
@@
-987,15
+988,15
@@
void smtp_try(const char *key, const char *addr, int *status,
user, node, name);
/* Load the message out of the database */
user, node, name);
/* Load the message out of the database */
- CC->redirect_buffer = malloc(SIZ);
- CC->redirect_len = 0;
- CC->redirect_alloc = SIZ;
+ CC
C
->redirect_buffer = malloc(SIZ);
+ CC
C
->redirect_len = 0;
+ CC
C
->redirect_alloc = SIZ;
CtdlOutputMsg(msgnum, MT_RFC822, HEADERS_ALL, 0, 1, NULL, ESC_DOT);
msgtext = CC->redirect_buffer;
msg_size = CC->redirect_len;
CtdlOutputMsg(msgnum, MT_RFC822, HEADERS_ALL, 0, 1, NULL, ESC_DOT);
msgtext = CC->redirect_buffer;
msg_size = CC->redirect_len;
- CC->redirect_buffer = NULL;
- CC->redirect_len = 0;
- CC->redirect_alloc = 0;
+ CC
C
->redirect_buffer = NULL;
+ CC
C
->redirect_len = 0;
+ CC
C
->redirect_alloc = 0;
/* If no envelope_from is supplied, extract one from the message */
if ( (envelope_from == NULL) || (IsEmptyStr(envelope_from)) ) {
/* If no envelope_from is supplied, extract one from the message */
if ( (envelope_from == NULL) || (IsEmptyStr(envelope_from)) ) {
@@
-1102,6
+1103,10
@@
void smtp_try(const char *key, const char *addr, int *status,
return;
}
return;
}
+ CCC->sReadBuf = NewStrBuf();
+ CCC->sMigrateBuf = NewStrBuf();
+ CCC->sPos = NULL;
+
/* Process the SMTP greeting from the server */
if (ml_sock_gets(&sock, buf) < 0) {
*status = 4;
/* Process the SMTP greeting from the server */
if (ml_sock_gets(&sock, buf) < 0) {
*status = 4;
@@
-1294,6
+1299,8
@@
void smtp_try(const char *key, const char *addr, int *status,
user, node, name);
bail: free(msgtext);
user, node, name);
bail: free(msgtext);
+ FreeStrBuf(&CCC->sReadBuf);
+ FreeStrBuf(&CCC->sMigrateBuf);
if (sock != -1)
sock_close(sock);
if (sock != -1)
sock_close(sock);
diff --git
a/citadel/modules/spam/serv_spam.c
b/citadel/modules/spam/serv_spam.c
index 840fd749f330b03fb635c2b9484d53cb39f5e084..b8f3a6c960d5d669e5cb78005406994402ee7721 100644
(file)
--- a/
citadel/modules/spam/serv_spam.c
+++ b/
citadel/modules/spam/serv_spam.c
@@
-82,6
+82,7
@@
int spam_assassin(struct CtdlMessage *msg) {
int sa;
char *msgtext;
size_t msglen;
int sa;
char *msgtext;
size_t msglen;
+ CitContext *CCC=CC;
/* For users who have authenticated to this server we never want to
* apply spam filtering, because presumably they're trustworthy.
/* For users who have authenticated to this server we never want to
* apply spam filtering, because presumably they're trustworthy.
@@
-107,21
+108,25
@@
int spam_assassin(struct CtdlMessage *msg) {
return(0);
}
return(0);
}
+ CCC->sReadBuf = NewStrBuf();
+ CCC->sMigrateBuf = NewStrBuf();
+ CCC->sPos = NULL;
+
/* Command */
CtdlLogPrintf(CTDL_DEBUG, "Transmitting command\n");
sprintf(buf, "CHECK SPAMC/1.2\r\n\r\n");
sock_write(&sock, buf, strlen(buf));
/* Message */
/* Command */
CtdlLogPrintf(CTDL_DEBUG, "Transmitting command\n");
sprintf(buf, "CHECK SPAMC/1.2\r\n\r\n");
sock_write(&sock, buf, strlen(buf));
/* Message */
- CC->redirect_buffer = malloc(SIZ);
- CC->redirect_len = 0;
- CC->redirect_alloc = SIZ;
+ CC
C
->redirect_buffer = malloc(SIZ);
+ CC
C
->redirect_len = 0;
+ CC
C
->redirect_alloc = SIZ;
CtdlOutputPreLoadedMsg(msg, MT_RFC822, HEADERS_ALL, 0, 1, 0);
msgtext = CC->redirect_buffer;
msglen = CC->redirect_len;
CtdlOutputPreLoadedMsg(msg, MT_RFC822, HEADERS_ALL, 0, 1, 0);
msgtext = CC->redirect_buffer;
msglen = CC->redirect_len;
- CC->redirect_buffer = NULL;
- CC->redirect_len = 0;
- CC->redirect_alloc = 0;
+ CC
C
->redirect_buffer = NULL;
+ CC
C
->redirect_len = 0;
+ CC
C
->redirect_alloc = 0;
sock_write(&sock, msgtext, msglen);
free(msgtext);
sock_write(&sock, msgtext, msglen);
free(msgtext);
@@
-192,6
+197,8
@@
int spam_assassin(struct CtdlMessage *msg) {
}
bail: close(sock);
}
bail: close(sock);
+ FreeStrBuf(&CCC->sReadBuf);
+ FreeStrBuf(&CCC->sMigrateBuf);
return(is_spam);
}
return(is_spam);
}