/* find the username from the option list */
if ((user_name = string_nextinlist(&list, &sep,
/* find the username from the option list */
if ((user_name = string_nextinlist(&list, &sep,
* and we poll the desciptor to make sure that we can write without
* blocking. Short writes are gracefully handled and if the whole
* trasaction takes too long it is aborted.
* and we poll the desciptor to make sure that we can write without
* blocking. Short writes are gracefully handled and if the whole
* trasaction takes too long it is aborted.
fcntl(spamd_sock, F_SETFL, O_NONBLOCK);
do {
read = fread(spamd_buffer,1,sizeof(spamd_buffer),mbox_file);
if (read > 0) {
offset = 0;
again:
fcntl(spamd_sock, F_SETFL, O_NONBLOCK);
do {
read = fread(spamd_buffer,1,sizeof(spamd_buffer),mbox_file);
if (read > 0) {
offset = 0;
again:
result = poll(&pollfd, 1, 1000);
if (result == -1 && errno == EINTR)
continue;
result = poll(&pollfd, 1, 1000);
if (result == -1 && errno == EINTR)
continue;
wrote = send(spamd_sock,spamd_buffer + offset,read - offset,0);
if (offset + wrote != read) {
offset += wrote;
wrote = send(spamd_sock,spamd_buffer + offset,read - offset,0);
if (offset + wrote != read) {
offset += wrote;