Re: NTLM patch

From: Andy Doran <ad@dont-contact.us>
Date: Mon, 17 Jan 2000 18:03:21 +0000 (GMT)

Ok, here are the diffs I promised. Sorry for the delay. The first is a
patch you sent me; the second is a really quite disgusting hack written in
desparation. It makes POSTing work most of the time and henceforth
silences screaming users.

Index: squid/src/errorpage.c
diff -u squid/src/errorpage.c:1.1.1.27.2.1 squid/src/errorpage.c:1.1.1.27.2.2
--- squid/src/errorpage.c:1.1.1.27.2.1 Sat Aug 7 18:11:33 1999
+++ squid/src/errorpage.c Fri Oct 1 22:22:45 1999
@@ -295,9 +295,7 @@
         break;
     }
     httpReplySwapOut(rep, entry);
- httpReplyDestroy(rep);
- mem->reply->sline.status = err->http_status;
- mem->reply->content_length = -1;
+ httpReplyAbsorb(mem->reply, rep);
     EBIT_CLR(entry->flags, ENTRY_FWD_HDR_WAIT);
     storeBufferFlush(entry);
     storeComplete(entry);

--- client_side.c.orig Thu Sep 23 00:06:53 1999
+++ client_side.c Tue Dec 21 16:52:34 1999
@@ -1921,6 +1930,7 @@
 parseHttpRequest(ConnStateData * conn, method_t * method_p, int *status,
     char **prefix_p, size_t * req_line_sz_p)
 {
+ char *mlist[] = { "GET", "POST", "PUT", "HEAD", "CONNECT", "TRACE", "PURGE", NULL };
     char *inbuf = NULL;
     char *mstr = NULL;
     char *url = NULL;
@@ -1940,6 +1950,8 @@
     struct natlookup natLookup;
     static int natfd = -1;
 #endif
+ int lastcr, i, getout, ncr;
+ char *pinbuf;
 
     if ((req_sz = headersEnd(conn->in.buf, conn->in.offset)) == 0) {
         debug(33, 5) ("Incomplete request, waiting for end of headers\n");
@@ -1964,6 +1976,30 @@
         debug(33, 1) ("parseHttpRequest: Requestheader contains NULL characters\n");
         return parseHttpRequestAbort(conn, "error:invalid-request");
     }
+
+ pinbuf = inbuf;
+
+ for (lastcr = 1, getout = 0, ncr = 0; *inbuf != '\0'; inbuf++) {
+ if (lastcr) {
+ for (i = 0; mlist[i]; i++) {
+ if (strncmp(inbuf, mlist[i], strlen(mlist[i])) == 0) {
+ getout = 1;
+ break;
+ }
+ }
+ }
+ if (getout)
+ break;
+
+ if ((lastcr = (*inbuf == '\n')) != 0) {
+ if (ncr++ == 1)
+ break;
+ }
+ }
+
+ if (getout == 0)
+ inbuf = pinbuf;
+
     /* Look for request method */
     if ((mstr = strtok(inbuf, "\t ")) == NULL) {
         debug(33, 1) ("parseHttpRequest: Can't get request method\n");
Received on Mon Jan 17 2000 - 11:03:58 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:20 MST