diff options
author | Dan Cross <cross@gajendra.net> | 2020-01-10 14:44:21 +0000 |
---|---|---|
committer | Dan Cross <cross@gajendra.net> | 2020-01-10 14:54:30 +0000 |
commit | fa325e9b42b0bdfb48857d1958d9fb7ceac55151 (patch) | |
tree | 81d26256d152435135bcb1ae43121979a49f5f2b /src/cmd/venti/srv/httpd.c | |
parent | 77a0a5b5194d4441c86de097f2aae297cb75e2c2 (diff) | |
download | plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.gz plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.bz2 plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.zip |
Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines.
Remove blank lines from the ends of files.
Change modes on source files so that they
are not executable.
Signed-off-by: Dan Cross <cross@gajendra.net>
Diffstat (limited to 'src/cmd/venti/srv/httpd.c')
-rw-r--r-- | src/cmd/venti/srv/httpd.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/cmd/venti/srv/httpd.c b/src/cmd/venti/srv/httpd.c index 83d80ca7..05896ff4 100644 --- a/src/cmd/venti/srv/httpd.c +++ b/src/cmd/venti/srv/httpd.c @@ -51,7 +51,7 @@ httpdinit(char *address, char *dir) if(address == nil) address = "tcp!*!http"; webroot = dir; - + httpdobj("/stats", estats); httpdobj("/index", dindex); httpdobj("/storage", sindex); @@ -168,7 +168,7 @@ httpproc(void *v) */ if(hparsereq(c, 0) < 0) break; - + for(i = 0; i < MaxObjs && objs[i].name[0]; i++){ n = strlen(objs[i].name); if((objs[i].name[n-1] == '/' && strncmp(c->req.uri, objs[i].name, n) == 0) @@ -196,7 +196,7 @@ char* hargstr(HConnect *c, char *name, char *def) { HSPairs *p; - + for(p=c->req.searchpairs; p; p=p->next) if(strcmp(p->s, name) == 0) return p->t; @@ -207,7 +207,7 @@ vlong hargint(HConnect *c, char *name, vlong def) { char *a; - + if((a = hargstr(c, name, nil)) == nil) return def; return atoll(a); @@ -282,7 +282,7 @@ herror(HConnect *c) { int n; Hio *hout; - + hout = &c->hout; n = snprint(c->xferbuf, HBufSize, "<html><head><title>Error</title></head>\n<body><h1>Error</h1>\n<pre>%r</pre>\n</body></html>"); hprint(hout, "%s %s\r\n", hversion, "400 Bad Request"); @@ -301,7 +301,7 @@ herror(HConnect *c) return hflush(hout); } - + int hnotfound(HConnect *c) { @@ -331,7 +331,7 @@ fromwebdir(HConnect *c) char buf[4096], *p, *ext, *type; int i, fd, n, defaulted; Dir *d; - + if(webroot == nil || strstr(c->req.uri, "..")) return hnotfound(c); snprint(buf, sizeof buf-20, "%s/%s", webroot, c->req.uri+1); @@ -430,7 +430,7 @@ xset(HConnect *c) hflush(&c->hout); return 0; } - + old = *namedints[i].p; *namedints[i].p = atoll(value); hprint(&c->hout, "%s = %d (was %d)\n", name, *namedints[i].p, old); @@ -496,7 +496,7 @@ estats(HConnect *c) percent(stats.absorbedwrites, stats.dirtydblocks)); hprint(hout, "disk cache flushes=%,ld\n", stats.dcacheflushes); - hprint(hout, "disk cache flush writes=%,ld (%,ld per flush)\n", + hprint(hout, "disk cache flush writes=%,ld (%,ld per flush)\n", stats.dcacheflushwrites, stats.dcacheflushwrites/(stats.dcacheflushes ? stats.dcacheflushes : 1)); @@ -821,7 +821,7 @@ diskbw(Stats *s) ulong *n; n = s->n; - return n[StatApartReadBytes]+n[StatApartWriteBytes] + return n[StatApartReadBytes]+n[StatApartWriteBytes] + n[StatIsectReadBytes]+n[StatIsectWriteBytes] + n[StatSumReadBytes]; } @@ -882,7 +882,7 @@ static char* graphname[] = "lcachesize", "lcachestall", "lcachelookuptime", - + "dcachehit", "dcachemiss", "dcachelookup", @@ -931,7 +931,7 @@ static char* graphname[] = "sumread", "sumreadbyte", - + "cigload", "cigloadtime", }; @@ -996,7 +996,7 @@ xgraph(HConnect *c) g.ht = hargint(c, "ht", -1); dotext = hargstr(c, "text", "")[0] != 0; g.fill = hargint(c, "fill", -1); - + graph = hargstr(c, "graph", "raw"); if(strcmp(graph, "raw") == 0) g.fn = rawgraph; @@ -1135,14 +1135,14 @@ vtloghdump(Hio *h, VtLog *l) int i; VtLogChunk *c; char *name; - + name = l ? l->name : "<nil>"; hprint(h, "<html><head>\n"); hprint(h, "<title>Venti Server Log: %s</title>\n", name); hprint(h, "</head><body>\n"); hprint(h, "<b>Venti Server Log: %s</b>\n<p>\n", name); - + if(l){ c = l->w; for(i=0; i<l->nchunk; i++){ @@ -1165,12 +1165,12 @@ vtloghlist(Hio *h) { char **p; int i, n; - + hprint(h, "<html><head>\n"); hprint(h, "<title>Venti Server Logs</title>\n"); hprint(h, "</head><body>\n"); hprint(h, "<b>Venti Server Logs</b>\n<p>\n"); - + p = vtlognames(&n); qsort(p, n, sizeof(p[0]), strpcmp); for(i=0; i<n; i++) |