1 Index: squid3/src/HttpHeader.h
2 diff -c squid3/src/HttpHeader.h:1.6 squid3/src/HttpHeader.h:1.7
3 *** squid3/src/HttpHeader.h:1.6 Tue Jul 15 00:50:39 2003
4 --- squid3/src/HttpHeader.h Sun Aug 31 21:49:37 2003
13 extern int httpHeaderParseQuotedString (const char *start, String *val);
14 extern void httpHeaderPutSc(HttpHeader *hdr, const HttpHdrSc *sc);
15 extern HttpHdrSc *httpHeaderGetSc(const HttpHeader *hdr);
16 SQUIDCEXTERN void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, ssize_t);
17 extern int httpHeaderHasListMember(const HttpHeader * hdr, http_hdr_type id, const char *member, const char separator);
18 SQUIDCEXTERN void httpHeaderUpdate(HttpHeader * old, const HttpHeader * fresh, const HttpHeaderMask * denied_mask);
19 + int httpMsgIsPersistent(HttpVersion const &http_ver, const HttpHeader * hdr);
23 Index: squid3/src/HttpMsg.cc
24 diff -c squid3/src/HttpMsg.cc:1.12 squid3/src/HttpMsg.cc:1.13
25 *** squid3/src/HttpMsg.cc:1.12 Fri Feb 21 15:50:05 2003
26 --- squid3/src/HttpMsg.cc Sun Aug 31 21:49:37 2003
34 /* find end of headers */
40 ! #include "HttpVersion.h"
42 /* find end of headers */
46 /* returns true if connection should be "persistent"
47 * after processing this message */
49 ! httpMsgIsPersistent(http_version_t http_ver, const HttpHeader * hdr)
51 if ((http_ver.major >= 1) && (http_ver.minor >= 1)) {
54 /* returns true if connection should be "persistent"
55 * after processing this message */
57 ! httpMsgIsPersistent(HttpVersion const &http_ver, const HttpHeader * hdr)
59 if ((http_ver.major >= 1) && (http_ver.minor >= 1)) {
61 Index: squid3/src/HttpReply.cc
62 diff -c squid3/src/HttpReply.cc:1.62 squid3/src/HttpReply.cc:1.63
63 *** squid3/src/HttpReply.cc:1.62 Tue Jul 15 00:50:39 2003
64 --- squid3/src/HttpReply.cc Sun Aug 31 21:49:37 2003
70 ! httpPackedReply(http_version_t ver, http_status status, const char *ctype,
71 int clen, time_t lmt, time_t expires)
73 HttpReply *rep = httpReplyCreate();
78 ! httpPackedReply(HttpVersion ver, http_status status, const char *ctype,
79 int clen, time_t lmt, time_t expires)
81 HttpReply *rep = httpReplyCreate();
90 rv = httpReplyCreate ();
94 /* rv->cache_control */
95 /* rv->content_range */
97 ! httpBuildVersion(&ver, 1, 0);
98 httpStatusLineSet(&rv->sline, ver,
99 HTTP_NOT_MODIFIED, "");
102 /* rv->cache_control */
103 /* rv->content_range */
105 ! HttpVersion ver(1,0);
106 httpStatusLineSet(&rv->sline, ver,
107 HTTP_NOT_MODIFIED, "");
114 ! httpReplySetHeaders(HttpReply * reply, http_version_t ver, http_status status, const char *reason,
115 const char *ctype, int clen, time_t lmt, time_t expires)
122 ! httpReplySetHeaders(HttpReply * reply, HttpVersion ver, http_status status, const char *reason,
123 const char *ctype, int clen, time_t lmt, time_t expires)
128 httpRedirectReply(HttpReply * reply, http_status status, const char *loc)
131 - http_version_t ver;
133 ! httpBuildVersion(&ver, 1, 0);
134 httpStatusLineSet(&reply->sline, ver, status, httpStatusString(status));
135 hdr = &reply->header;
136 httpHeaderPutStr(hdr, HDR_SERVER, full_appname_string);
138 httpRedirectReply(HttpReply * reply, http_status status, const char *loc)
142 ! HttpVersion ver(1,0);
143 httpStatusLineSet(&reply->sline, ver, status, httpStatusString(status));
144 hdr = &reply->header;
145 httpHeaderPutStr(hdr, HDR_SERVER, full_appname_string);
146 Index: squid3/src/HttpReply.h
147 diff -c squid3/src/HttpReply.h:1.5 squid3/src/HttpReply.h:1.6
148 *** squid3/src/HttpReply.h:1.5 Tue Jul 15 00:50:39 2003
149 --- squid3/src/HttpReply.h Sun Aug 31 21:49:37 2003
154 #include "typedefs.h"
155 #include "HttpHeader.h"
156 + #include "HttpStatusLine.h"
159 extern void httpReplyInitModule(void);
162 /* swap: create swap-based packer, pack, destroy packer */
163 extern void httpReplySwapOut(HttpReply * rep, StoreEntry * e);
164 /* set commonly used info with one call */
165 ! extern void httpReplySetHeaders(HttpReply * rep, http_version_t ver, http_status status,
166 const char *reason, const char *ctype, int clen, time_t lmt, time_t expires);
167 /* do everything in one call: init, set, pack, clean, return MemBuf */
168 ! extern MemBuf httpPackedReply(http_version_t ver, http_status status, const char *ctype,
169 int clen, time_t lmt, time_t expires);
170 /* construct 304 reply and pack it into MemBuf, return MemBuf */
171 extern MemBuf httpPacked304Reply(const HttpReply * rep);
173 /* swap: create swap-based packer, pack, destroy packer */
174 extern void httpReplySwapOut(HttpReply * rep, StoreEntry * e);
175 /* set commonly used info with one call */
176 ! extern void httpReplySetHeaders(HttpReply * rep, HttpVersion ver, http_status status,
177 const char *reason, const char *ctype, int clen, time_t lmt, time_t expires);
178 /* do everything in one call: init, set, pack, clean, return MemBuf */
179 ! extern MemBuf httpPackedReply(HttpVersion ver, http_status status, const char *ctype,
180 int clen, time_t lmt, time_t expires);
181 /* construct 304 reply and pack it into MemBuf, return MemBuf */
182 extern MemBuf httpPacked304Reply(const HttpReply * rep);
183 Index: squid3/src/HttpRequest.cc
184 diff -c squid3/src/HttpRequest.cc:1.44 squid3/src/HttpRequest.cc:1.45
185 *** squid3/src/HttpRequest.cc:1.44 Thu Aug 14 06:15:04 2003
186 --- squid3/src/HttpRequest.cc Sun Aug 31 21:49:37 2003
190 HttpHdrCc *cache_control;
192 ! http_version_t http_ver;
198 HttpHdrCc *cache_control;
200 ! HttpVersion http_ver;
204 Index: squid3/src/HttpRequest.h
205 diff -c squid3/src/HttpRequest.h:1.7 squid3/src/HttpRequest.h:1.8
206 *** squid3/src/HttpRequest.h:1.7 Sun Aug 10 05:00:40 2003
207 --- squid3/src/HttpRequest.h Sun Aug 31 21:49:37 2003
211 #include "typedefs.h"
212 #include "HttpHeader.h"
213 #include "client_side.h"
214 + #include "HttpVersion.h"
217 extern HttpRequest *requestCreate(method_t, protocol_t, const char *urlpath);
221 HttpHdrCc *cache_control;
223 ! http_version_t http_ver;
229 HttpHdrCc *cache_control;
231 ! HttpVersion http_ver;
235 Index: squid3/src/HttpStatusLine.cc
236 diff -c squid3/src/HttpStatusLine.cc:1.27 squid3/src/HttpStatusLine.cc:1.28
237 *** squid3/src/HttpStatusLine.cc:1.27 Fri Feb 21 15:50:05 2003
238 --- squid3/src/HttpStatusLine.cc Sun Aug 31 21:49:37 2003
246 /* local constants */
247 const char *HttpStatusLineFormat = "HTTP/%d.%d %3d %s\r\n";
252 ! #include "HttpStatusLine.h"
254 /* local constants */
255 const char *HttpStatusLineFormat = "HTTP/%d.%d %3d %s\r\n";
259 httpStatusLineInit(HttpStatusLine * sline)
261 ! http_version_t version;
262 ! httpBuildVersion(&version, 0, 0);
263 httpStatusLineSet(sline, version, HTTP_STATUS_NONE, NULL);
267 httpStatusLineClean(HttpStatusLine * sline)
269 ! http_version_t version;
270 ! httpBuildVersion(&version, 0, 0);
271 httpStatusLineSet(sline, version, HTTP_INTERNAL_SERVER_ERROR, NULL);
276 ! httpStatusLineSet(HttpStatusLine * sline, http_version_t version, http_status status, const char *reason)
279 sline->version = version;
282 httpStatusLineInit(HttpStatusLine * sline)
284 ! HttpVersion version;
285 httpStatusLineSet(sline, version, HTTP_STATUS_NONE, NULL);
289 httpStatusLineClean(HttpStatusLine * sline)
291 ! HttpVersion version;
292 httpStatusLineSet(sline, version, HTTP_INTERNAL_SERVER_ERROR, NULL);
297 ! httpStatusLineSet(HttpStatusLine * sline, HttpVersion version, http_status status, const char *reason)
300 sline->version = version;
301 Index: squid3/src/access_log.cc
302 diff -c squid3/src/access_log.cc:1.94 squid3/src/access_log.cc:1.95
303 *** squid3/src/access_log.cc:1.94 Wed Aug 20 07:34:41 2003
304 --- squid3/src/access_log.cc Sun Aug 31 21:49:37 2003
311 + #include "AccessLogEntry.h"
313 // Store.h Required by configuration directives parsing/dumping only
315 Index: squid3/src/cache_cf.cc
316 diff -c squid3/src/cache_cf.cc:1.449 squid3/src/cache_cf.cc:1.450
317 *** squid3/src/cache_cf.cc:1.449 Sun Aug 31 15:20:08 2003
318 --- squid3/src/cache_cf.cc Sun Aug 31 21:49:37 2003
325 + #include "AccessLogEntry.h"
326 + /* TODO: split out parsing somehow ...*/
328 parse_logformat(logformat ** logformat_definitions)
330 Index: squid3/src/Makefile.am
331 diff -c squid3/src/Makefile.am:1.89 squid3/src/Makefile.am:1.90
332 *** squid3/src/Makefile.am:1.89 Thu Aug 14 17:21:51 2003
333 --- squid3/src/Makefile.am Sun Aug 31 21:49:37 2003
364 Index: squid3/src/cache_manager.cc
365 diff -c squid3/src/cache_manager.cc:1.30 squid3/src/cache_manager.cc:1.31
366 *** squid3/src/cache_manager.cc:1.30 Sun Aug 10 05:00:42 2003
367 --- squid3/src/cache_manager.cc Sun Aug 31 21:49:38 2003
373 ! http_version_t version;
374 HttpReply *rep = httpReplyCreate();
375 - httpBuildVersion(&version, 1, 0);
376 httpReplySetHeaders(rep,
383 ! HttpVersion version(1,0);
384 HttpReply *rep = httpReplyCreate();
385 httpReplySetHeaders(rep,
388 Index: squid3/src/client_side.cc
389 diff -c squid3/src/client_side.cc:1.657 squid3/src/client_side.cc:1.658
390 *** squid3/src/client_side.cc:1.657 Thu Aug 14 06:15:04 2003
391 --- squid3/src/client_side.cc Sun Aug 31 21:49:38 2003
395 static void trimTrailingSpaces(char *aString, size_t len);
397 ! static ClientSocketContext *parseURIandHTTPVersion(char **url_p, http_version_t * http_ver_p, ConnStateData::Pointer& conn, char *http_version_str);
398 static void setLogUri(clientHttpRequest * http, char const *uri);
399 static int connReadWasError(ConnStateData::Pointer& conn, comm_err_t, int size, int xerrno);
400 static int connFinishedWithConn(ConnStateData::Pointer& conn, int size);
403 static void trimTrailingSpaces(char *aString, size_t len);
405 ! static ClientSocketContext *parseURIandHTTPVersion(char **url_p, HttpVersion * http_ver_p, ConnStateData::Pointer& conn, char *http_version_str);
406 static void setLogUri(clientHttpRequest * http, char const *uri);
407 static int connReadWasError(ConnStateData::Pointer& conn, comm_err_t, int size, int xerrno);
408 static int connFinishedWithConn(ConnStateData::Pointer& conn, int size);
411 if (!Config.onoff.client_pconns)
412 request->flags.proxy_keepalive = 0;
414 ! http_version_t http_ver;
415 ! httpBuildVersion(&http_ver, 1, 0);
416 /* we are HTTP/1.0, no matter what the client requests... */
418 if (httpMsgIsPersistent(http_ver, req_hdr))
420 if (!Config.onoff.client_pconns)
421 request->flags.proxy_keepalive = 0;
423 ! HttpVersion http_ver(1,0);
424 /* we are HTTP/1.0, no matter what the client requests... */
426 if (httpMsgIsPersistent(http_ver, req_hdr))
431 static ClientSocketContext *
432 ! parseURIandHTTPVersion(char **url_p, http_version_t * http_ver_p,
433 ConnStateData::Pointer & conn, char *http_version_str)
439 static ClientSocketContext *
440 ! parseURIandHTTPVersion(char **url_p, HttpVersion * http_ver_p,
441 ConnStateData::Pointer & conn, char *http_version_str)
446 debug(33, 6) ("parseHttpRequest: Client HTTP version %d.%d.\n",
447 http_ver_p->major, http_ver_p->minor);
449 ! httpBuildVersion(http_ver_p, 0, 9); /* wild guess */
454 debug(33, 6) ("parseHttpRequest: Client HTTP version %d.%d.\n",
455 http_ver_p->major, http_ver_p->minor);
457 ! *http_ver_p = HttpVersion(0,9); /* wild guess */
463 /* Utility function to perform part of request parsing */
464 static ClientSocketContext *
465 clientParseHttpRequestLine(char *reqline, ConnStateData::Pointer &conn,
466 ! method_t * method_p, char **url_p, http_version_t * http_ver_p, char * http_version_str)
468 ClientSocketContext *result = NULL;
469 /* XXX: This sequence relies on strtok() */
471 /* Utility function to perform part of request parsing */
472 static ClientSocketContext *
473 clientParseHttpRequestLine(char *reqline, ConnStateData::Pointer &conn,
474 ! method_t * method_p, char **url_p, HttpVersion * http_ver_p, char * http_version_str)
476 ClientSocketContext *result = NULL;
477 /* XXX: This sequence relies on strtok() */
481 char *req_hdr = NULL;
483 ! http_version_t http_ver;
485 size_t header_sz; /* size of headers, not including first line */
486 size_t prefix_sz; /* size of whole request (req-line + headers) */
489 char *req_hdr = NULL;
491 ! HttpVersion http_ver;
493 size_t header_sz; /* size of headers, not including first line */
494 size_t prefix_sz; /* size of whole request (req-line + headers) */
495 Index: squid3/src/client_side_reply.cc
496 diff -c squid3/src/client_side_reply.cc:1.66 squid3/src/client_side_reply.cc:1.67
497 *** squid3/src/client_side_reply.cc:1.66 Tue Aug 19 16:30:36 2003
498 --- squid3/src/client_side_reply.cc Sun Aug 31 21:49:38 2003
504 - http_version_t version;
506 /* And for Vary, release the base URI if none of the headers was included in the request */
512 r = httpReplyCreate();
514 ! httpBuildVersion(&version, 1, 0);
516 httpReplySetHeaders(r, version, purgeStatus, NULL, NULL, 0, 0, -1);
520 r = httpReplyCreate();
522 ! HttpVersion version(1,0);
524 httpReplySetHeaders(r, version, purgeStatus, NULL, NULL, 0, 0, -1);
528 clientReplyContext::traceReply(clientStreamNode * node)
531 - http_version_t version;
532 clientStreamNode *next = (clientStreamNode *)node->node.next->data;
533 StoreIOBuffer tempBuffer;
534 assert(http->request->max_forwards == 0);
538 storeReleaseRequest(http->storeEntry());
539 storeBuffer(http->storeEntry());
540 rep = httpReplyCreate();
541 ! httpBuildVersion(&version, 1, 0);
542 httpReplySetHeaders(rep, version, HTTP_OK, NULL, "text/plain",
543 httpRequestPrefixLen(http->request), 0, squid_curtime);
544 httpReplySwapOut(rep, http->storeEntry());
546 storeReleaseRequest(http->storeEntry());
547 storeBuffer(http->storeEntry());
548 rep = httpReplyCreate();
549 ! HttpVersion version(1,0);
550 httpReplySetHeaders(rep, version, HTTP_OK, NULL, "text/plain",
551 httpRequestPrefixLen(http->request), 0, squid_curtime);
552 httpReplySwapOut(rep, http->storeEntry());
557 /* enforce 1.0 reply version */
558 ! httpBuildVersion(&holdingReply->sline.version, 1, 0);
560 /* do header conversions */
565 /* enforce 1.0 reply version */
566 ! holdingReply->sline.version = HttpVersion(1,0);
568 /* do header conversions */
570 Index: squid3/src/client_side_request.cc
571 diff -c squid3/src/client_side_request.cc:1.32 squid3/src/client_side_request.cc:1.33
572 *** squid3/src/client_side_request.cc:1.32 Tue Aug 12 18:17:26 2003
573 --- squid3/src/client_side_request.cc Sun Aug 31 21:49:38 2003
576 char *tailbuf, size_t taillen)
579 ! http_version_t http_ver =
581 clientHttpRequest *http = new ClientHttpRequest;
582 HttpRequest *request;
583 StoreIOBuffer tempBuffer;
585 char *tailbuf, size_t taillen)
588 ! HttpVersion http_ver (1, 0);
589 clientHttpRequest *http = new ClientHttpRequest;
590 HttpRequest *request;
591 StoreIOBuffer tempBuffer;
592 Index: squid3/src/client_side_request.h
593 diff -c squid3/src/client_side_request.h:1.18 squid3/src/client_side_request.h:1.19
594 *** squid3/src/client_side_request.h:1.18 Tue Aug 12 18:17:26 2003
595 --- squid3/src/client_side_request.h Sun Aug 31 21:49:38 2003
599 #include "HttpHeader.h"
600 #include "clientStream.h"
601 #include "client_side.h"
602 + #include "AccessLogEntry.h"
604 /* client_side_request.c - client side request related routines (pure logic) */
605 extern int clientBeginRequest(method_t, char const *, CSCB *, CSD *, ClientStreamData, HttpHeader const *, char *, size_t);
610 struct timeval start;
611 ! http_version_t http_ver;
618 struct timeval start;
619 ! HttpVersion http_ver;
623 Index: squid3/src/errorpage.cc
624 diff -c squid3/src/errorpage.cc:1.190 squid3/src/errorpage.cc:1.191
625 *** squid3/src/errorpage.cc:1.190 Sun Aug 10 05:00:42 2003
626 --- squid3/src/errorpage.cc Sun Aug 31 21:49:38 2003
630 HttpReply *rep = httpReplyCreate();
631 const char *name = errorPageName(err->page_id);
632 - http_version_t version;
633 /* no LMT for error pages; error pages expire immediately */
634 ! httpBuildVersion(&version, 1, 0);
636 if (strchr(name, ':')) {
640 HttpReply *rep = httpReplyCreate();
641 const char *name = errorPageName(err->page_id);
642 /* no LMT for error pages; error pages expire immediately */
643 ! HttpVersion version(1, 0);
645 if (strchr(name, ':')) {
647 Index: squid3/src/ftp.cc
648 diff -c squid3/src/ftp.cc:1.353 squid3/src/ftp.cc:1.354
649 *** squid3/src/ftp.cc:1.353 Sun Aug 10 05:00:43 2003
650 --- squid3/src/ftp.cc Sun Aug 31 21:49:38 2003
653 const char *t = NULL;
654 StoreEntry *e = ftpState->entry;
655 HttpReply *reply = httpReplyCreate ();
656 - http_version_t version;
658 if (ftpState->flags.http_header_sent)
663 HttpHdrRangeSpec range_spec;
664 range_spec.offset = ftpState->restarted_offset;
665 range_spec.length = ftpState->size - ftpState->restarted_offset;
666 ! httpBuildVersion(&version, 1, 0);
667 httpReplySetHeaders(reply, version, HTTP_PARTIAL_CONTENT, "Gatewaying",
668 mime_type, ftpState->size - ftpState->restarted_offset, ftpState->mdtm, -2);
669 httpHeaderAddContRange(&reply->header, range_spec, ftpState->size);
672 ! httpBuildVersion(&version, 1, 0);
673 httpReplySetHeaders(reply, version, HTTP_OK, "Gatewaying",
674 mime_type, ftpState->size, ftpState->mdtm, -2);
677 HttpHdrRangeSpec range_spec;
678 range_spec.offset = ftpState->restarted_offset;
679 range_spec.length = ftpState->size - ftpState->restarted_offset;
680 ! HttpVersion version(1, 0);
681 httpReplySetHeaders(reply, version, HTTP_PARTIAL_CONTENT, "Gatewaying",
682 mime_type, ftpState->size - ftpState->restarted_offset, ftpState->mdtm, -2);
683 httpHeaderAddContRange(&reply->header, range_spec, ftpState->size);
686 ! HttpVersion version(1, 0);
687 httpReplySetHeaders(reply, version, HTTP_OK, "Gatewaying",
688 mime_type, ftpState->size, ftpState->mdtm, -2);
690 Index: squid3/src/http.cc
691 diff -c squid3/src/http.cc:1.426 squid3/src/http.cc:1.427
692 *** squid3/src/http.cc:1.426 Sun Aug 10 05:00:43 2003
693 --- squid3/src/http.cc Sun Aug 31 21:49:38 2003
696 http_state_flags flags)
698 const int offset = mb->size;
699 ! http_version_t httpver;
700 ! httpBuildVersion(&httpver, 1, 0);
701 memBufPrintf(mb, "%s %s HTTP/%d.%d\r\n",
702 RequestMethodStr[request->method],
703 request->urlpath.size() ? request->urlpath.buf() : "/",
705 http_state_flags flags)
707 const int offset = mb->size;
708 ! HttpVersion httpver(1, 0);
709 memBufPrintf(mb, "%s %s HTTP/%d.%d\r\n",
710 RequestMethodStr[request->method],
711 request->urlpath.size() ? request->urlpath.buf() : "/",
717 ! httpBuildVersion(http_version_t * version, unsigned int major, unsigned int minor)
719 version->major = major;
720 version->minor = minor;
725 ! httpBuildVersion(HttpVersion * version, unsigned int major, unsigned int minor)
727 version->major = major;
728 version->minor = minor;
729 Index: squid3/src/icp_v2.cc
730 diff -c squid3/src/icp_v2.cc:1.82 squid3/src/icp_v2.cc:1.83
731 *** squid3/src/icp_v2.cc:1.82 Sun Aug 10 05:00:43 2003
732 --- squid3/src/icp_v2.cc Sun Aug 31 21:49:39 2003
736 #include "HttpRequest.h"
737 #include "ACLChecklist.h"
739 + #include "AccessLogEntry.h"
741 static void icpLogIcp(struct in_addr, log_type, int, const char *, int);
746 if (!Config.onoff.log_udp)
749 - memset(&al, '\0', sizeof(al));
751 al.icp.opcode = ICP_QUERY;
754 Index: squid3/src/internal.cc
755 diff -c squid3/src/internal.cc:1.29 squid3/src/internal.cc:1.30
756 *** squid3/src/internal.cc:1.29 Sun Aug 10 05:00:43 2003
757 --- squid3/src/internal.cc Sun Aug 31 21:49:39 2003
762 const char *upath = request->urlpath.buf();
763 - http_version_t version;
764 debug(76, 3) ("internalStart: %s requesting '%s'\n",
765 inet_ntoa(request->client_addr), upath);
770 const char *msgbuf = "This cache does not suport Cache Digests.\n";
773 ! httpBuildVersion(&version, 1, 0);
774 HttpReply *reply = httpReplyCreate ();
775 httpReplySetHeaders(reply,
778 const char *msgbuf = "This cache does not suport Cache Digests.\n";
781 ! HttpVersion version(1, 0);
782 HttpReply *reply = httpReplyCreate ();
783 httpReplySetHeaders(reply,
785 Index: squid3/src/main.cc
786 diff -c squid3/src/main.cc:1.387 squid3/src/main.cc:1.388
787 *** squid3/src/main.cc:1.387 Sat Aug 30 19:22:05 2003
788 --- squid3/src/main.cc Sun Aug 31 21:49:39 2003
795 + #include "AccessLogEntry.h"
796 #include "authenticate.h"
799 Index: squid3/src/mime.cc
800 diff -c squid3/src/mime.cc:1.113 squid3/src/mime.cc:1.114
801 *** squid3/src/mime.cc:1.113 Sun Aug 10 05:00:43 2003
802 --- squid3/src/mime.cc Sun Aug 31 21:49:39 2003
808 - http_version_t version;
811 snprintf(path, MAXPATHLEN, "%s/%s", Config.icons.directory, icon);
813 fd = file_open(path, O_RDONLY | O_BINARY);
818 HttpReply *reply = httpReplyCreate();
820 ! httpBuildVersion(&version, 1, 0);
822 httpReplySetHeaders(reply, version, HTTP_OK, NULL,
823 mimeGetContentType(icon), (int) sb.st_size, sb.st_mtime, -1);
826 HttpReply *reply = httpReplyCreate();
828 ! HttpVersion version(1, 0);
830 httpReplySetHeaders(reply, version, HTTP_OK, NULL,
831 mimeGetContentType(icon), (int) sb.st_size, sb.st_mtime, -1);
832 Index: squid3/src/net_db.cc
833 diff -c squid3/src/net_db.cc:1.172 squid3/src/net_db.cc:1.173
834 *** squid3/src/net_db.cc:1.172 Sun Aug 10 05:00:44 2003
835 --- squid3/src/net_db.cc Sun Aug 31 21:49:39 2003
838 netdbBinaryExchange(StoreEntry * s)
840 HttpReply *reply = httpReplyCreate();
841 - http_version_t version;
851 ! httpBuildVersion(&version, 1, 0);
852 httpReplySetHeaders(reply, version, HTTP_OK, "OK",
853 NULL, -1, squid_curtime, -2);
854 httpReplySwapOut(reply, s);
859 ! HttpVersion version(1, 0);
860 httpReplySetHeaders(reply, version, HTTP_OK, "OK",
861 NULL, -1, squid_curtime, -2);
862 httpReplySwapOut(reply, s);
865 memFree(buf, MEM_4K_BUF);
868 ! httpBuildVersion(&version, 1, 0);
869 httpReplySetHeaders(reply, version, HTTP_BAD_REQUEST, "Bad Request",
870 NULL, -1, squid_curtime, -2);
871 httpReplySwapOut(reply, s);
873 memFree(buf, MEM_4K_BUF);
876 ! HttpVersion version(1,0);
877 httpReplySetHeaders(reply, version, HTTP_BAD_REQUEST, "Bad Request",
878 NULL, -1, squid_curtime, -2);
879 httpReplySwapOut(reply, s);
884 assert(NULL != ex->r);
885 ! httpBuildVersion(&ex->r->http_ver, 1, 0);
886 ex->connstate = STATE_HEADER;
887 ex->e = storeCreateEntry(uri, uri, request_flags(), METHOD_GET);
888 ex->buf_sz = NETDB_REQBUF_SZ;
892 assert(NULL != ex->r);
893 ! ex->r->http_ver = HttpVersion(1,0);
894 ex->connstate = STATE_HEADER;
895 ex->e = storeCreateEntry(uri, uri, request_flags(), METHOD_GET);
896 ex->buf_sz = NETDB_REQBUF_SZ;
897 Index: squid3/src/protos.h
898 diff -c squid3/src/protos.h:1.491 squid3/src/protos.h:1.492
899 *** squid3/src/protos.h:1.491 Sun Aug 17 07:42:04 2003
900 --- squid3/src/protos.h Sun Aug 31 21:49:39 2003
903 #ifndef SQUID_PROTOS_H
904 #define SQUID_PROTOS_H
906 - SQUIDCEXTERN void accessLogLog(AccessLogEntry *, ACLChecklist * checklist);
907 - SQUIDCEXTERN void accessLogRotate(void);
908 - SQUIDCEXTERN void accessLogClose(void);
909 - SQUIDCEXTERN void accessLogInit(void);
910 - SQUIDCEXTERN void accessLogFreeMemory(AccessLogEntry * aLogEntry);
911 - SQUIDCEXTERN const char *accessLogTime(time_t);
912 - SQUIDCEXTERN int accessLogParseLogFormat(logformat_token ** fmt, char *def);
913 - SQUIDCEXTERN void accessLogDumpLogFormat(StoreEntry * entry, const char *name, logformat * definitions);
914 - SQUIDCEXTERN void accessLogFreeLogFormat(logformat_token ** fmt);
915 SQUIDCEXTERN void hierarchyNote(HierarchyLogEntry *, hier_code, const char *);
917 SQUIDCEXTERN void fvdbCountVia(const char *key);
921 SQUIDCEXTERN int httpAnonHdrAllowed(http_hdr_type hdr_id);
922 SQUIDCEXTERN int httpAnonHdrDenied(http_hdr_type hdr_id);
923 SQUIDCEXTERN void httpBuildRequestHeader(HttpRequest *, HttpRequest *, StoreEntry *, HttpHeader *, http_state_flags);
924 - SQUIDCEXTERN void httpBuildVersion(http_version_t * version, unsigned int major, unsigned int minor);
925 SQUIDCEXTERN const char *httpMakeVaryMark(HttpRequest * request, HttpReply const * reply);
928 SQUIDCEXTERN int etagParseInit(ETag * etag, const char *str);
929 SQUIDCEXTERN int etagIsEqual(const ETag * tag1, const ETag * tag2);
931 - /* Http Status Line */
933 - SQUIDCEXTERN void httpStatusLineInit(HttpStatusLine * sline);
934 - SQUIDCEXTERN void httpStatusLineClean(HttpStatusLine * sline);
935 - /* set/get values */
936 - SQUIDCEXTERN void httpStatusLineSet(HttpStatusLine * sline, http_version_t version,
937 - http_status status, const char *reason);
938 - SQUIDCEXTERN const char *httpStatusLineReason(const HttpStatusLine * sline);
940 - /* parse a 0-terminating buffer and fill internal structires; returns true on success */
941 - SQUIDCEXTERN int httpStatusLineParse(HttpStatusLine * sline, const char *start,
943 - /* pack fields using Packer */
944 - SQUIDCEXTERN void httpStatusLinePackInto(const HttpStatusLine * sline, Packer * p);
945 SQUIDCEXTERN const char *httpStatusString(http_status status);
951 SQUIDCEXTERN void httpHdrMangleList(HttpHeader *, HttpRequest *);
953 /* Http Msg (currently in HttpReply.c @?@ ) */
954 - SQUIDCEXTERN int httpMsgIsPersistent(http_version_t http_ver, const HttpHeader * hdr);
955 SQUIDCEXTERN int httpMsgIsolateHeaders(const char **parse_start, const char **blk_start, const char **blk_end);
957 SQUIDCEXTERN void icmpOpen(void);
959 Index: squid3/src/store.cc
960 diff -c squid3/src/store.cc:1.573 squid3/src/store.cc:1.574
961 *** squid3/src/store.cc:1.573 Sun Aug 10 05:00:44 2003
962 --- squid3/src/store.cc Sun Aug 31 21:49:39 2003
966 if (mem->vary_headers && !storeGetPublic(mem->url, mem->method)) {
967 /* Create "vary" base object */
968 - http_version_t version;
970 pe = storeCreateEntry(mem->url, mem->log_url, request->flags, request->method);
971 ! httpBuildVersion(&version, 1, 0);
972 /* We are allowed to do this typecast */
973 httpReplySetHeaders((HttpReply *)pe->getReply(), version, HTTP_OK, "Internal marker object", "x-squid-internal/vary", -1, -1, squid_curtime + 100000);
974 vary = httpHeaderGetList(&mem->getReply()->header, HDR_VARY);
977 if (mem->vary_headers && !storeGetPublic(mem->url, mem->method)) {
978 /* Create "vary" base object */
980 pe = storeCreateEntry(mem->url, mem->log_url, request->flags, request->method);
981 ! HttpVersion version(1, 0);
982 /* We are allowed to do this typecast */
983 httpReplySetHeaders((HttpReply *)pe->getReply(), version, HTTP_OK, "Internal marker object", "x-squid-internal/vary", -1, -1, squid_curtime + 100000);
984 vary = httpHeaderGetList(&mem->getReply()->header, HDR_VARY);
985 Index: squid3/src/store_digest.cc
986 diff -c squid3/src/store_digest.cc:1.56 squid3/src/store_digest.cc:1.57
987 *** squid3/src/store_digest.cc:1.56 Fri Feb 21 15:50:12 2003
988 --- squid3/src/store_digest.cc Sun Aug 31 21:49:40 2003
991 storeDigestRewriteResume(void)
994 - http_version_t version;
996 assert(sd_state.rewrite_lock);
997 assert(!sd_state.rebuild_lock);
1001 storeSetPublicKey(e);
1003 HttpReply *rep = httpReplyCreate ();
1004 ! httpBuildVersion(&version, 1, 0);
1005 httpReplySetHeaders(rep, version, HTTP_OK, "Cache Digest OK",
1006 "application/cache-digest", store_digest->mask_size + sizeof(sd_state.cblock),
1007 squid_curtime, squid_curtime + Config.digest.rewrite_period);
1009 storeSetPublicKey(e);
1011 HttpReply *rep = httpReplyCreate ();
1012 ! HttpVersion version(1, 0);
1013 httpReplySetHeaders(rep, version, HTTP_OK, "Cache Digest OK",
1014 "application/cache-digest", store_digest->mask_size + sizeof(sd_state.cblock),
1015 squid_curtime, squid_curtime + Config.digest.rewrite_period);
1016 Index: squid3/src/structs.h
1017 diff -c squid3/src/structs.h:1.480 squid3/src/structs.h:1.481
1018 *** squid3/src/structs.h:1.480 Mon Aug 18 06:24:45 2003
1019 --- squid3/src/structs.h Sun Aug 31 21:49:40 2003
1025 - struct _http_version_t
1027 - unsigned int major;
1028 - unsigned int minor;
1036 void *real_handler; /* first parameter to real append and vprintf */
1039 - /* http status line */
1041 - struct _HttpStatusLine
1043 - /* public, read only */
1044 - http_version_t version;
1045 - const char *reason; /* points to a _constant_ string (default or supplied), never free()d */
1046 - http_status status;
1050 * Note: HttpBody is used only for messages with a small content that is
1054 struct timeval store_complete_stop;
1057 - struct _AccessLogEntry
1059 - /* NB: memset is used on AccessLogEntries as at 20030715 RBC */
1066 - const char *content_type;
1067 - http_version_t version;
1074 - icp_opcode opcode;
1082 - struct in_addr caddr;
1085 - size_t objectSize;
1088 - const char *rfc931;
1089 - const char *authuser;
1092 - const char *ssluser;
1095 - const char *extuser;
1111 - const char *method_str;
1115 - HierarchyLogEntry hier;
1117 - HttpRequest *request;
1120 struct _ipcache_addrs
1123 Index: squid3/src/typedefs.h
1124 diff -c squid3/src/typedefs.h:1.169 squid3/src/typedefs.h:1.170
1125 *** squid3/src/typedefs.h:1.169 Sun Aug 10 03:53:49 2003
1126 --- squid3/src/typedefs.h Sun Aug 31 21:49:40 2003
1130 typedef struct _fileMap fileMap;
1132 - typedef struct _HttpStatusLine HttpStatusLine;
1134 typedef struct _HttpHeaderFieldAttrs HttpHeaderFieldAttrs;
1136 class HttpHeaderFieldInfo;
1143 - typedef struct _AccessLogEntry AccessLogEntry;
1145 typedef struct _cachemgr_passwd cachemgr_passwd;
1147 typedef struct _refresh_t refresh_t;
1151 typedef struct _RemovalPolicyNode RemovalPolicyNode;
1153 typedef struct _RemovalPolicySettings RemovalPolicySettings;
1155 - typedef struct _http_version_t http_version_t;
1158 typedef variable_list *(oid_ParseFn) (variable_list *, snint *);
1160 Index: squid3/src/urn.cc
1161 diff -c squid3/src/urn.cc:1.85 squid3/src/urn.cc:1.86
1162 *** squid3/src/urn.cc:1.85 Sun Aug 10 05:00:45 2003
1163 --- squid3/src/urn.cc Sun Aug 31 21:49:40 2003
1169 - http_version_t version;
1170 char *buf = urnState->reqbuf;
1171 StoreIOBuffer tempBuffer;
1173 debug(52, 3) ("urnHandleReply: Called with size=%u.\n", (unsigned int)result.length);
1175 if (EBIT_TEST(urlres_e->flags, ENTRY_ABORTED)) {
1182 char *buf = urnState->reqbuf;
1183 StoreIOBuffer tempBuffer;
1185 debug(52, 3) ("urnHandleReply: Called with size=%u.\n", (unsigned int)result.length);
1187 + /* Can't be lower because of the goto's */
1188 + HttpVersion version(1, 0);
1190 if (EBIT_TEST(urlres_e->flags, ENTRY_ABORTED)) {
1196 full_appname_string, getMyHostname());
1197 rep = httpReplyCreate();
1198 - httpBuildVersion(&version, 1, 0);
1199 httpReplySetHeaders(rep, version, HTTP_MOVED_TEMPORARILY, NULL,
1200 "text/html", mb.size, 0, squid_curtime);
1203 Index: squid3/src/whois.cc
1204 diff -c squid3/src/whois.cc:1.27 squid3/src/whois.cc:1.28
1205 *** squid3/src/whois.cc:1.27 Sun Aug 10 05:00:45 2003
1206 --- squid3/src/whois.cc Sun Aug 31 21:49:40 2003
1209 WhoisState::setReplyToOK(StoreEntry *entry)
1211 HttpReply *reply = httpReplyCreate();
1212 ! http_version_t version;
1213 ! httpBuildVersion(&version, 1, 0);
1214 httpReplySetHeaders(reply, version, HTTP_OK, NULL, NULL, 0, 0, -1);
1215 storeEntryReplaceObject (entry, reply);
1218 WhoisState::setReplyToOK(StoreEntry *entry)
1220 HttpReply *reply = httpReplyCreate();
1221 ! HttpVersion version(1, 0);
1222 httpReplySetHeaders(reply, version, HTTP_OK, NULL, NULL, 0, 0, -1);
1223 storeEntryReplaceObject (entry, reply);