/*
- * $Id: HttpMsg.cc,v 1.8 2000/11/13 12:25:11 adrian Exp $
+ * $Id: HttpMsg.cc,v 1.9 2000/12/05 09:15:57 wessels Exp $
*
* DEBUG: section 74 HTTP Message
* AUTHOR: Alex Rousskov
int
httpMsgIsPersistent(http_version_t http_ver, const HttpHeader * hdr)
{
- if ((http_ver.major>=1) && (http_ver.minor >= 1)) {
+ if ((http_ver.major >= 1) && (http_ver.minor >= 1)) {
/*
* for modern versions of HTTP: persistent unless there is
* a "Connection: close" header.
/*
- * $Id: HttpReply.cc,v 1.43 2000/11/13 12:25:11 adrian Exp $
+ * $Id: HttpReply.cc,v 1.44 2000/12/05 09:15:57 wessels Exp $
*
* DEBUG: section 58 HTTP Reply (Response)
* AUTHOR: Alex Rousskov
HttpHeader *hdr;
http_version_t ver;
assert(reply);
- httpBuildVersion(&ver,1,0);
+ httpBuildVersion(&ver, 1, 0);
httpStatusLineSet(&reply->sline, ver, status, httpStatusString(status));
hdr = &reply->header;
httpHeaderPutStr(hdr, HDR_SERVER, full_appname_string);
/*
- * $Id: HttpStatusLine.cc,v 1.20 2000/11/13 12:25:11 adrian Exp $
+ * $Id: HttpStatusLine.cc,v 1.21 2000/12/05 09:15:58 wessels Exp $
*
* DEBUG: section 57 HTTP Status-line
* AUTHOR: Alex Rousskov
httpStatusLineInit(HttpStatusLine * sline)
{
http_version_t version;
- httpBuildVersion(&version,0,0);
- httpStatusLineSet(sline, version , HTTP_STATUS_NONE, NULL);
+ httpBuildVersion(&version, 0, 0);
+ httpStatusLineSet(sline, version, HTTP_STATUS_NONE, NULL);
}
void
httpStatusLineClean(HttpStatusLine * sline)
{
http_version_t version;
- httpBuildVersion(&version,0,0);
+ httpBuildVersion(&version, 0, 0);
httpStatusLineSet(sline, version, HTTP_INTERNAL_SERVER_ERROR, NULL);
}
{
assert(sline && p);
debug(57, 9) ("packing sline %p using %p:\n", sline, p);
- debug(57, 9) (HttpStatusLineFormat, sline->version.major,
- sline->version.minor, sline->status,
+ debug(57, 9) (HttpStatusLineFormat, sline->version.major,
+ sline->version.minor, sline->status,
sline->reason ? sline->reason : httpStatusString(sline->status));
- packerPrintf(p, HttpStatusLineFormat, sline->version.major,
- sline->version.minor, sline->status, httpStatusLineReason(sline));
+ packerPrintf(p, HttpStatusLineFormat, sline->version.major,
+ sline->version.minor, sline->status, httpStatusLineReason(sline));
}
/* pack fields using Packer */
start += 5;
if (!xisdigit(*start))
return 0;
- if (sscanf(start, "%d.%d", &sline->version.major, &sline->version.minor)!=2){
- debug(57, 7) ("httpStatusLineParse: Invalid HTTP identifier.\n");
+ if (sscanf(start, "%d.%d", &sline->version.major, &sline->version.minor) != 2) {
+ debug(57, 7) ("httpStatusLineParse: Invalid HTTP identifier.\n");
}
if (!(start = strchr(start, ' ')))
return 0;
/*
- * $Id: cache_manager.cc,v 1.23 2000/11/13 12:25:11 adrian Exp $
+ * $Id: cache_manager.cc,v 1.24 2000/12/05 09:15:58 wessels Exp $
*
* DEBUG: section 16 Cache Manager Objects
* AUTHOR: Duane Wessels
if (a->flags.atomic)
storeBuffer(entry);
{
- http_version_t version;
+ http_version_t version;
HttpReply *rep = entry->mem_obj->reply;
/* prove there are no previous reply headers around */
assert(0 == rep->sline.status);
- httpBuildVersion(&version,1,0);
+ httpBuildVersion(&version, 1, 0);
httpReplySetHeaders(rep,
version,
HTTP_OK,
/*
- * $Id: client_side.cc,v 1.513 2000/11/15 02:32:53 wessels Exp $
+ * $Id: client_side.cc,v 1.514 2000/12/05 09:15:58 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
*/
http->entry = clientCreateStoreEntry(http, http->request->method, null_request_flags);
httpReplyReset(r = http->entry->mem_obj->reply);
- httpBuildVersion(&version,1,0);
+ httpBuildVersion(&version, 1, 0);
httpReplySetHeaders(r, version, status, NULL, NULL, 0, 0, -1);
httpReplySwapOut(r, http->entry);
storeComplete(http->entry);
size_t k = headersEnd(buf, size);
if (k && httpReplyParse(rep, buf, k)) {
/* enforce 1.0 reply version */
- httpBuildVersion(&rep->sline.version,1,0);
+ httpBuildVersion(&rep->sline.version, 1, 0);
/* do header conversions */
clientBuildReplyHeader(http, rep);
/* if we do ranges, change status to "Partial Content" */
storeReleaseRequest(http->entry);
storeBuffer(http->entry);
rep = httpReplyCreate();
- httpBuildVersion(&version,1,0);
+ httpBuildVersion(&version, 1, 0);
httpReplySetHeaders(rep, version, HTTP_OK, NULL, "text/plain",
httpRequestPrefixLen(r), 0, squid_curtime);
httpReplySwapOut(rep, http->entry);
if (token == NULL) {
debug(33, 3) ("parseHttpRequest: Missing HTTP identifier\n");
#if RELAXED_HTTP_PARSER
- httpBuildVersion(&http_ver,0,9); /* wild guess */
+ httpBuildVersion(&http_ver, 0, 9); /* wild guess */
#else
return parseHttpRequestAbort(conn, "error:missing-http-ident");
#endif
} else {
- if (sscanf(token+5, "%d.%d", &http_ver.major, &http_ver.minor)!=2){
- debug(33, 3) ("parseHttpRequest: Invalid HTTP identifier.\n");
- return parseHttpRequestAbort(conn, "error: invalid HTTP-ident");
- }
- debug(33, 6) ("parseHttpRequest: Client HTTP version %d.%d.\n",http_ver.major, http_ver.minor);
+ if (sscanf(token + 5, "%d.%d", &http_ver.major, &http_ver.minor) != 2) {
+ debug(33, 3) ("parseHttpRequest: Invalid HTTP identifier.\n");
+ return parseHttpRequestAbort(conn, "error: invalid HTTP-ident");
+ }
+ debug(33, 6) ("parseHttpRequest: Client HTTP version %d.%d.\n", http_ver.major, http_ver.minor);
}
/*
/*
- * $Id: errorpage.cc,v 1.156 2000/11/13 12:25:11 adrian Exp $
+ * $Id: errorpage.cc,v 1.157 2000/12/05 09:15:59 wessels Exp $
*
* DEBUG: section 4 Error Generation
* AUTHOR: Duane Wessels
MemBuf content = errorBuildContent(err);
http_version_t version;
/* no LMT for error pages; error pages expire immediately */
- httpBuildVersion(&version,1,0);
+ httpBuildVersion(&version, 1, 0);
httpReplySetHeaders(rep, version, err->http_status, NULL, "text/html", content.size, 0, squid_curtime);
/*
* include some information for downstream caches. Implicit
/*
- * $Id: gopher.cc,v 1.156 2000/11/04 23:04:10 hno Exp $
+ * $Id: gopher.cc,v 1.157 2000/12/05 09:15:59 wessels Exp $
*
* DEBUG: section 10 Gopher
* AUTHOR: Harvest Derived
if ((gtype == GOPHER_TELNET) || (gtype == GOPHER_3270)) {
if (strlen(escaped_selector) != 0)
snprintf(tmpbuf, TEMP_BUF_SIZE, "<IMG BORDER=0 SRC=\"%s\"> <A HREF=\"telnet://%s@%s%s%s/\">%s</A>\n",
- icon_url, escaped_selector, rfc1738_escape_part(host),
+ icon_url, escaped_selector, rfc1738_escape_part(host),
*port ? ":" : "", port, html_quote(name));
else
snprintf(tmpbuf, TEMP_BUF_SIZE, "<IMG BORDER=0 SRC=\"%s\"> <A HREF=\"telnet://%s%s%s/\">%s</A>\n",
/*
- * $Id: internal.cc,v 1.21 2000/11/15 13:22:27 adrian Exp $
+ * $Id: internal.cc,v 1.22 2000/12/05 09:15:59 wessels Exp $
*
* DEBUG: section 76 Internal Squid Object handling
* AUTHOR: Duane, Alex, Henrik
#else
const char *msgbuf = "This cache does not suport Cache Digests.\n";
#endif
- httpBuildVersion(&version,1,0);
+ httpBuildVersion(&version, 1, 0);
httpReplySetHeaders(entry->mem_obj->reply,
version,
HTTP_NOT_FOUND,
* domains
*/
if (Config.appendDomain && !strchr(lc_host, '.'))
- strncat(lc_host, Config.appendDomain, SQUIDHOSTNAMELEN -
- strlen(lc_host) - 1);
+ strncat(lc_host, Config.appendDomain, SQUIDHOSTNAMELEN -
+ strlen(lc_host) - 1);
/* build uri in mb */
memBufReset(&mb);
memBufPrintf(&mb, "http://%s", lc_host);
/*
- * $Id: main.cc,v 1.322 2000/11/10 09:04:51 adrian Exp $
+ * $Id: main.cc,v 1.323 2000/12/05 09:15:59 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
" -N No daemon mode.\n"
" -R Do not set REUSEADDR on port.\n"
" -S force Force double-check swap during rebuild.\n"
- " -S reportonly Force double-check but do not attempt repair.\n"
+ " -S reportonly Force double-check but do not attempt repair.\n"
" -V Virtual host httpd-accelerator.\n"
" -X Force full debugging.\n"
" -Y Only return UDP_HIT or UDP_MISS_NOFETCH during fast reload.\n",
opt_reuseaddr = 0;
break;
case 'S':
- if ((int) strlen(optarg) < 1)
- usage();
- else if (!strncmp(optarg, "force", strlen(optarg)))
- opt_store_doublecheck = DBLCHECK_FORCE; /* trigger a doublecheck on startup */
- else if (!strncmp(optarg, "reportonly", strlen(optarg)))
- opt_store_doublecheck = DBLCHECK_REPORTONLY; /* trigger a doublecheck that doesn't repair */
- else
- usage();
+ if ((int) strlen(optarg) < 1)
+ usage();
+ else if (!strncmp(optarg, "force", strlen(optarg)))
+ opt_store_doublecheck = DBLCHECK_FORCE; /* trigger a doublecheck on startup */
+ else if (!strncmp(optarg, "reportonly", strlen(optarg)))
+ opt_store_doublecheck = DBLCHECK_REPORTONLY; /* trigger a doublecheck that doesn't repair */
+ else
+ usage();
break;
case 'V':
vhost_mode = 1;
/*
- * $Id: mime.cc,v 1.95 2000/11/13 12:25:12 adrian Exp $
+ * $Id: mime.cc,v 1.96 2000/12/05 09:15:59 wessels Exp $
*
* DEBUG: section 25 MIME Parsing
* AUTHOR: Harvest Derived
storeBuffer(e);
e->mem_obj->request = requestLink(urlParse(METHOD_GET, url));
httpReplyReset(reply = e->mem_obj->reply);
- httpBuildVersion(&version,1,0);
+ httpBuildVersion(&version, 1, 0);
httpReplySetHeaders(reply, version, HTTP_OK, NULL,
type, (int) sb.st_size, sb.st_mtime, -1);
reply->cache_control = httpHdrCcCreate();
/*
- * $Id: protos.h,v 1.387 2000/11/13 12:25:12 adrian Exp $
+ * $Id: protos.h,v 1.388 2000/12/05 09:15:59 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern int httpAnonHdrAllowed(http_hdr_type hdr_id);
extern int httpAnonHdrDenied(http_hdr_type hdr_id);
extern void httpBuildRequestHeader(request_t *, request_t *, StoreEntry *, HttpHeader *, int, http_state_flags);
-extern void httpBuildVersion(http_version_t *version,unsigned int major,unsigned int minor);
+extern void httpBuildVersion(http_version_t * version, unsigned int major, unsigned int minor);
/* ETag */
extern int etagParseInit(ETag * etag, const char *str);
/*
- * $Id: store_rebuild.cc,v 1.72 2000/11/10 09:04:51 adrian Exp $
+ * $Id: store_rebuild.cc,v 1.73 2000/12/05 09:16:00 wessels Exp $
*
* DEBUG: section 20 Store Rebuild Routines
* AUTHOR: Duane Wessels
store_dirs_rebuilding--;
assert(0 == store_dirs_rebuilding);
if (opt_store_doublecheck != DBLCHECK_NONE)
- /* we want to assert here because the storeFScode should auto-clean the entries */
+ /* we want to assert here because the storeFScode should auto-clean the entries */
assert(store_errors == 0);
if (store_digest)
storeDigestNoteStoreReady();
if (e->swap_filen < 0)
continue;
if (opt_store_doublecheck != DBLCHECK_NONE)
- if (storeCleanupDoubleCheck(e)){
- /* this should never happen as the storeFScode should auto-clean */
+ if (storeCleanupDoubleCheck(e)) {
+ /* this should never happen as the storeFScode should auto-clean */
store_errors++;
- }
+ }
EBIT_SET(e->flags, ENTRY_VALIDATED);
/*
* Only set the file bit if we know its a valid entry
debug(20, 1) (" %7d Swapfile clashes avoided.\n", counts.clashcount);
debug(20, 1) (" %7d Missing files ignored.\n", counts.missingcount);
debug(20, 1) (" %7d Incorrect length swapfiles %s.\n",
- counts.filesizemismatchcount,
- (opt_store_doublecheck == DBLCHECK_REPORTONLY) ? "ignored" : "unlinked");
+ counts.filesizemismatchcount,
+ (opt_store_doublecheck == DBLCHECK_REPORTONLY) ? "ignored" : "unlinked");
debug(20, 1) (" Took %3.1f seconds (%6.1f objects/sec).\n", dt,
(double) counts.objcount / (dt > 0.0 ? dt : 1.0));
debug(20, 1) ("Beginning Validation Procedure\n");
/*
- * $Id: structs.h,v 1.362 2000/12/05 06:24:00 wessels Exp $
+ * $Id: structs.h,v 1.363 2000/12/05 09:16:00 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
method_t method;
int code;
const char *content_type;
- http_version_t version;
+ http_version_t version;
} http;
struct {
icp_opcode opcode;
int invalid; /* # bad lines */
int badflags; /* # bad e->flags */
int missingcount; /* # swapfiles not on disk */
- int filesizemismatchcount; /* # swapfiles with a wrong size */
+ int filesizemismatchcount; /* # swapfiles with a wrong size */
int bad_log_op;
int zero_object_sz;
};
/*
- * $Id: tools.cc,v 1.198 2000/11/15 12:53:50 adrian Exp $
+ * $Id: tools.cc,v 1.199 2000/12/05 09:16:01 wessels Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
inet_ntoa(Config.Sockaddr.http->s.sin_addr),
host);
present = 1;
- if( strchr( host, '.' ) )
- return host;
+ if (strchr(host, '.'))
+ return host;
}
- debug(50, 1) ("WARNING: failed to resolve %s to a fully qualified hostname\n",
+ debug(50, 1) ("WARNING: failed to resolve %s to a fully qualified hostname\n",
inet_ntoa(Config.Sockaddr.http->s.sin_addr));
}
/*
/* use the official name from DNS lookup */
xstrncpy(host, h->h_name, SQUIDHOSTNAMELEN);
present = 1;
- if( strchr( host, '.' ) )
- return host;
+ if (strchr(host, '.'))
+ return host;
}
fatal("Could not determine fully qualified hostname. Please set 'visible_hostname'\n");
return NULL; /* keep compiler happy */
/*
- * $Id: urn.cc,v 1.61 2000/11/13 12:25:13 adrian Exp $
+ * $Id: urn.cc,v 1.62 2000/12/05 09:16:02 wessels Exp $
*
* DEBUG: section 52 URN Parsing
* AUTHOR: Kostas Anagnostakis
full_appname_string, getMyHostname());
rep = e->mem_obj->reply;
httpReplyReset(rep);
- httpBuildVersion(&version,1,0);
+ httpBuildVersion(&version, 1, 0);
httpReplySetHeaders(rep, version, HTTP_MOVED_TEMPORARILY, NULL,
"text/html", mb.size, 0, squid_curtime);
if (urnState->flags.force_menu) {