]> err.no Git - varnish/commitdiff
Move the tcp.c file to libvarnish, we need the primitives in varnishtest
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 26 Aug 2008 07:47:23 +0000 (07:47 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 26 Aug 2008 07:47:23 +0000 (07:47 +0000)
also.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3126 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/Makefile.am
varnish-cache/bin/varnishd/common.h
varnish-cache/include/libvarnish.h
varnish-cache/lib/libvarnish/Makefile.am
varnish-cache/lib/libvarnish/tcp.c [moved from varnish-cache/bin/varnishd/tcp.c with 99% similarity]

index e487812de52026cb15ae11744f64afea9e54b42d..81f0e8e88276ada179164ca08f49a8134733b021 100644 (file)
@@ -53,7 +53,6 @@ varnishd_SOURCES = \
        storage_malloc.c \
        storage_synth.c \
        storage_umem.c \
-       tcp.c \
        varnishd.c
 
 noinst_HEADERS = \
index 280486a416ffa92e65e09a074dd7a0ce5087baf3..82913efdd66f9d33539fd8b66fe960b2b1688a9d 100644 (file)
@@ -42,21 +42,6 @@ void VSL_Panic(int *len, char **ptr);
 void VSL_MgtInit(const char *fn, unsigned size);
 extern struct varnish_stats *VSL_stats;
 
-/* tcp.c */
-/* NI_MAXHOST and NI_MAXSERV are ridiculously long for numeric format */
-#define TCP_ADDRBUFSIZE                64
-#define TCP_PORTBUFSIZE                16
-
-void TCP_name(const struct sockaddr *addr, unsigned l, char *abuf, unsigned alen, char *pbuf, unsigned plen);
-void TCP_myname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen);
-int TCP_filter_http(int sock);
-void TCP_blocking(int sock);
-void TCP_nonblocking(int sock);
-#ifdef SOL_SOCKET
-int TCP_connect(int s, const struct sockaddr *name, socklen_t namelen, int msec);
-void TCP_close(int *s);
-#endif
-
 #define TRUST_ME(ptr)  ((void*)(uintptr_t)(ptr))
 
 /* Really belongs in mgt.h, but storage_file chokes on both */
index 8f74f839a246d2083ab8b5709812fe72012bc60f..e250c33bf55540f0b0e587860653f48cd8a9a0d8 100644 (file)
@@ -50,6 +50,21 @@ uint32_t crc32_l(const void *p1, unsigned l);
 /* from libvarnish/num.c */
 const char *str2bytes(const char *p, uintmax_t *r, uintmax_t rel);
 
+/* from libvarnish/tcp.c */
+/* NI_MAXHOST and NI_MAXSERV are ridiculously long for numeric format */
+#define TCP_ADDRBUFSIZE                64
+#define TCP_PORTBUFSIZE                16
+
+void TCP_myname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen);
+int TCP_filter_http(int sock);
+void TCP_blocking(int sock);
+void TCP_nonblocking(int sock);
+#ifdef SOL_SOCKET
+void TCP_name(const struct sockaddr *addr, unsigned l, char *abuf, unsigned alen, char *pbuf, unsigned plen);
+int TCP_connect(int s, const struct sockaddr *name, socklen_t namelen, int msec);
+void TCP_close(int *s);
+#endif
+
 /* from libvarnish/time.c */
 void TIM_format(double t, char *p);
 time_t TIM_parse(const char *p);
index 00a01bf657e3faf9fb1f6deb6e6e5f1f19b83840..800704a6f0e2b17209dce2acfa61adb5856dc046 100644 (file)
@@ -14,6 +14,7 @@ libvarnish_la_SOURCES = \
        flopen.c \
        num.c \
        time.c \
+       tcp.c \
        vct.c \
        version.c \
        vev.c \
similarity index 99%
rename from varnish-cache/bin/varnishd/tcp.c
rename to varnish-cache/lib/libvarnish/tcp.c
index af54042a40dc76c4aaa69900d007a0e13b4d1873..159098d6c06430b8d9f04974b7a4c22aa4c6927f 100644 (file)
@@ -53,7 +53,7 @@
 #include "compat/strlcpy.h"
 #endif
 
-#include "mgt.h"
+#include "libvarnish.h"
 
 /*--------------------------------------------------------------------*/