*/
int time_to_check = 1;
-#ifndef HAVE_SPRINTF
+#ifndef HAVE_SNPRINTF
/*
* snprintf(): snprintf() replacement for systems that miss it. Note
* that this implementation does _not_ necessarily protect
#endif
f->dir_listing = 0;
+#if WANT_UPLOAD
+ f->upload = 0;
+#endif
return f;
}
c->buf_len += bytes_avail;
parse_command(c);
- if (fds[c->sock].revents & (POLLERR|POLLHUP|POLLNVAL)) {
+ if (c->free_me || (fds[c->sock].revents & (POLLERR|POLLHUP|POLLNVAL))) {
destroy_conn(c);
}
}
#endif
if (size > 0 && (write(f->local_file, upload_buf, size) == size)) {
return 1;
- } else if (size == -1) {
+ } else if (size == -1 && errno != EAGAIN) {
/* don't write xferlog... or? */
numeric(f->owner, 426, strerror(errno));
destroy_ftran(f);
{
char fmt[256];
va_list args;
- int i, err;
+ int i;
int in_buf = strlen(message_buf);
snprintf(fmt, 256, "%03u %s\r\n", numeric, format);