des [Tue, 15 May 2007 11:35:44 +0000 (11:35 +0000)]
Attempt to fix the bind-to-any problem:
- Introduce a "struct tcp_addr" which is a lightweight form of struct
addrinfo for our own internal use.
- Add a TCP_resolve() function which takes the output from TCP_parse()
and fills in a list of pointers to struct tcp_addr, one for each
address returned by getaddrinfo().
- Modify all TCP_open() callers to use TCP_resolve() and call TCP_open()
once for every address returned.
After compilation of a VCL program, do a test-load into the management
process to catch any implementation-discrepancies between symbols used
by the compiler and those implemented in the runtime.
The situation will happen from time to time and there is no need to
issue a panic when we can test sensibly for it.
........
r1403 | ingvar | 2007-05-11 09:51:11 +0200 (Fri, 11 May 2007) | 5 lines
* Fri May 11 2007 Ingvar Hagelund <ingvar@linpro.no> - 1.0.svn-20070511
- Threw latest changes into svn trunk
- Removed the conversion of manpages into utf8. They are all utf8 in trunk
........
r1404 | ingvar | 2007-05-11 10:13:03 +0200 (Fri, 11 May 2007) | 1 line
........
r1406 | des | 2007-05-11 13:06:03 +0200 (Fri, 11 May 2007) | 2 lines
Comment out comparisons which are always true (unsigned >= 0)
........
r1407 | des | 2007-05-11 13:06:38 +0200 (Fri, 11 May 2007) | 2 lines
Tweak DEVELOPER_CFLAGS.
........
r1408 | des | 2007-05-11 13:14:32 +0200 (Fri, 11 May 2007) | 2 lines
Pull flopen() and pidfile_*() (renamed to vpf_*()) from FreeBSD.
........
r1409 | des | 2007-05-11 13:15:46 +0200 (Fri, 11 May 2007) | 2 lines
Expand tags.
........
r1410 | des | 2007-05-11 13:17:09 +0200 (Fri, 11 May 2007) | 2 lines
No use expanding tags unless there *are* tags...
........
r1411 | des | 2007-05-11 13:34:42 +0200 (Fri, 11 May 2007) | 2 lines
Add -D (daemonize) and -P (pid file) options.
........
r1412 | des | 2007-05-11 13:35:59 +0200 (Fri, 11 May 2007) | 2 lines
Remove unused header.
........
r1413 | des | 2007-05-11 14:01:47 +0200 (Fri, 11 May 2007) | 2 lines
Avoid gcc4-specific compiler options.
........
r1414 | des | 2007-05-11 14:05:02 +0200 (Fri, 11 May 2007) | 2 lines
Forgotten commit: check for <vis.h> and daemon(3) availability.
........
r1415 | des | 2007-05-11 14:17:26 +0200 (Fri, 11 May 2007) | 2 lines
Add -P (pid file) option.
........
r1416 | des | 2007-05-11 14:19:48 +0200 (Fri, 11 May 2007) | 2 lines
Minor style issues.
........
r1417 | phk | 2007-05-11 15:15:16 +0200 (Fri, 11 May 2007) | 7 lines
Make the sendfile threshold inifinity for now, we have evidence of
sendfile not doing it's job in a number of operating system (-versions ?)
This change is unlikely to cause a performance hit anywhere, because
writev() is pretty effective in the first place.
........
r1418 | des | 2007-05-14 11:02:23 +0200 (Mon, 14 May 2007) | 2 lines
Document the inadvisability of enabling sendfile.
........
ingvar [Fri, 11 May 2007 07:51:11 +0000 (07:51 +0000)]
* Fri May 11 2007 Ingvar Hagelund <ingvar@linpro.no> - 1.0.svn-20070511
- Threw latest changes into svn trunk
- Removed the conversion of manpages into utf8. They are all utf8 in trunk
phk [Wed, 9 May 2007 10:55:33 +0000 (10:55 +0000)]
After compilation of a VCL program, do a test-load into the management
process to catch any implementation-discrepancies between symbols used
by the compiler and those implemented in the runtime.
The situation will happen from time to time and there is no need to
issue a panic when we can test sensibly for it.
des [Wed, 2 May 2007 14:37:42 +0000 (14:37 +0000)]
Don't try to lock the objhead mutex if we don't have an objhead. Doing so
caused the Varnish child to die immediately after sending its 503 response
if the backend didn't respond.
des [Wed, 2 May 2007 12:20:43 +0000 (12:20 +0000)]
Try fixing #95 again. The trick is that if we get a new SLT_VCL_call
while the F_INVCL flag is set, we need to insert a newline before the
entry for the new VCL_call.
des [Tue, 1 May 2007 18:21:53 +0000 (18:21 +0000)]
Add and document a ping_interval parameter which controls the interval at
which the parent pings the child. Also document pipe_timeout, which was
left out of the man page by accident.
des [Tue, 1 May 2007 17:55:31 +0000 (17:55 +0000)]
Two minor logging fixes:
- change the type of vsl_handler()'s tag argument from unsigned int to
enum shmlogtag to allow gcc to check switch statements and gdb to show
its value by name rather than by number.
- fix the "missing newline after VCL_call" bug in varnishlog (#95)
des [Tue, 24 Apr 2007 09:39:12 +0000 (09:39 +0000)]
Correctly detect the presence and location of all external library we use
(except for the C math library, which the C standard guarantees is always
available as -lm) and more importantly, use them only where needed.
des [Sat, 21 Apr 2007 21:48:56 +0000 (21:48 +0000)]
Major rewrite of the VSL handler for increased robustness and clarity:
- Treat all request fields in a similar manner.
- Mostly eliminate fixed-size buffers.
- Don't print or format anything until we see ReqEnd.
- If we saw a Host: header, use it to generate an absolute URI,
resulting in far more useful output when processing logs from a
server which handles multiple virtual hosts.
When we have some amount of a chunk header, but not all of it, we
need to read more from the fd. The semantics we _really_ want for
that read operation is "wait until at least one char is available,
then return as many as N to us".
This can be done with a combination of system calls, but it is likely
just as cheap to just read one char at a time, so we do that.
Move the function that pushes the compiled VCL programs C source through
the systems cc(1) from the VCL compiler library to the varnishd process.
This reduces the VCL-compiler library to a text-procesing functionality
and makes it easier to build other tools, including test-suites,
around the VCL-compiler.
It also moves the actual compiler invocation string into the varnishd
sources, where it can be handled appropriately, possibly as a paramter.
Improve error handling for unterminated /* ... */ comments.
Add undocumented and unsupported facility for inline C source code
in VCL programs. The syntax is "C{ getpid(); }C" and you are on
your own if you use this.
Split the parsing of actions into a separate file, this is the bit
I expect to grow the most in the near future and all actions have
a lot more in common, than they have with conditionals etc.
phk [Fri, 30 Mar 2007 21:11:15 +0000 (21:11 +0000)]
Overhaul compiler to get rid of memory leaks and other bogons.
Add a memlist to the tokenlist and a function which allocates
with malloc(3) and hangs the piece on the memlist of tokenlist.
At the end of compilation, we ditch everything on the list.
Handle vrt_obj.h like the other #includes, and stuff these
into a vsb instead of directly to a file.
Free decoded token string, if any.
Pull creation and destruction of tokenlist into separate functions
for code clarity. Remember to destry everything in the tokenlist.
Pull invocation of cc(1) into a separate function and change the
way we do it, so we get any cc(1) groans and whines back in the
vsb so a CLI user will see them. More errorchecks than before.
des [Thu, 29 Mar 2007 10:49:58 +0000 (10:49 +0000)]
The argv length calculation was not only off by one, but failed to take
into account the extra space required by expanded quotes, backslashes and
newlines. Instead of pre-allocating a (possibly too short) buffer, start
with a 64-byte buffer and double it every time we come close to filling
it up. Also, avoid appending a trailing space before the final newline.
This issue was uncovered by Kristoffer Gleditsch <kristoffer@linpro.no>,
who also helped test this patch.
Technically this results in a change to how we account for source
code references in the counter/profile table as well, and as a result
the entire source code of the VCL program is now compiled into the
shared library for easy reference.