goto endloop; /* require a 200 */
sendreq:
+ {
+ int len;
/* Check for another option to send. Newline-terminate it. */
if ((scanrequest = string_nextinlist(&av_scanner_work, &sep,
NULL, 0)))
}
else
{
- scanrequest = string_sprintf("SCAN %s/scan/%s\r\n",
+ scanrequest = string_sprintf("SCAN %s/scan/%s\n",
spool_directory, message_id);
avast_stage = AVA_RSP; /* just sent command */
}
/* send config-cmd or scan-request to socket */
- if (send(sock, scanrequest, Ustrlen(scanrequest), 0) < 0)
+ len = Ustrlen(scanrequest);
+ if (send(sock, scanrequest, len, 0) < 0)
+ {
+ scanrequest[len-1] = '\0';
return m_errlog_defer_3(scanent, string_sprintf(
- "unable to send scan request to socket (%s): %s",
- scanner_options, strerror(errno)),
- sock);
+ "unable to send request '%s' to socket (%s): %s",
+ scanrequest, scanner_options, strerror(errno)), sock);
+ }
break;
+ }
case AVA_RSP:
if (Ustrncmp(buf, "210", 3) == 0)