1N/A * Copyright (c) 1999-2004, 2009 Sendmail, Inc. and its suppliers. 1N/A * All rights reserved. 1N/A * By using this file, you agree to the terms and conditions set 1N/A * forth in the LICENSE file which can be found at the top level of 1N/A * the sendmail distribution. 1N/A** SMFI_SETMAXDATASIZE -- set limit for milter data read/write. 1N/A** MI_RD_CMD -- read a command 1N/A** sd -- socket descriptor 1N/A** timeout -- maximum time to wait 1N/A** cmd -- single character command read from sd 1N/A** rlen -- pointer to length of result 1N/A** name -- name of milter 1N/A** buffer with rest of command 1N/A** (malloc()ed here, should be free()d) 1N/A** hack: encode error in cmd 1N/A "%s, mi_rd_cmd: read returned %d: %s",
1N/A "%s: mi_rd_cmd: %s() returned %d: %s",
1N/A#
else /* _FFR_ADD_NULL */ 1N/A#
endif /* _FFR_ADD_NULL */ 1N/A "%s: mi_rd_cmd: read returned %d: %s",
1N/A /* makes life simpler for common string routines */ 1N/A#
endif /* _FFR_ADD_NULL */ 1N/A /* select returned 0 (timeout) or < 0 (error) */ 1N/A "%s: mi_rd_cmd: %s() returned %d: %s",
1N/A** RETRY_WRITEV -- Keep calling the writev() system call 1N/A** until all the data is written out or an error occurs. 1N/A** fd -- socket descriptor 1N/A** iovcnt -- number of elements in io vector 1N/A** must NOT exceed UIO_MAXIOV. 1N/A** timeout -- maximum time to wait 1N/A** success: number of bytes written 1N/A** otherwise: MI_FAILURE 1N/A ** We don't care much about the timeout here, 1N/A ** it's very long anyway; correct solution would be 1N/A ** to take the time before the loop and reduce the 1N/A ** timeout after each invocation. 1N/A ** FD_SETSIZE is checked when socket is created. 1N/A** MI_WR_CMD -- write a cmd to sd 1N/A** sd -- socket descriptor 1N/A** timeout -- maximum time to wait 1N/A** cmd -- single character command to write 1N/A** buf -- buffer with further data 1N/A** len -- length of buffer (without cmd!) 1N/A /* set up the vector for the size / command */