1. 19 Jul, 2007 1 commit
    • Dag Erling Smørgrav's avatar
      Merged revisions 1709-1722 via svnmerge from · 630957a1
      Dag Erling Smørgrav authored
      svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache
      
      ........
        r1710 | des | 2007-07-17 12:33:46 +0200 (Tue, 17 Jul 2007) | 9 lines
        
        Fix child restart by always calling close_sockets() when the child dies;
        otherwise open_sockets() fails, which causes start_child() to fail silently.
        
        Furthermore, if open_sockets() fails and child_state is CH_DIED, it will
        not be possible to start it manually later; therefore, set child_state
        to CH_STOPPED when open_sockets() fails.
        
        Note: it wouldn't hurt if open_sockets() were a little more talkative.
      ........
        r1711 | des | 2007-07-17 15:05:08 +0200 (Tue, 17 Jul 2007) | 6 lines
        
        Amend previous commit.  The problem was that when a socket was already open,
        open_sockets() did not count it as "good".  Having fixed this, revert to the
        previous behaviour of keeping the sockets open if auto_restart is on; this
        avoids having a brief window (until they are reopened) during which client
        connections are refused.
      ........
        r1712 | des | 2007-07-17 18:56:21 +0200 (Tue, 17 Jul 2007) | 4 lines
        
        Remove object from LRU list before freeing it; this does not entirely
        eliminate races between the LRU code and the expiry code, but it does
        make them a lot less likely.
      ........
        r1713 | des | 2007-07-17 18:58:40 +0200 (Tue, 17 Jul 2007) | 2 lines
        
        Return count like the comment says we do.
      ........
        r1714 | des | 2007-07-17 19:06:12 +0200 (Tue, 17 Jul 2007) | 10 lines
        
        Assert that LRU_DiscardOne() returns 1, to avoid an unlikely but possible
        scenario where multiple clients each require different objects such that
        the sum of the sizes of the objects is larger than the cache (or, in the
        extreme case, one client requests an object which is larger than the
        cache) causing STV_alloc() to enter an infinite loop.
        
        This is not ideal - a better solution would be return NULL and have the
        caller deal with the problem, possibly by returning a 503 result, or by
        stalling the request for some time.
      ........
        r1715 | des | 2007-07-19 12:58:31 +0200 (Thu, 19 Jul 2007) | 2 lines
        
        gettimeofday() is good enough for varnishstat.
      ........
        r1716 | des | 2007-07-19 13:01:36 +0200 (Thu, 19 Jul 2007) | 2 lines
        
        If clock_gettime() is not available, use gettimeofday() directly.
      ........
        r1717 | des | 2007-07-19 13:02:57 +0200 (Thu, 19 Jul 2007) | 2 lines
        
        Retire libcompat's clock_gettime().
      ........
        r1718 | des | 2007-07-19 13:03:55 +0200 (Thu, 19 Jul 2007) | 2 lines
        
        Missed one occurrence of clock_gettime().
      ........
        r1719 | des | 2007-07-19 13:11:20 +0200 (Thu, 19 Jul 2007) | 4 lines
        
        Make regexp variables static.  This has the side effect of replacing
        tentative definitions with non-tentative ones, thus sidestepping one
        of the issues we have on MacOS X.
      ........
        r1720 | des | 2007-07-19 13:17:59 +0200 (Thu, 19 Jul 2007) | 4 lines
        
        Adapt for use on MacOS X / Darwin, which has GNU libtool installed as
        glibtool, and has a version of automake 1.6 which does not exhibit the
        bug I've observed on other platforms.
      ........
        r1721 | des | 2007-07-19 13:49:43 +0200 (Thu, 19 Jul 2007) | 3 lines
        
        Use the correct cc command line on MacOS.  This is a gross hack.
        Also, ignore the result of dlclose().
      ........
        r1722 | des | 2007-07-19 14:18:57 +0200 (Thu, 19 Jul 2007) | 2 lines
        
        Document Mac OS X compatibility.
      ........
      
      
      git-svn-id: http://www.varnish-cache.org/svn/branches/1.1@1723 d4fa192b-c00b-0410-8231-f00ffab90ce4
      630957a1
  2. 17 Jul, 2007 1 commit
    • Dag Erling Smørgrav's avatar
      Merged revisions 1693-1708 via svnmerge from · f2bd97c7
      Dag Erling Smørgrav authored
      svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache
      
      ........
        r1694 | phk | 2007-07-13 17:31:37 +0200 (Fri, 13 Jul 2007) | 3 lines
        
        Fix 304 responses, they got messed up in the vcl_deliver() addition.
      ........
        r1695 | phk | 2007-07-13 21:36:38 +0200 (Fri, 13 Jul 2007) | 4 lines
        
        Shave the previos commit a bit closer: don't write the HTTP response
        only to throw it away later and then rewrite it again after giving
        vcl_deliver() the chance to munge it.
      ........
        r1696 | phk | 2007-07-15 09:51:36 +0200 (Sun, 15 Jul 2007) | 2 lines
        
        Tune a couple of library warnings out
      ........
        r1697 | phk | 2007-07-15 09:52:11 +0200 (Sun, 15 Jul 2007) | 2 lines
        
        Make the header-gluing code more readable.
      ........
        r1698 | phk | 2007-07-15 09:52:30 +0200 (Sun, 15 Jul 2007) | 2 lines
        
        A cast to make flexelint happy.
      ........
        r1699 | phk | 2007-07-15 12:22:05 +0200 (Sun, 15 Jul 2007) | 2 lines
        
        Initialize all bits in the sigaction.
      ........
        r1700 | phk | 2007-07-15 12:22:39 +0200 (Sun, 15 Jul 2007) | 2 lines
        
        Plug a memory-leak in the VCL compiler.
      ........
        r1701 | phk | 2007-07-15 12:57:55 +0200 (Sun, 15 Jul 2007) | 2 lines
        
        Don't leak all the tokens.
      ........
        r1702 | phk | 2007-07-15 12:58:11 +0200 (Sun, 15 Jul 2007) | 2 lines
        
        Plug minor memory leak.
      ........
        r1703 | phk | 2007-07-15 13:04:52 +0200 (Sun, 15 Jul 2007) | 2 lines
        
        Don't leak the file contents either.
      ........
        r1704 | phk | 2007-07-15 13:08:48 +0200 (Sun, 15 Jul 2007) | 2 lines
        
        Plug even more memory leaks in the VCL compiler.
      ........
        r1705 | phk | 2007-07-15 13:25:27 +0200 (Sun, 15 Jul 2007) | 13 lines
        
        From the "What has the world come to ?" department:
        
        It used to be that sscanf(3) would walk along the proffered string
        and do what the format string was told, and as long as the format
        terminated before the input string, the NUL termination was not
        relevant.
        
        Sometime in the last 20 years, sscanf started doing a strlen on the
        passed argument changing this behaviour.
        
        Give sscanf the NUL it wants.
      ........
      
      
      git-svn-id: http://www.varnish-cache.org/svn/branches/1.1@1709 d4fa192b-c00b-0410-8231-f00ffab90ce4
      f2bd97c7
  3. 13 Jul, 2007 1 commit
    • Dag Erling Smørgrav's avatar
      Merged revisions 1649-1650,1655-1692 via svnmerge from · cb3214a6
      Dag Erling Smørgrav authored
      svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache
      
      ........
        r1657 | phk | 2007-07-05 23:08:15 +0200 (Thu, 05 Jul 2007) | 2 lines
        
        Clean up FlexeLint fluff.
      ........
        r1658 | phk | 2007-07-06 12:07:30 +0200 (Fri, 06 Jul 2007) | 3 lines
        
        Don't rewrite pipe'ed requests to "GET".
      ........
        r1659 | phk | 2007-07-09 22:23:41 +0200 (Mon, 09 Jul 2007) | 10 lines
        
        Make all protocol header fields writable, except obj.status and resp.status
        (which are numeric, they'll follow shortly)
        
        Unify the shmemlog tag used for failure to rewrite something, the Rx/Tx/Obj
        distinction is not helpful enough to warrant the complexity of it.
      ........
        r1660 | phk | 2007-07-09 22:34:59 +0200 (Mon, 09 Jul 2007) | 2 lines
        
        Allow assignment to INT type variables
      ........
        r1661 | phk | 2007-07-09 22:35:20 +0200 (Mon, 09 Jul 2007) | 2 lines
        
        Allow assignment to obj.status and resp.status
      ........
        r1662 | phk | 2007-07-10 21:46:16 +0200 (Tue, 10 Jul 2007) | 6 lines
        
        Move string stuff to vcc_string.c, there's going to be a fair bit of it.
        
        Give vcc_StringVal() a return value to say if it did anything so we can
        emit better error messages when confused.
      ........
        r1663 | phk | 2007-07-10 21:59:39 +0200 (Tue, 10 Jul 2007) | 5 lines
        
        Add conversion from IP to string format to allow things like:
        
        	set bereq.http.HeyYou = client.ip " asked for  " req.url;
      ........
        r1664 | phk | 2007-07-10 22:07:07 +0200 (Tue, 10 Jul 2007) | 3 lines
        
        Properly emit the header name in VRT_SetHdr();
      ........
        r1665 | phk | 2007-07-10 22:08:39 +0200 (Tue, 10 Jul 2007) | 2 lines
        
        Fix VRT_SetHdr() prototype
      ........
        r1666 | phk | 2007-07-10 22:43:24 +0200 (Tue, 10 Jul 2007) | 2 lines
        
        Add compiler side support for regsub() but only a dummy function in VRT.
      ........
        r1667 | phk | 2007-07-10 23:30:47 +0200 (Tue, 10 Jul 2007) | 60 lines
        
        Add "regsub" support for string manipulation.
        
        Notice this facility is subject to change!
        
        "regsub" is short for regular expression substitution and it is probably
        easiest to explain with some examples:
        
        	sub vcl_recv {
        		set req.url = regsub(req.url, "#.*", "");
        	}
        
        This will replace the requests URL with the output of the regsub() function
        
        regsub() takes three arguments: the string to be examined, a regular
        expression and a replacement string.
        
        In this case, everything after the first '#' is removed (replaced
        with nothing).
        
        The replacement string recognizes the following magic sequences:
        	&	- insert everything matched by the regexp
        	$0	- ditto.
        	$1	- replace with the first submatch of the regexp
        	$2	- replace with the second submatch of the regexp
        	...
        	$9	- replace with the ninth submatch of the regexp
        
        (The $0..$9 syntax was chosen over the \0...\9 syntax in order to avoid
        a nightmare of escape characters in the VCL source code.  Arguments and
        suggestions are welcome).
        
        A more advanced example:
        
        	set bereq.http.ClientIP = regsub(client.ip, "(.*):(.*)", "$2 $1");
        
        The client.ip variable expands to IP:port number, for instance
        	127.0.0.1:54662
        
        The regular expression "(.*):(.*)" results in the the following matches:
        	& + $0		"127.0.0.1:54662"
        	$1		"127.0.0.1"
        	$2		"54662"
        
        So the replacement string "$2 $1" results in "54662 127.0.0.1"
        
        And the completed header which is sent to the backend will look like:
        
        	"ClientIP: 54662 127.0.0.1"
        
        An even more advanced example would be:
        
            set bereq.http.magic = "Client IP = " regsub(client.ip, ":", " port = ");
        
        Where we also exploint the string concatenation ability of the "set" statement.
        
        The result string is built in the request workspace, so you may need
        to increase the workspace size if you do a lot of regsub()'s.
        
        Currently there is no decent error handling for running out of workspace.
      ........
        r1668 | phk | 2007-07-12 11:04:54 +0200 (Thu, 12 Jul 2007) | 6 lines
        
        Add TIM_mono() and TIM_real() which return double representations of
        timestamps on a monotonic and the UTC timescales respectively.
        
        Doubles are much more convenient than timespecs for comparisons etc.
      ........
        r1669 | phk | 2007-07-12 11:25:07 +0200 (Thu, 12 Jul 2007) | 2 lines
        
        Replace ev_now() with TIM_mono().
      ........
        r1670 | phk | 2007-07-12 11:25:45 +0200 (Thu, 12 Jul 2007) | 2 lines
        
        Replace Uptime() with TIM_mono()
      ........
        r1671 | phk | 2007-07-12 11:49:26 +0200 (Thu, 12 Jul 2007) | 6 lines
        
        Change all timekeeping to use doubles instead of time_t and struct timespec.
        
        Eliminate all direct calls to time(2) and clockgettime(2) and use TIM_real()
        and TIM_mono() exclusively.
      ........
        r1672 | phk | 2007-07-12 12:00:13 +0200 (Thu, 12 Jul 2007) | 2 lines
        
        Document timescale of srcaddr->ttl
      ........
        r1673 | phk | 2007-07-12 12:13:29 +0200 (Thu, 12 Jul 2007) | 2 lines
        
        Convert the last time(2) calls to TIM_real()
      ........
        r1674 | cecilihf | 2007-07-12 12:20:33 +0200 (Thu, 12 Jul 2007) | 2 lines
        
        Added a new cli option, status, for checking the status of the varnish child process. This is for use in the webmin plugin.
      ........
        r1675 | cecilihf | 2007-07-12 12:27:37 +0200 (Thu, 12 Jul 2007) | 2 lines
        
        Fixed typo
      ........
        r1676 | des | 2007-07-12 18:00:04 +0200 (Thu, 12 Jul 2007) | 2 lines
        
        RT_LIBS dependency has moved from varnishd to libvarnish.
      ........
        r1677 | des | 2007-07-12 18:02:47 +0200 (Thu, 12 Jul 2007) | 2 lines
        
        Add missing semicolon.
      ........
        r1678 | des | 2007-07-12 19:37:44 +0200 (Thu, 12 Jul 2007) | 2 lines
        
        sockaddr.sa_len is not portable.
      ........
        r1682 | phk | 2007-07-13 09:11:54 +0200 (Fri, 13 Jul 2007) | 2 lines
        
        Initialize all timestamps in the session to NAN
      ........
        r1683 | phk | 2007-07-13 09:21:46 +0200 (Fri, 13 Jul 2007) | 4 lines
        
        Unify the recycle functionality of the acceptors, all three used the same
        method.
      ........
        r1684 | phk | 2007-07-13 09:27:50 +0200 (Fri, 13 Jul 2007) | 2 lines
        
        Clean all but t_open timestamps to NAN at end of transaction.
      ........
        r1685 | phk | 2007-07-13 09:47:45 +0200 (Fri, 13 Jul 2007) | 9 lines
        
        Rename the "idle" field of struct worker to "used", which is more precise.
        
        Don't use the "used" field to signal suicide for worker threads,
        use the "wrq" field which is much more natural.
        
        Set the "used" field to NAN before doing anything and assert that
        somebody updated during the task.
      ........
        r1686 | phk | 2007-07-13 09:53:08 +0200 (Fri, 13 Jul 2007) | 2 lines
        
        Clarify XXX comment
      ........
        r1687 | phk | 2007-07-13 09:58:11 +0200 (Fri, 13 Jul 2007) | 3 lines
        
        Move setting of t_resp up to before we build the response.
      ........
        r1688 | phk | 2007-07-13 10:05:14 +0200 (Fri, 13 Jul 2007) | 2 lines
        
        Add an XXX comment
      ........
        r1690 | des | 2007-07-13 13:42:02 +0200 (Fri, 13 Jul 2007) | 2 lines
        
        Add an entry for r1531.
      ........
        r1691 | des | 2007-07-13 16:27:55 +0200 (Fri, 13 Jul 2007) | 2 lines
        
        Document regsub().
      ........
        r1692 | des | 2007-07-13 16:53:48 +0200 (Fri, 13 Jul 2007) | 2 lines
        
        Document recent changes.
      ........
      
      
      git-svn-id: http://www.varnish-cache.org/svn/branches/1.1@1693 d4fa192b-c00b-0410-8231-f00ffab90ce4
      cb3214a6
  4. 05 Jul, 2007 8 commits
  5. 03 Jul, 2007 21 commits
  6. 02 Jul, 2007 8 commits