--------------------- PatchSet 7094 Date: 2005/10/12 05:31:01 Author: adri Branch: tidyup_deferred_reads Tag: (none) Log: * add in some extra debugging * assign the kick type to the right variable - gah enums being ints.. :) Members: src/ftp.c:1.18.6.20.4.3->1.18.6.20.4.4 Index: squid/src/ftp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ftp.c,v retrieving revision 1.18.6.20.4.3 retrieving revision 1.18.6.20.4.4 diff -u -r1.18.6.20.4.3 -r1.18.6.20.4.4 --- squid/src/ftp.c 12 Oct 2005 04:23:06 -0000 1.18.6.20.4.3 +++ squid/src/ftp.c 12 Oct 2005 05:31:01 -0000 1.18.6.20.4.4 @@ -1,6 +1,6 @@ /* - * $Id: ftp.c,v 1.18.6.20.4.3 2005/10/12 04:23:06 adri Exp $ + * $Id: ftp.c,v 1.18.6.20.4.4 2005/10/12 05:31:01 adri Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -920,16 +920,18 @@ static void ftpScheduleDataClear(FtpStateData *ftpState) { - debug(9, 3) ("ftpScheduleDataRead: FD %d\n", ftpState->data.fd); + debug(9, 3) ("ftpScheduleDataClear: FD %d\n", ftpState->data.fd); ftpState->data.pending_read = 0; commSetSelect(ftpState->data.fd, COMM_SELECT_READ, NULL, NULL, 0); commSetDefer(ftpState->data.fd, NULL, NULL); } +#define ftpScheduleDataRead(a) ftpScheduleDataReadDebug((a), __FILE__, __LINE__) + static void -ftpScheduleDataRead(FtpStateData *ftpState) +ftpScheduleDataReadDebug(FtpStateData *ftpState, const char *file, int line) { - debug(9, 3) ("ftpScheduleDataRead: FD %d\n", ftpState->data.fd); + debug(9, 3) ("ftpScheduleDataRead: FD %d, from %s:%d\n", ftpState->data.fd, file, line); ftpState->data.pending_read = 1; commSetSelect(ftpState->data.fd, COMM_SELECT_READ, @@ -940,9 +942,8 @@ } static void -ftpDataReadMaybe(int fd, FtpStateData *ftpState) +ftpDataReadMaybe(FtpStateData *ftpState) { - assert(fd == ftpState->data.fd); if (ftpState->data.pending_kick == STKICK_FETCH || ftpState->data.pending_kick == STKICK_RUN) ftpScheduleDataRead(ftpState); } @@ -951,10 +952,12 @@ ftpDataReadKick(StoreEntry *e, void *data, store_kick_type_t type) { FtpStateData *ftpState = (FtpStateData *)data; - ftpState->data.pending_read = type; + ftpState->data.pending_kick = type; if (type == STKICK_WAIT) { + debug(9, 3) ("ftpDataReadKick: WAITING\n"); ftpScheduleDataClear(ftpState); } else if (type == STKICK_RUN || type == STKICK_FETCH) { + debug(9, 3) ("ftpDataReadKick: RUNNING\n"); ftpScheduleDataRead(ftpState); } else { fatal("ftpDataReadKick: unknown IO kick type!\n"); @@ -1034,7 +1037,7 @@ storeBufferFlush(entry); assert(fd == ftpState->data.fd); /* XXX this'll be turned into 'mayberead' when everything else is right */ - ftpScheduleDataRead(ftpState); + ftpDataReadMaybe(ftpState); } }