IOStats.Ftp.read_hist[bin]++;
}
- if (io.flag != COMM_OK || io.size < 0) {
+ if (io.flag != COMM_OK) {
debugs(50, ignoreErrno(io.xerrno) ? 3 : DBG_IMPORTANT,
"ftpDataRead: read error: " << xstrerr(io.xerrno));
fd_bytes(io.fd, io.size, FD_READ);
}
- if (io.flag != COMM_OK || io.size < 0) {
+ if (io.flag != COMM_OK) {
debugs(50, ignoreErrno(io.xerrno) ? 3 : DBG_IMPORTANT,
"ftpReadControlReply: read error: " << xstrerr(io.xerrno));
} else {
failed(ERR_READ_ERROR, io.xerrno);
/* failed closes ctrl.fd and frees ftpState */
- return;
}
-
return;
}
int clen;
int bin;
size_t read_sz = BUFSIZ;
- int do_next_read = 0;
#if USE_DELAY_POOLS
DelayId delayId = entry->mem_obj->mostBytesAllowed();
#endif
req->hier.bodyBytesRead = 0;
req->hier.bodyBytesRead += len;
-
}
- if (flag != COMM_OK || len < 0) {
+ if (flag != COMM_OK) {
debugs(50, 1, "gopherReadReply: error reading: " << xstrerror());
if (ignoreErrno(errno)) {
- do_next_read = 1;
+ comm_read(fd, buf, read_sz, gopherReadReply, gopherState);
} else {
ErrorState *err;
err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR, gopherState->fwd->request);
err->xerrno = errno;
gopherState->fwd->fail(err);
comm_close(fd);
- do_next_read = 0;
}
} else if (len == 0 && entry->isEmpty()) {
gopherState->fwd->fail(errorCon(ERR_ZERO_SIZE_OBJECT, HTTP_SERVICE_UNAVAILABLE, gopherState->fwd->request));
comm_close(fd);
- do_next_read = 0;
} else if (len == 0) {
/* Connection closed; retrieval done. */
/* flush the rest of data in temp buf if there is one. */
gopherEndHTML(gopherState);
entry->timestampsSet();
-
entry->flush();
-
gopherState->fwd->complete();
-
comm_close(fd);
-
- do_next_read = 0;
} else {
if (gopherState->conversion != gopher_ds::NORMAL) {
gopherToHTML(gopherState, buf, len);
} else {
entry->append(buf, len);
}
-
- do_next_read = 1;
- }
-
- if (do_next_read)
comm_read(fd, buf, read_sz, gopherReadReply, gopherState);
-
- return;
+ }
}
/**