Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
58db1e65
Commit
58db1e65
authored
Oct 09, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Isolate VTCP in its own include file
parent
71408867
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
84 additions
and
37 deletions
+84
-37
cache_acceptor.c
bin/varnishd/cache_acceptor.c
+1
-0
cache_backend.c
bin/varnishd/cache_backend.c
+1
-0
cache_backend_poll.c
bin/varnishd/cache_backend_poll.c
+1
-0
cache_center.c
bin/varnishd/cache_center.c
+1
-0
cache_dir.c
bin/varnishd/cache_dir.c
+1
-0
cache_fetch.c
bin/varnishd/cache_fetch.c
+1
-0
cache_pipe.c
bin/varnishd/cache_pipe.c
+1
-0
cache_pool.c
bin/varnishd/cache_pool.c
+1
-0
cache_vrt_var.c
bin/varnishd/cache_vrt_var.c
+1
-0
mgt_child.c
bin/varnishd/mgt_child.c
+1
-0
mgt_cli.c
bin/varnishd/mgt_cli.c
+1
-0
vtc_client.c
bin/varnishtest/vtc_client.c
+1
-0
vtc_http.c
bin/varnishtest/vtc_http.c
+1
-0
vtc_server.c
bin/varnishtest/vtc_server.c
+1
-0
vtc_varnish.c
bin/varnishtest/vtc_varnish.c
+1
-0
Makefile.am
include/Makefile.am
+2
-1
libvarnish.h
include/libvarnish.h
+0
-34
vtcp.h
include/vtcp.h
+64
-0
tcp.c
lib/libvarnish/tcp.c
+1
-2
vss.c
lib/libvarnish/vss.c
+1
-0
vmod_std.c
lib/libvmod_std/vmod_std.c
+1
-0
No files found.
bin/varnishd/cache_acceptor.c
View file @
58db1e65
...
...
@@ -33,6 +33,7 @@
#include "cache.h"
#include "vcli.h"
#include "vtcp.h"
#include "cli_priv.h"
static
pthread_t
VCA_thread
;
...
...
bin/varnishd/cache_backend.c
View file @
58db1e65
...
...
@@ -39,6 +39,7 @@
#include "cache_backend.h"
#include "vrt.h"
#include "vtcp.h"
/*--------------------------------------------------------------------
* The "simple" director really isn't, since thats where all the actual
...
...
bin/varnishd/cache_backend_poll.c
View file @
58db1e65
...
...
@@ -45,6 +45,7 @@
#include "cli_priv.h"
#include "cache.h"
#include "vrt.h"
#include "vtcp.h"
#include "cache_backend.h"
/* Default averaging rate, we want something pretty responsive */
...
...
bin/varnishd/cache_center.c
View file @
58db1e65
...
...
@@ -70,6 +70,7 @@ DOT acceptor -> start [style=bold,color=green]
#include "cache.h"
#include "vcl.h"
#include "vtcp.h"
#include "cli_priv.h"
#include "hash_slinger.h"
#include "stevedore.h"
...
...
bin/varnishd/cache_dir.c
View file @
58db1e65
...
...
@@ -34,6 +34,7 @@
#include "cache.h"
#include "cache_backend.h"
#include "vtcp.h"
/* Close a connection ------------------------------------------------*/
...
...
bin/varnishd/cache_fetch.c
View file @
58db1e65
...
...
@@ -38,6 +38,7 @@
#include "stevedore.h"
#include "cli_priv.h"
#include "vct.h"
#include "vtcp.h"
static
unsigned
fetchfrag
;
...
...
bin/varnishd/cache_pipe.c
View file @
58db1e65
...
...
@@ -35,6 +35,7 @@
#include <poll.h>
#include "cache.h"
#include "vtcp.h"
static
int
rdf
(
int
fd0
,
int
fd1
)
...
...
bin/varnishd/cache_pool.c
View file @
58db1e65
...
...
@@ -50,6 +50,7 @@
#include "cache_waiter.h"
#include "hash_slinger.h"
#include "vtcp.h"
/*--------------------------------------------------------------------
* MAC OS/X is incredibly moronic when it comes to time and such...
...
...
bin/varnishd/cache_vrt_var.c
View file @
58db1e65
...
...
@@ -36,6 +36,7 @@
#include "cache.h"
#include "vrt.h"
#include "vtcp.h"
#include "vrt_obj.h"
#include "cache_backend.h"
#include "hash_slinger.h"
...
...
bin/varnishd/mgt_child.c
View file @
58db1e65
...
...
@@ -52,6 +52,7 @@
#include "vlu.h"
#include "vss.h"
#include "vbm.h"
#include "vtcp.h"
pid_t
child_pid
=
-
1
;
...
...
bin/varnishd/mgt_cli.c
View file @
58db1e65
...
...
@@ -51,6 +51,7 @@
#include "vev.h"
#include "vlu.h"
#include "vss.h"
#include "vtcp.h"
#include "mgt.h"
...
...
bin/varnishtest/vtc_client.c
View file @
58db1e65
...
...
@@ -38,6 +38,7 @@
#include "vtc.h"
#include "vss.h"
#include "vtcp.h"
#include "libvarnish.h"
struct
client
{
...
...
bin/varnishtest/vtc_http.c
View file @
58db1e65
...
...
@@ -41,6 +41,7 @@
#include "libvarnish.h"
#include "vtc.h"
#include "vtcp.h"
#include "vgz.h"
...
...
bin/varnishtest/vtc_server.c
View file @
58db1e65
...
...
@@ -37,6 +37,7 @@
#include <sys/socket.h>
#include "vtc.h"
#include "vtcp.h"
#include "libvarnish.h"
#include "vss.h"
...
...
bin/varnishtest/vtc_varnish.c
View file @
58db1e65
...
...
@@ -46,6 +46,7 @@
#include <sys/socket.h>
#include "vtc.h"
#include "vtcp.h"
#include "libvarnish.h"
...
...
include/Makefile.am
View file @
58db1e65
...
...
@@ -55,7 +55,8 @@ nobase_noinst_HEADERS = \
vrt_obj.h
\
vsb.h
\
vsha256.h
\
vss.h
vss.h
\
vtcp.h
tbl/vrt_stv_var.h tbl/vcl_returns.h vcl.h vrt_obj.h
:
$(top_srcdir)/lib/libvcl/generate.py $(top_srcdir)/include/vrt.h
mkdir
-p
tbl
...
...
include/libvarnish.h
View file @
58db1e65
...
...
@@ -48,40 +48,6 @@ typedef void sub_func_f(void*);
int
SUB_run
(
struct
vsb
*
sb
,
sub_func_f
*
func
,
void
*
priv
,
const
char
*
name
,
int
maxlines
);
/* from libvarnish/tcp.c */
/* NI_MAXHOST and NI_MAXSERV are ridiculously long for numeric format */
#define VTCP_ADDRBUFSIZE 64
#define VTCP_PORTBUFSIZE 16
#if (defined (__SVR4) && defined (__sun)) || defined (__NetBSD__)
/*
* Solaris returns EINVAL if the other end unexepectedly reset the
* connection. This is a bug in Solaris and documented behaviour on NetBSD.
*/
#define VTCP_Check(a) ((a) == 0 || errno == ECONNRESET || errno == ENOTCONN \
|| errno == EINVAL)
#else
#define VTCP_Check(a) ((a) == 0 || errno == ECONNRESET || errno == ENOTCONN)
#endif
#define VTCP_Assert(a) assert(VTCP_Check(a))
void
VTCP_myname
(
int
sock
,
char
*
abuf
,
unsigned
alen
,
char
*
pbuf
,
unsigned
plen
);
void
VTCP_hisname
(
int
sock
,
char
*
abuf
,
unsigned
alen
,
char
*
pbuf
,
unsigned
plen
);
int
VTCP_filter_http
(
int
sock
);
int
VTCP_blocking
(
int
sock
);
int
VTCP_nonblocking
(
int
sock
);
int
VTCP_linger
(
int
sock
,
int
linger
);
#ifdef SOL_SOCKET
int
VTCP_port
(
const
struct
sockaddr_storage
*
addr
);
void
VTCP_name
(
const
struct
sockaddr_storage
*
addr
,
unsigned
l
,
char
*
abuf
,
unsigned
alen
,
char
*
pbuf
,
unsigned
plen
);
int
VTCP_connect
(
int
s
,
const
struct
sockaddr_storage
*
name
,
socklen_t
namelen
,
int
msec
);
void
VTCP_close
(
int
*
s
);
void
VTCP_set_read_timeout
(
int
s
,
double
seconds
);
#endif
/* from libvarnish/time.c */
#define TIM_FORMAT_SIZE 30
void
TIM_format
(
double
t
,
char
*
p
);
...
...
include/vtcp.h
0 → 100644
View file @
58db1e65
/*-
* Copyright (c) 2006 Verdens Gang AS
* Copyright (c) 2006-2011 Varnish Software AS
* All rights reserved.
*
* Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
/* from libvarnish/tcp.c */
/* NI_MAXHOST and NI_MAXSERV are ridiculously long for numeric format */
#define VTCP_ADDRBUFSIZE 64
#define VTCP_PORTBUFSIZE 16
#if (defined (__SVR4) && defined (__sun)) || defined (__NetBSD__)
/*
* Solaris returns EINVAL if the other end unexepectedly reset the
* connection. This is a bug in Solaris and documented behaviour on NetBSD.
*/
#define VTCP_Check(a) ((a) == 0 || errno == ECONNRESET || errno == ENOTCONN \
|| errno == EINVAL)
#else
#define VTCP_Check(a) ((a) == 0 || errno == ECONNRESET || errno == ENOTCONN)
#endif
#define VTCP_Assert(a) assert(VTCP_Check(a))
void
VTCP_myname
(
int
sock
,
char
*
abuf
,
unsigned
alen
,
char
*
pbuf
,
unsigned
plen
);
void
VTCP_hisname
(
int
sock
,
char
*
abuf
,
unsigned
alen
,
char
*
pbuf
,
unsigned
plen
);
int
VTCP_filter_http
(
int
sock
);
int
VTCP_blocking
(
int
sock
);
int
VTCP_nonblocking
(
int
sock
);
int
VTCP_linger
(
int
sock
,
int
linger
);
#ifdef SOL_SOCKET
int
VTCP_port
(
const
struct
sockaddr_storage
*
addr
);
void
VTCP_name
(
const
struct
sockaddr_storage
*
addr
,
unsigned
l
,
char
*
abuf
,
unsigned
alen
,
char
*
pbuf
,
unsigned
plen
);
int
VTCP_connect
(
int
s
,
const
struct
sockaddr_storage
*
name
,
socklen_t
namelen
,
int
msec
);
void
VTCP_close
(
int
*
s
);
void
VTCP_set_read_timeout
(
int
s
,
double
seconds
);
#endif
lib/libvarnish/tcp.c
View file @
58db1e65
...
...
@@ -51,8 +51,7 @@
#include <unistd.h>
#include <math.h>
#include "config.h"
#include "vtcp.h"
#include "libvarnish.h"
/*--------------------------------------------------------------------*/
...
...
lib/libvarnish/vss.c
View file @
58db1e65
...
...
@@ -44,6 +44,7 @@
#include <unistd.h>
#include "libvarnish.h"
#include "vtcp.h"
#include "vss.h"
/* lightweight addrinfo */
...
...
lib/libvmod_std/vmod_std.c
View file @
58db1e65
...
...
@@ -32,6 +32,7 @@
#include <syslog.h>
#include <netinet/in.h>
#include "vrt.h"
#include "vtcp.h"
#include "../../bin/varnishd/cache.h"
#include "vcc_if.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment