]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
remove UNUSED_CODE and OLD_CODE sections
authorwessels <>
Tue, 28 Oct 1997 05:53:09 +0000 (05:53 +0000)
committerwessels <>
Tue, 28 Oct 1997 05:53:09 +0000 (05:53 +0000)
src/disk.cc
src/http.cc
src/stat.cc

index 4128da6e8cf9ecc4ffdf7e1e15bcf66747bd3be8..8fd64cfdaebbd85ca994abe349ce51c0b6d5bd54 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: disk.cc,v 1.87 1997/10/25 17:22:38 wessels Exp $
+ * $Id: disk.cc,v 1.88 1997/10/27 22:53:09 wessels Exp $
  *
  * DEBUG: section 6     Disk I/O Routines
  * AUTHOR: Harvest Derived
@@ -119,31 +119,12 @@ typedef struct open_ctrl_t {
     char *path;
 } open_ctrl_t;
 
-#if UNUSED_CODE
-typedef struct _dwalk_ctrl {
-    int fd;
-    off_t offset;
-    int cur_len;
-    char *buf;                 /* line buffer */
-    FILE_WALK_HD *handler;
-    void *client_data;
-    FILE_WALK_LHD *line_handler;
-    void *line_data;
-} dwalk_ctrl;
-
-#endif
-
 static AIOCB diskHandleWriteComplete;
 static AIOCB diskHandleReadComplete;
 static PF diskHandleRead;
 static PF diskHandleWrite;
 static void file_open_complete(void *, int, int);
 
-#if UNUSED_CODE
-static AIOCB diskHandleWalkComplete;
-static PF diskHandleWalk;
-#endif
-
 /* initialize table */
 int
 disk_init(void)
@@ -482,121 +463,6 @@ file_read(int fd, char *buf, int req_len, int offset, DRCB * handler, void *clie
     return DISK_OK;
 }
 
-
-#if UNUSED_CODE
-/* Read from FD and pass a line to routine. Walk to EOF. */
-static void
-diskHandleWalk(int fd, void *data)
-{
-    dwalk_ctrl *walk_dat = data;
-#if !USE_ASYNC_IO
-    int len;
-#endif
-    disk_ctrl_t *ctrlp = xcalloc(1, sizeof(disk_ctrl_t));
-    ctrlp->fd = fd;
-    ctrlp->data = walk_dat;
-#if USE_ASYNC_IO
-    aioRead(fd,
-       walk_dat->buf,
-       DISK_LINE_LEN - 1,
-       diskHandleWalkComplete,
-       ctrlp);
-#else
-    len = read(fd, walk_dat->buf, DISK_LINE_LEN - 1);
-    diskHandleWalkComplete(ctrlp, len, errno);
-#endif
-}
-#endif
-
-#if UNUSED_CODE
-static void
-diskHandleWalkComplete(void *data, int retcode, int errcode)
-{
-    disk_ctrl_t *ctrlp = (disk_ctrl_t *) data;
-    dwalk_ctrl *walk_dat;
-    int fd;
-    int len;
-    LOCAL_ARRAY(char, temp_line, DISK_LINE_LEN);
-    int end_pos;
-    int st_pos;
-    int used_bytes;
-    walk_dat = (dwalk_ctrl *) ctrlp->data;
-    fd = ctrlp->fd;
-    len = retcode;
-    errno = errcode;
-    xfree(data);
-    if (len < 0) {
-       if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
-           commSetSelect(fd, COMM_SELECT_READ, diskHandleWalk, walk_dat, 0);
-           return;
-       }
-       debug(50, 1) ("diskHandleWalk: FD %d: error readingd: %s\n",
-           fd, xstrerror());
-       walk_dat->handler(fd, DISK_ERROR, walk_dat->client_data);
-       safe_free(walk_dat->buf);
-       safe_free(walk_dat);
-       return;
-    } else if (len == 0) {
-       /* EOF */
-       walk_dat->handler(fd, DISK_EOF, walk_dat->client_data);
-       safe_free(walk_dat->buf);
-       safe_free(walk_dat);
-       return;
-    }
-    /* emulate fgets here. Cut the into separate line. newline is excluded */
-    /* it throws last partial line, if exist, away. */
-    used_bytes = st_pos = end_pos = 0;
-    while (end_pos < len) {
-       if (walk_dat->buf[end_pos] == '\n') {
-           /* new line found */
-           xstrncpy(temp_line, walk_dat->buf + st_pos, end_pos - st_pos + 1);
-           used_bytes += end_pos - st_pos + 1;
-           /* invoke line handler */
-           walk_dat->line_handler(fd, temp_line, strlen(temp_line),
-               walk_dat->line_data);
-           /* skip to next line */
-           st_pos = end_pos + 1;
-       }
-       end_pos++;
-    }
-    /* update file pointer to the next to be read character */
-    walk_dat->offset += used_bytes;
-    /* reschedule it for next line. */
-    commSetSelect(fd, COMM_SELECT_READ, diskHandleWalk, walk_dat, 0);
-}
-#endif
-
-#if UNUSED_CODE
-/* start walk through whole file operation 
- * read one block and chop it to a line and pass it to provided 
- * handler one line at a time.
- * call a completion handler when done. */
-int
-file_walk(int fd,
-    FILE_WALK_HD * handler,
-    void *client_data,
-    FILE_WALK_LHD * line_handler,
-    void *line_data)
-{
-    dwalk_ctrl *walk_dat;
-    walk_dat = xcalloc(1, sizeof(dwalk_ctrl));
-    walk_dat->fd = fd;
-    walk_dat->offset = 0;
-    walk_dat->buf = xcalloc(1, DISK_LINE_LEN);
-    walk_dat->cur_len = 0;
-    walk_dat->handler = handler;
-    walk_dat->client_data = client_data;
-    walk_dat->line_handler = line_handler;
-    walk_dat->line_data = line_data;
-#if USE_ASYNC_IO
-    diskHandleWalk(fd, walk_dat);
-#else
-    commSetSelect(fd, COMM_SELECT_READ, diskHandleWalk, walk_dat, 0);
-#endif
-    return DISK_OK;
-}
-#endif
-
 int
 diskWriteIsComplete(int fd)
 {
index ccd056804e074db6cb423f6c578fc38baeeb0375..1b96573626cc47c57dc0b814b2abb537cd3e33b1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.203 1997/10/27 22:49:49 wessels Exp $
+ * $Id: http.cc,v 1.204 1997/10/27 22:53:10 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -456,14 +456,6 @@ httpCheckPublic(struct _http_reply *reply, HttpStateData * httpState)
            return 1;
        if (reply->expires > -1)
            return 1;
-#ifdef OLD_CODE
-       if (entry->mem_obj->request->protocol != PROTO_HTTP)
-           /* XXX Remove this check after a while.  DW 8/21/96
-            * We won't keep some FTP objects from neighbors running
-            * 1.0.8 or earlier because their ftpget's don't 
-            * add a Date: field */
-           return 1;
-#endif
        else
            return 0;
        break;
index 8b077b6b2d15c9202dd8177ea2ca8afc04d3b39e..921d35a2f7ad3b6ad8a3b18aedbbd135a37cdf84 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.162 1997/10/25 17:22:59 wessels Exp $
+ * $Id: stat.cc,v 1.163 1997/10/27 22:53:12 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -337,9 +337,6 @@ statObjects(StoreEntry * sentry, int vm_or_not)
     int N = 0;
     int i;
     struct _store_client *sc;
-#if OLD_CODE
-    storeAppendPrintf(sentry, open_bracket);
-#endif
     for (entry = storeGetFirst(); entry != NULL; entry = storeGetNext()) {
        mem = entry->mem_obj;
        if (vm_or_not && mem == NULL)
@@ -347,17 +344,6 @@ statObjects(StoreEntry * sentry, int vm_or_not)
        if ((++N & 0xFF) == 0) {
            debug(18, 3) ("stat_objects_get:  Processed %d objects...\n", N);
        }
-#if OLD_CODE
-       storeAppendPrintf(sentry, "{%s %dL %-25s %s %3d %2d %8d %s}\n",
-           describeStatuses(entry),
-           (int) entry->lock_count,
-           describeFlags(entry),
-           describeTimestamps(entry),
-           (int) entry->refcount,
-           storePendingNClients(entry),
-           mem ? mem->inmem_hi : entry->object_len,
-           entry->url);
-#else
        storeAppendPrintf(sentry, "%s %s\n",
            RequestMethodStr[entry->method], entry->url);
        storeAppendPrintf(sentry, "\t%s\n", describeStatuses(entry));
@@ -391,11 +377,7 @@ statObjects(StoreEntry * sentry, int vm_or_not)
            storeAppendPrintf(sentry, "\t\tswapin_fd: %d\n",
                (int) sc->swapin_fd);
        }
-#endif
     }
-#if OLD_CODE
-    storeAppendPrintf(sentry, close_bracket);
-#endif
 }
 
 void