r218 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Wed Jun 21 11:58:06 CEST 2006


Author: phk
Date: 2006-06-21 11:58:06 +0200 (Wed, 21 Jun 2006)
New Revision: 218

Modified:
   trunk/varnish-cache/bin/varnishd/storage_file.c
Log:
Quench some debugging


Modified: trunk/varnish-cache/bin/varnishd/storage_file.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_file.c	2006-06-21 08:09:02 UTC (rev 217)
+++ trunk/varnish-cache/bin/varnishd/storage_file.c	2006-06-21 09:58:06 UTC (rev 218)
@@ -278,7 +278,6 @@
 		TAILQ_REMOVE(&sc->free, sp, status);
 		sp->alloc = 1;
 		TAILQ_INSERT_TAIL(&sc->used, sp, status);
-		printf("ALLOC   %12p  %12p %12jx %12jx\n", (void*)sp, (void*)sp->ptr, (uintmax_t)sp->offset, (uintmax_t)sp->size);
 		return (sp);
 	}
 
@@ -295,8 +294,6 @@
 	sp2->alloc = 1;
 	TAILQ_INSERT_BEFORE(sp, sp2, order);
 	TAILQ_INSERT_TAIL(&sc->used, sp2, status);
-	printf("SPLIT   %12p  %12p %12jx %12jx\n", (void*)sp, (void*)sp->ptr, (uintmax_t)sp->offset, (uintmax_t)sp->size);
-	printf("ALLOC   %12p  %12p %12jx %12jx\n", (void*)sp2, (void*)sp2->ptr, (uintmax_t)sp2->offset, (uintmax_t)sp2->size);
 	return (sp2);
 }
 
@@ -311,7 +308,6 @@
 	struct smf *sp2;
 	struct smf_sc *sc = sp->sc;
 
-	printf("FREE   %12p  %12p %12jx %12jx\n", (void*)sp, (void*)sp->ptr, (uintmax_t)sp->offset, (uintmax_t)sp->size);
 	TAILQ_REMOVE(&sc->used, sp, status);
 	sp->alloc = 0;
 
@@ -324,7 +320,6 @@
 		TAILQ_REMOVE(&sc->order, sp2, order);
 		TAILQ_REMOVE(&sc->free, sp2, status);
 		free(sp2);
-		printf("MERGEN %12p  %12p %12jx %12jx\n", (void*)sp, (void*)sp->ptr, (uintmax_t)sp->offset, (uintmax_t)sp->size);
 	}
 
 	sp2 = TAILQ_PREV(sp, smfhead, order);
@@ -338,7 +333,6 @@
 		free(sp);
 		TAILQ_REMOVE(&sc->free, sp2, status);
 		sp = sp2;
-		printf("MERGEP %12p  %12p %12jx %12jx\n", (void*)sp, (void*)sp->ptr, (uintmax_t)sp->offset, (uintmax_t)sp->size);
 	}
 
 	TAILQ_FOREACH(sp2, &sc->free, status) {
@@ -363,7 +357,6 @@
 
 	sp = calloc(sizeof *sp, 1);
 	assert(sp != NULL);
-	printf("NEW    %12p  %12p %12jx %12jx\n", (void*)sp, (void*)ptr, (uintmax_t)off, (uintmax_t)len);
 
 	sp->sc = sc;
 
@@ -496,14 +489,16 @@
 
 	smf = st->priv;
 
-	printf("SEND   %12p  %12p %12jx %12jx\n", (void*)smf, (void*)smf->ptr, (uintmax_t)smf->offset, (uintmax_t)smf->size);
 	vca_flush(sp);
 	i = sendfile(smf->sc->fd,
 	    sp->fd,
 	    smf->offset,
 	    st->len, NULL, &sent, 0);
+	if (sent == st->len)
+		return;
 	printf("sent i=%d sent=%ju size=%ju\n",
 	    i, (uintmax_t)sent, (uintmax_t)st->len);
+	assert(sent == st->len);
 }
 
 /*--------------------------------------------------------------------*/




More information about the varnish-commit mailing list