#include "support.h"
#include "config.h"
#include "control.h"
-#include "room_ops.h"
#include "user_ops.h"
#include "policy.h"
#include "database.h"
/* Command */
CtdlLogPrintf(CTDL_DEBUG, "Transmitting command\n");
sprintf(buf, "CHECK SPAMC/1.2\r\n\r\n");
- sock_write(sock, buf, strlen(buf));
+ sock_write(&sock, buf, strlen(buf));
/* Message */
CC->redirect_buffer = malloc(SIZ);
CC->redirect_len = 0;
CC->redirect_alloc = 0;
- sock_write(sock, msgtext, msglen);
+ sock_write(&sock, msgtext, msglen);
free(msgtext);
/* Close one end of the socket connection; this tells SpamAssassin
* that we're done.
*/
- sock_shutdown(sock, SHUT_WR);
+ if (sock != -1)
+ sock_shutdown(sock, SHUT_WR);
/* Response */
CtdlLogPrintf(CTDL_DEBUG, "Awaiting response\n");
- if (sock_getln(sock, buf, sizeof buf) < 0) {
+ if (sock_getln(&sock, buf, sizeof buf) < 0) {
goto bail;
}
CtdlLogPrintf(CTDL_DEBUG, "<%s\n", buf);
if (strncasecmp(buf, "SPAMD", 5)) {
goto bail;
}
- if (sock_getln(sock, buf, sizeof buf) < 0) {
+ if (sock_getln(&sock, buf, sizeof buf) < 0) {
goto bail;
}
CtdlLogPrintf(CTDL_DEBUG, "<%s\n", buf);