[csw-devel] SF.net SVN: gar:[7146] csw/mgar/pkg/memcached/trunk

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Fri Nov 6 15:01:38 CET 2009


Revision: 7146
          http://gar.svn.sourceforge.net/gar/?rev=7146&view=rev
Author:   dmichelsen
Date:     2009-11-06 14:01:38 +0000 (Fri, 06 Nov 2009)

Log Message:
-----------
memcached: Forward to latest working devel tag

Modified Paths:
--------------
    csw/mgar/pkg/memcached/trunk/Makefile
    csw/mgar/pkg/memcached/trunk/checksums

Removed Paths:
-------------
    csw/mgar/pkg/memcached/trunk/files/CSWmemcached.depend
    csw/mgar/pkg/memcached/trunk/files/CSWmemcached.gspec
    csw/mgar/pkg/memcached/trunk/files/CSWmemcached.prototype
    csw/mgar/pkg/memcached/trunk/files/Makefile.in
    csw/mgar/pkg/memcached/trunk/files/daemon.c
    csw/mgar/pkg/memcached/trunk/files/daemon.h
    csw/mgar/pkg/memcached/trunk/files/memcached.c
    csw/mgar/pkg/memcached/trunk/files/memcached.h
    csw/mgar/pkg/memcached/trunk/files/solaris.diff

Modified: csw/mgar/pkg/memcached/trunk/Makefile
===================================================================
--- csw/mgar/pkg/memcached/trunk/Makefile	2009-11-06 13:56:34 UTC (rev 7145)
+++ csw/mgar/pkg/memcached/trunk/Makefile	2009-11-06 14:01:38 UTC (rev 7146)
@@ -1,31 +1,27 @@
 GARNAME = memcached
-GARVERSION = 1.2.2
+GARVERSION = 1.4.3_rc2_2_g8c0a108
 CATEGORIES = net
 
-DESCRIPTION = distributed memory object caching system
+DESCRIPTION = Distributed memory object caching system
 define BLURB
   memcached is a high-performance, distributed memory object caching system,
   generic in nature, but intended for use in speeding up dynamic web
   applications by alleviating database load.
 endef
 
-MASTER_SITES = http://www.danga.com/memcached/dist/
-DISTFILES    = $(GARNAME)-$(GARVERSION).tar.gz
-DISTFILES   += $(call admfiles,CSWmemcached,depend prototype)
+MASTER_SITES = http://memcached.googlecode.com/files/
+DISTFILES = $(GARNAME)-$(GARVERSION).tar.gz
 
 # We define upstream file regex so we can be notifed of new upstream software release
 UFILES_REGEX = $(GARNAME)-(\d+(?:\.\d+)*).tar.gz
 
-GARCOMPILER = GNU
+SPKG_SOURCEURL = http://www.danga.com/memcached/
 
-DEPENDS += lib/libevent
+PREREQUISITE_PKGS = CSWlibevent-devel
+REQUIRED_PKGS = CSWlibevent
 
-CONFIGURE_ARGS  = $(DIRPATHS)
-CONFIGURE_ARGS += --disable-dependency-tracking
-CONFIGURE_ARGS += --with-libevent=$(prefix)
+BUILD64 = 1
+CONFIGURE_ARGS = $(DIRPATHS)
 
-# No test suite
-TEST_SCRIPTS =
-
 include gar/category.mk
 

Modified: csw/mgar/pkg/memcached/trunk/checksums
===================================================================
--- csw/mgar/pkg/memcached/trunk/checksums	2009-11-06 13:56:34 UTC (rev 7145)
+++ csw/mgar/pkg/memcached/trunk/checksums	2009-11-06 14:01:38 UTC (rev 7146)
@@ -1,7 +1 @@
-a08851f7fa7b15e92ee6320b7a79c321  download/memcached-1.2.2.tar.gz
-b8864491e6eba79a2af3e3b2ad7fae85  download/CSWmemcached.gspec
-fb52e1653adbc7d07e97a42dac3bcfee  download/CSWmemcached.depend
-5625832835a8377d55ab5e5c8791d042  download/CSWmemcached.prototype
-c6c43cc3c0da436ba55716d287e0ba44  download/daemon.c
-51969a2161c429524dfe4ae1e8b11f7b  download/daemon.h
-365b8479afe297a36e1491b2500fba3a  download/solaris.diff
+a2f988a668317fc3cfd91b22b05ab929  memcached-1.4.3_rc2_2_g8c0a108.tar.gz

Deleted: csw/mgar/pkg/memcached/trunk/files/CSWmemcached.depend
===================================================================
--- csw/mgar/pkg/memcached/trunk/files/CSWmemcached.depend	2009-11-06 13:56:34 UTC (rev 7145)
+++ csw/mgar/pkg/memcached/trunk/files/CSWmemcached.depend	2009-11-06 14:01:38 UTC (rev 7146)
@@ -1 +0,0 @@
-P CSWlibevent libevent - event notification library

Deleted: csw/mgar/pkg/memcached/trunk/files/CSWmemcached.gspec
===================================================================
--- csw/mgar/pkg/memcached/trunk/files/CSWmemcached.gspec	2009-11-06 13:56:34 UTC (rev 7145)
+++ csw/mgar/pkg/memcached/trunk/files/CSWmemcached.gspec	2009-11-06 14:01:38 UTC (rev 7146)
@@ -1,4 +0,0 @@
-%var            bitname memcached
-%var            pkgname CSWmemcached
-%include        url file://%{PKGLIB}/csw_dyndepend.gspec
-%copyright      url file://%{WORKSRC}/COPYING

Deleted: csw/mgar/pkg/memcached/trunk/files/CSWmemcached.prototype
===================================================================
--- csw/mgar/pkg/memcached/trunk/files/CSWmemcached.prototype	2009-11-06 13:56:34 UTC (rev 7145)
+++ csw/mgar/pkg/memcached/trunk/files/CSWmemcached.prototype	2009-11-06 14:01:38 UTC (rev 7146)
@@ -1,6 +0,0 @@
-d none /opt/csw/bin 0755 root bin
-f none /opt/csw/bin/memcached 0755 root bin
-d none /opt/csw/share 0755 root bin
-d none /opt/csw/share/man 0755 root bin
-d none /opt/csw/share/man/man1 0755 root bin
-f none /opt/csw/share/man/man1/memcached.1 0644 root bin

Deleted: csw/mgar/pkg/memcached/trunk/files/Makefile.in
===================================================================
--- csw/mgar/pkg/memcached/trunk/files/Makefile.in	2009-11-06 13:56:34 UTC (rev 7145)
+++ csw/mgar/pkg/memcached/trunk/files/Makefile.in	2009-11-06 14:01:38 UTC (rev 7146)
@@ -1,446 +0,0 @@
-# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
-
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-SHELL = @SHELL@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DESTDIR =
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = .
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_alias = @build_alias@
-build_triplet = @build@
-host_alias = @host_alias@
-host_triplet = @host@
-target_alias = @target_alias@
-target_triplet = @target@
-CC = @CC@
-HAVE_LIB = @HAVE_LIB@
-LIB = @LIB@
-LTLIB = @LTLIB@
-MAKEINFO = @MAKEINFO@
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-
-bin_PROGRAMS = memcached
-
-memcached_SOURCES = memcached.c slabs.c items.c memcached.h assoc.c daemon.c
-
-SUBDIRS = doc
-DIST_DIRS = scripts
-EXTRA_DIST = doc scripts TODO
-
-AM_CFLAGS = -DNDEBUG
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = 
-PROGRAMS =  $(bin_PROGRAMS)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I.
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@ -lsocket -lresolv -lmalloc
-memcached_OBJECTS =  memcached.o slabs.o items.o assoc.o daemon.o
-memcached_LDADD = $(LDADD)
-memcached_DEPENDENCIES = 
-memcached_LDFLAGS = 
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-DIST_COMMON =  README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
-Makefile.am Makefile.in NEWS TODO aclocal.m4 config.guess config.h.in \
-config.sub configure configure.ac install-sh missing mkinstalldirs
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP_ENV = --best
-SOURCES = $(memcached_SOURCES)
-OBJECTS = $(memcached_OBJECTS)
-
-all: all-redirect
-.SUFFIXES:
-.SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
-
-Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
-	cd $(top_builddir) \
-	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-$(ACLOCAL_M4):  configure.ac 
-	cd $(srcdir) && $(ACLOCAL)
-
-config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	$(SHELL) ./config.status --recheck
-$(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
-	cd $(srcdir) && $(AUTOCONF)
-
-config.h: stamp-h
-	@if test ! -f $@; then \
-		rm -f stamp-h; \
-		$(MAKE) stamp-h; \
-	else :; fi
-stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
-	cd $(top_builddir) \
-	  && CONFIG_FILES= CONFIG_HEADERS=config.h \
-	     $(SHELL) ./config.status
-	@echo timestamp > stamp-h 2> /dev/null
-$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
-	@if test ! -f $@; then \
-		rm -f $(srcdir)/stamp-h.in; \
-		$(MAKE) $(srcdir)/stamp-h.in; \
-	else :; fi
-$(srcdir)/stamp-h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOHEADER)
-	@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
-
-mostlyclean-hdr:
-
-clean-hdr:
-
-distclean-hdr:
-	-rm -f config.h
-
-maintainer-clean-hdr:
-
-mostlyclean-binPROGRAMS:
-
-clean-binPROGRAMS:
-	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-
-distclean-binPROGRAMS:
-
-maintainer-clean-binPROGRAMS:
-
-install-binPROGRAMS: $(bin_PROGRAMS)
-	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(bindir)
-	@list='$(bin_PROGRAMS)'; for p in $$list; do \
-	  if test -f $$p; then \
-	    echo "  $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
-	     $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
-	  else :; fi; \
-	done
-
-uninstall-binPROGRAMS:
-	@$(NORMAL_UNINSTALL)
-	list='$(bin_PROGRAMS)'; for p in $$list; do \
-	  rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
-	done
-
-.c.o:
-	$(COMPILE) -c $<
-
-.s.o:
-	$(COMPILE) -c $<
-
-.S.o:
-	$(COMPILE) -c $<
-
-mostlyclean-compile:
-	-rm -f *.o core *.core
-
-clean-compile:
-
-distclean-compile:
-	-rm -f *.tab.c
-
-maintainer-clean-compile:
-
-memcached: $(memcached_OBJECTS) $(memcached_DEPENDENCIES)
-	@rm -f memcached
-	$(LINK) $(memcached_LDFLAGS) $(memcached_OBJECTS) $(memcached_LDADD) $(LIBS)
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-
- at SET_MAKE@
-
-all-recursive install-data-recursive install-exec-recursive \
-installdirs-recursive install-recursive uninstall-recursive  \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
-	@set fnord $(MAKEFLAGS); amf=$$2; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
-	@set fnord $(MAKEFLAGS); amf=$$2; \
-	dot_seen=no; \
-	rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
-	  rev="$$subdir $$rev"; \
-	  test "$$subdir" != "." || dot_seen=yes; \
-	done; \
-	test "$$dot_seen" = "no" && rev=". $$rev"; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
-	list='$(SOURCES) $(HEADERS)'; \
-	unique=`for i in $$list; do echo $$i; done | \
-	  awk '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	here=`pwd` && cd $(srcdir) \
-	  && mkid -f$$here/ID $$unique $(LISP)
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
-	tags=; \
-	here=`pwd`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-   if test "$$subdir" = .; then :; else \
-	    test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
-   fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)'; \
-	unique=`for i in $$list; do echo $$i; done | \
-	  awk '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
-	  || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP))
-
-mostlyclean-tags:
-
-clean-tags:
-
-distclean-tags:
-	-rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-
-# This target untars the dist file and tries a VPATH configuration.  Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
-	-rm -rf $(distdir)
-	GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
-	mkdir $(distdir)/=build
-	mkdir $(distdir)/=inst
-	dc_install_base=`cd $(distdir)/=inst && pwd`; \
-	cd $(distdir)/=build \
-	  && ../configure --srcdir=.. --prefix=$$dc_install_base \
-	  && $(MAKE) $(AM_MAKEFLAGS) \
-	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
-	  && $(MAKE) $(AM_MAKEFLAGS) check \
-	  && $(MAKE) $(AM_MAKEFLAGS) install \
-	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
-	  && $(MAKE) $(AM_MAKEFLAGS) dist
-	-rm -rf $(distdir)
-	@banner="$(distdir).tar.gz is ready for distribution"; \
-	dashes=`echo "$$banner" | sed s/./=/g`; \
-	echo "$$dashes"; \
-	echo "$$banner"; \
-	echo "$$dashes"
-dist: distdir
-	-chmod -R a+r $(distdir)
-	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-	-rm -rf $(distdir)
-dist-all: distdir
-	-chmod -R a+r $(distdir)
-	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-	-rm -rf $(distdir)
-distdir: $(DISTFILES)
-	-rm -rf $(distdir)
-	mkdir $(distdir)
-	-chmod 777 $(distdir)
-	@for file in $(DISTFILES); do \
-	  d=$(srcdir); \
-	  if test -d $$d/$$file; then \
-	    cp -pr $$d/$$file $(distdir)/$$file; \
-	  else \
-	    test -f $(distdir)/$$file \
-	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
-	    || cp -p $$d/$$file $(distdir)/$$file || :; \
-	  fi; \
-	done
-	for subdir in $(SUBDIRS); do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d $(distdir)/$$subdir \
-	    || mkdir $(distdir)/$$subdir \
-	    || exit 1; \
-	    chmod 777 $(distdir)/$$subdir; \
-	    (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-assoc.o: assoc.c memcached.h
-items.o: items.c memcached.h
-memcached.o: memcached.c config.h memcached.h
-slabs.o: slabs.c memcached.h
-
-info-am:
-info: info-recursive
-dvi-am:
-dvi: dvi-recursive
-check-am: all-am
-check: check-recursive
-installcheck-am:
-installcheck: installcheck-recursive
-all-recursive-am: config.h
-	$(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-install-exec-am: install-binPROGRAMS
-install-exec: install-exec-recursive
-
-install-data-am:
-install-data: install-data-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-recursive
-uninstall-am: uninstall-binPROGRAMS
-uninstall: uninstall-recursive
-all-am: Makefile $(PROGRAMS) config.h
-all-redirect: all-recursive-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs: installdirs-recursive
-installdirs-am:
-	$(mkinstalldirs)  $(DESTDIR)$(bindir)
-
-
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-rm -f Makefile $(CONFIG_CLEAN_FILES)
-	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-
-maintainer-clean-generic:
-mostlyclean-am:  mostlyclean-hdr mostlyclean-binPROGRAMS \
-		mostlyclean-compile mostlyclean-tags \
-		mostlyclean-generic
-
-mostlyclean: mostlyclean-recursive
-
-clean-am:  clean-hdr clean-binPROGRAMS clean-compile clean-tags \
-		clean-generic mostlyclean-am
-
-clean: clean-recursive
-
-distclean-am:  distclean-hdr distclean-binPROGRAMS distclean-compile \
-		distclean-tags distclean-generic clean-am
-
-distclean: distclean-recursive
-	-rm -f config.status
-
-maintainer-clean-am:  maintainer-clean-hdr maintainer-clean-binPROGRAMS \
-		maintainer-clean-compile maintainer-clean-tags \
-		maintainer-clean-generic distclean-am
-	@echo "This command is intended for maintainers to use;"
-	@echo "it deletes files that may require special tools to rebuild."
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f config.status
-
-.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
-maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile install-data-recursive \
-uninstall-data-recursive install-exec-recursive \
-uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
-all-recursive check-recursive installcheck-recursive info-recursive \
-dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
-maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
-install-exec-am install-exec install-data-am install-data install-am \
-install uninstall-am uninstall all-redirect all-am all installdirs-am \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:

Deleted: csw/mgar/pkg/memcached/trunk/files/daemon.c
===================================================================
--- csw/mgar/pkg/memcached/trunk/files/daemon.c	2009-11-06 13:56:34 UTC (rev 7145)
+++ csw/mgar/pkg/memcached/trunk/files/daemon.c	2009-11-06 14:01:38 UTC (rev 7146)
@@ -1,89 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#ifndef HAVE_DAEMON
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: daemon.c,v 1.2 1996/08/19 08:22:13 tholo Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-int
-daemon(nochdir, noclose)
-	int nochdir, noclose;
-{
-	int fd;
-
-	switch (fork()) {
-	case -1:
-		return (-1);
-	case 0:
-#ifdef HAVE_CYGWIN
-		register_9x_service();
-#endif
-		break;
-	default:
-#ifdef HAVE_CYGWIN
-		/*
-		 * This sleep avoids a race condition which kills the
-		 * child process if parent is started by a NT/W2K service.
-		 */
-		sleep(1);
-#endif
-		_exit(0);
-	}
-
-	if (setsid() == -1)
-		return (-1);
-
-	if (!nochdir)
-		(void)chdir("/");
-
-	if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) {
-		(void)dup2(fd, STDIN_FILENO);
-		(void)dup2(fd, STDOUT_FILENO);
-		(void)dup2(fd, STDERR_FILENO);
-		if (fd > 2)
-			(void)close (fd);
-	}
-	return (0);
-}
-
-#endif /* !HAVE_DAEMON */
-
-
-#pragma ident	"@(#)daemon.c	1.4	03/11/19 SMI"

Deleted: csw/mgar/pkg/memcached/trunk/files/daemon.h
===================================================================
--- csw/mgar/pkg/memcached/trunk/files/daemon.h	2009-11-06 13:56:34 UTC (rev 7145)
+++ csw/mgar/pkg/memcached/trunk/files/daemon.h	2009-11-06 14:01:38 UTC (rev 7146)
@@ -1,4 +0,0 @@
-#ifndef _DAEMON_H
-#define _DAEMON_H
-int daemon(int, int);
-#endif  /* _DAEMON_H */

Deleted: csw/mgar/pkg/memcached/trunk/files/memcached.c
===================================================================
--- csw/mgar/pkg/memcached/trunk/files/memcached.c	2009-11-06 13:56:34 UTC (rev 7145)
+++ csw/mgar/pkg/memcached/trunk/files/memcached.c	2009-11-06 14:01:38 UTC (rev 7146)
@@ -1,1553 +0,0 @@
-/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-/*
- *  memcached - memory caching daemon
- *
- *       http://www.danga.com/memcached/
- *
- *  Copyright 2003 Danga Interactive, Inc.  All rights reserved.
- *
- *  Use and distribution licensed under the BSD license.  See
- *  the LICENSE file for full text.
- *
- *  Authors:
- *      Anatoly Vorobey <mellon at pobox.com>
- *      Brad Fitzpatrick <brad at danga.com>
- *
- *  $Id: memcached.c,v 1.56 2005/04/05 00:10:26 bradfitz Exp $
- */
-
-#include "daemon.h"
-#include "config.h"
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/signal.h>
-#include <sys/resource.h>
-/* some POSIX systems need the following definition
- * to get mlockall flags out of sys/mman.h.  */
-#ifndef _P1003_1B_VISIBLE
-#define _P1003_1B_VISIBLE
-#endif
-#include <pwd.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <errno.h>
-#include <time.h>
-#include <event.h>
-#include <assert.h>
-
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
-#include "memcached.h"
-
-struct stats stats;
-struct settings settings;
-
-static item **todelete = 0;
-static int delcurr;
-static int deltotal;
-
-time_t realtime(time_t exptime) {
-    time_t now;
-
-    /* no. of seconds in 30 days - largest possible delta exptime */
-    #define REALTIME_MAXDELTA 60*60*24*30
-
-    if (exptime == 0) return 0; /* 0 means never expire */
-
-    if (exptime > REALTIME_MAXDELTA)
-        return exptime;
-    else {
-        now = time(0);
-        return exptime + now;
-    }
-}
-
-void stats_init(void) {
-    stats.curr_items = stats.total_items = stats.curr_conns = stats.total_conns = stats.conn_structs = 0;
-    stats.get_cmds = stats.set_cmds = stats.get_hits = stats.get_misses = 0;
-    stats.curr_bytes = stats.bytes_read = stats.bytes_written = 0;
-    stats.started = time(0);
-}
-
-void stats_reset(void) {
-    stats.total_items = stats.total_conns = 0;
-    stats.get_cmds = stats.set_cmds = stats.get_hits = stats.get_misses = 0;
-    stats.bytes_read = stats.bytes_written = 0;
-}
-
-void settings_init(void) {
-    settings.port = 11211;
-    settings.interface.s_addr = htonl(INADDR_ANY);
-    settings.maxbytes = 64*1024*1024; /* default is 64MB */
-    settings.maxconns = 1024;         /* to limit connections-related memory to about 5MB */
-    settings.verbose = 0;
-    settings.oldest_live = 0;
-    settings.evict_to_free = 1;       /* push old items out of cache when memory runs out */
-}
-
-conn **freeconns;
-int freetotal;
-int freecurr;
-
-void set_cork (conn *c, int val) {
-    if (c->is_corked == val) return;
-    c->is_corked = val;
-#ifdef TCP_NOPUSH
-    setsockopt(c->sfd, IPPROTO_TCP, TCP_NOPUSH, &val, sizeof(val));
-#endif
-}
-
-void conn_init(void) {
-    freetotal = 200;
-    freecurr = 0;
-    freeconns = (conn **)malloc(sizeof (conn *)*freetotal);
-    return;
-}
-
-conn *conn_new(int sfd, int init_state, int event_flags) {
-    conn *c;
-
-    /* do we have a free conn structure from a previous close? */
-    if (freecurr > 0) {
-        c = freeconns[--freecurr];
-    } else { /* allocate a new one */
-        if (!(c = (conn *)malloc(sizeof(conn)))) {
-            perror("malloc()");
-            return 0;
-        }
-        c->rbuf = c->wbuf = 0;
-        c->ilist = 0;
-
-        c->rbuf = (char *) malloc(DATA_BUFFER_SIZE);
-        c->wbuf = (char *) malloc(DATA_BUFFER_SIZE);
-        c->ilist = (item **) malloc(sizeof(item *)*200);
-
-        if (c->rbuf == 0 || c->wbuf == 0 || c->ilist == 0) {
-            if (c->rbuf != 0) free(c->rbuf);
-            if (c->wbuf != 0) free(c->wbuf);
-            if (c->ilist !=0) free(c->ilist);
-            free(c);
-            perror("malloc()");
-            return 0;
-        }
-        c->rsize = c->wsize = DATA_BUFFER_SIZE;
-        c->isize = 200;
-        stats.conn_structs++;
-    }
-
-    if (settings.verbose > 1) {
-        if (init_state == conn_listening)
-            fprintf(stderr, "<%d server listening\n", sfd);
-        else
-            fprintf(stderr, "<%d new client connection\n", sfd);
-    }
-
-    c->sfd = sfd;
-    c->state = init_state;
-    c->rlbytes = 0;
-    c->rbytes = c->wbytes = 0;
-    c->wcurr = c->wbuf;
-    c->rcurr = c->rbuf;
-    c->icurr = c->ilist; 
-    c->ileft = 0;
-    c->iptr = c->ibuf;
-    c->ibytes = 0;
-
-    c->write_and_go = conn_read;
-    c->write_and_free = 0;
-    c->item = 0;
-
-    c->is_corked = 0;
-
-    event_set(&c->event, sfd, event_flags, event_handler, (void *)c);
-    c->ev_flags = event_flags;
-
-    if (event_add(&c->event, 0) == -1) {
-        if (freecurr < freetotal) {
-            freeconns[freecurr++] = c;
-        } else {
-            free (c->rbuf);
-            free (c->wbuf);
-            free (c->ilist);
-            free (c);
-        }
-        return 0;
-    }
-
-    stats.curr_conns++;
-    stats.total_conns++;
-
-    return c;
-}
-
-void conn_close(conn *c) {
-    /* delete the event, the socket and the conn */
-    event_del(&c->event);
-
-    if (settings.verbose > 1)
-        fprintf(stderr, "<%d connection closed.\n", c->sfd);
-
-    close(c->sfd);
-
-    if (c->item) {
-        item_free(c->item);
-    }
-
-    if (c->ileft) {
-        for (; c->ileft > 0; c->ileft--,c->icurr++) {
-            item_remove(*(c->icurr));
-        }
-    }
-
-    if (c->write_and_free) {
-        free(c->write_and_free);
-    }
-
-    /* if we have enough space in the free connections array, put the structure there */
-    if (freecurr < freetotal) {
-        freeconns[freecurr++] = c;
-    } else {
-        /* try to enlarge free connections array */
-        conn **new_freeconns = realloc(freeconns, sizeof(conn *)*freetotal*2);
-        if (new_freeconns) {
-            freetotal *= 2;
-            freeconns = new_freeconns;
-            freeconns[freecurr++] = c;
-        } else {
-            free(c->rbuf);
-            free(c->wbuf);
-            free(c->ilist);
-            free(c);
-        }
-    }
-
-    stats.curr_conns--;
-
-    return;
-}
-
-void out_string(conn *c, char *str) {
-    int len;
-
-    if (settings.verbose > 1)
-        fprintf(stderr, ">%d %s\n", c->sfd, str);
-
-    len = strlen(str);
-    if (len + 2 > c->wsize) {
-        /* ought to be always enough. just fail for simplicity */
-        str = "SERVER_ERROR output line too long";
-        len = strlen(str);
-    }
-
-    strcpy(c->wbuf, str);
-    strcat(c->wbuf, "\r\n");
-    c->wbytes = len + 2;
-    c->wcurr = c->wbuf;
-
-    c->state = conn_write;
-    c->write_and_go = conn_read;
-    return;
-}
-
-/* 
- * we get here after reading the value in set/add/replace commands. The command
- * has been stored in c->item_comm, and the item is ready in c->item.
- */
-
-void complete_nread(conn *c) {
-    item *it = c->item;
-    int comm = c->item_comm;
-    item *old_it;
-    time_t now = time(0);
-
-    stats.set_cmds++;
-
-    while(1) {
-        if (strncmp(ITEM_data(it) + it->nbytes - 2, "\r\n", 2) != 0) {
-            out_string(c, "CLIENT_ERROR bad data chunk");
-            break;
-        }
-
-        old_it = assoc_find(ITEM_key(it));
-
-        if (old_it && settings.oldest_live &&
-            old_it->time <= settings.oldest_live) {
-            item_unlink(old_it);
-            old_it = 0;
-        }
-
-        if (old_it && old_it->exptime && old_it->exptime < now) {
-            item_unlink(old_it);
-            old_it = 0;
-        }
-
-        if (old_it && comm==NREAD_ADD) {
-            item_update(old_it);
-            out_string(c, "NOT_STORED");
-            break;
-        }
-        
-        if (!old_it && comm == NREAD_REPLACE) {
-            out_string(c, "NOT_STORED");
-            break;
-        }
-
-        if (old_it && (old_it->it_flags & ITEM_DELETED) && (comm == NREAD_REPLACE || comm == NREAD_ADD)) {
-            out_string(c, "NOT_STORED");
-            break;
-        }
-        
-        if (old_it) {
-            item_replace(old_it, it);
-        } else item_link(it);
-        
-        c->item = 0;
-        out_string(c, "STORED");
-        return;
-    }
-            
-    item_free(it); 
-    c->item = 0; 
-    return;
-}
-
-void process_stat(conn *c, char *command) {
-    time_t now = time(0);
-
-    if (strcmp(command, "stats") == 0) {
-        char temp[1024];
-        pid_t pid = getpid();
-        char *pos = temp;
-        struct rusage usage;
-        
-        getrusage(RUSAGE_SELF, &usage);
-
-        pos += sprintf(pos, "STAT pid %u\r\n", pid);
-        pos += sprintf(pos, "STAT uptime %lu\r\n", now - stats.started);
-        pos += sprintf(pos, "STAT time %ld\r\n", now);
-        pos += sprintf(pos, "STAT version " VERSION "\r\n");
-        pos += sprintf(pos, "STAT rusage_user %ld.%06ld\r\n", usage.ru_utime.tv_sec, usage.ru_utime.tv_usec);
-        pos += sprintf(pos, "STAT rusage_system %ld.%06ld\r\n", usage.ru_stime.tv_sec, usage.ru_stime.tv_usec);
-        pos += sprintf(pos, "STAT curr_items %u\r\n", stats.curr_items);
-        pos += sprintf(pos, "STAT total_items %u\r\n", stats.total_items);
-        pos += sprintf(pos, "STAT bytes %llu\r\n", stats.curr_bytes);
-        pos += sprintf(pos, "STAT curr_connections %u\r\n", stats.curr_conns - 1); /* ignore listening conn */
-        pos += sprintf(pos, "STAT total_connections %u\r\n", stats.total_conns);
-        pos += sprintf(pos, "STAT connection_structures %u\r\n", stats.conn_structs);
-        pos += sprintf(pos, "STAT cmd_get %u\r\n", stats.get_cmds);
-        pos += sprintf(pos, "STAT cmd_set %u\r\n", stats.set_cmds);
-        pos += sprintf(pos, "STAT get_hits %u\r\n", stats.get_hits);
-        pos += sprintf(pos, "STAT get_misses %u\r\n", stats.get_misses);
-        pos += sprintf(pos, "STAT bytes_read %llu\r\n", stats.bytes_read);
-        pos += sprintf(pos, "STAT bytes_written %llu\r\n", stats.bytes_written);
-        pos += sprintf(pos, "STAT limit_maxbytes %u\r\n", settings.maxbytes);
-        pos += sprintf(pos, "END");
-        out_string(c, temp);
-        return;
-    }
-
-    if (strcmp(command, "stats reset") == 0) {
-        stats_reset();
-        out_string(c, "RESET");
-        return;
-    }
-
-#ifdef HAVE_MALLOC_H
-#ifdef HAVE_STRUCT_MALLINFO
-    if (strcmp(command, "stats malloc") == 0) {
-        char temp[512];
-        struct mallinfo info;
-        char *pos = temp;
-
-        info = mallinfo();
-        pos += sprintf(pos, "STAT arena_size %d\r\n", info.arena);
-        pos += sprintf(pos, "STAT free_chunks %d\r\n", info.ordblks);
-        pos += sprintf(pos, "STAT fastbin_blocks %d\r\n", info.smblks);
-        pos += sprintf(pos, "STAT mmapped_regions %d\r\n", info.hblks);
-        pos += sprintf(pos, "STAT mmapped_space %d\r\n", info.hblkhd);
-        pos += sprintf(pos, "STAT max_total_alloc %d\r\n", info.usmblks);
-        pos += sprintf(pos, "STAT fastbin_space %d\r\n", info.fsmblks);
-        pos += sprintf(pos, "STAT total_alloc %d\r\n", info.uordblks);
-        pos += sprintf(pos, "STAT total_free %d\r\n", info.fordblks);
-        pos += sprintf(pos, "STAT releasable_space %d\r\nEND", info.keepcost);
-        out_string(c, temp);
-        return;
-    }
-#endif /* HAVE_STRUCT_MALLINFO */
-#endif /* HAVE_MALLOC_H */
-
-    if (strcmp(command, "stats maps") == 0) {
-        char *wbuf;
-        int wsize = 8192; /* should be enough */
-        int fd;
-        int res;
-
-        wbuf = (char *)malloc(wsize);
-        if (wbuf == 0) {
-            out_string(c, "SERVER_ERROR out of memory");
-            return;
-        }
-            
-        fd = open("/proc/self/maps", O_RDONLY);
-        if (fd == -1) {
-            out_string(c, "SERVER_ERROR cannot open the maps file");
-            free(wbuf);
-            return;
-        }
-
-        res = read(fd, wbuf, wsize - 6);  /* 6 = END\r\n\0 */
-        if (res == wsize - 6) {
-            out_string(c, "SERVER_ERROR buffer overflow");
-            free(wbuf); close(fd);
-            return;
-        }
-        if (res == 0 || res == -1) {
-            out_string(c, "SERVER_ERROR can't read the maps file");
-            free(wbuf); close(fd);
-            return;
-        }
-        strcpy(wbuf + res, "END\r\n");
-        c->write_and_free=wbuf;
-        c->wcurr=wbuf;
-        c->wbytes = res + 6;
-        c->state = conn_write;
-        c->write_and_go = conn_read;
-        close(fd);
-        return;
-    }
-
-    if (strncmp(command, "stats cachedump", 15) == 0) {
-        char *buf;
-        unsigned int bytes, id, limit = 0;
-        char *start = command + 15;
-        if (sscanf(start, "%u %u\r\n", &id, &limit) < 1) {
-            out_string(c, "CLIENT_ERROR bad command line");
-            return;
-        }
-
-        buf = item_cachedump(id, limit, &bytes);
-        if (buf == 0) {
-            out_string(c, "SERVER_ERROR out of memory");
-            return;
-        }
-
-        c->write_and_free = buf;
-        c->wcurr = buf;
-        c->wbytes = bytes;
-        c->state = conn_write;
-        c->write_and_go = conn_read;
-        return;
-    }
-
-    if (strcmp(command, "stats slabs")==0) {
-        int bytes = 0;
-        char *buf = slabs_stats(&bytes);
-        if (!buf) {
-            out_string(c, "SERVER_ERROR out of memory");
-            return;
-        }
-        c->write_and_free = buf;
-        c->wcurr = buf;
-        c->wbytes = bytes;
-        c->state = conn_write;
-        c->write_and_go = conn_read;
-        return;
-    }
-
-    if (strcmp(command, "stats items")==0) {
-        char buffer[4096];
-        item_stats(buffer, 4096);
-        out_string(c, buffer);
-        return;
-    }
-
-    if (strcmp(command, "stats sizes")==0) {
-        int bytes = 0;
-        char *buf = item_stats_sizes(&bytes);
-        if (! buf) {
-            out_string(c, "SERVER_ERROR out of memory");
-            return;
-        }
-
-        c->write_and_free = buf;
-        c->wcurr = buf;
-        c->wbytes = bytes;
-        c->state = conn_write;
-        c->write_and_go = conn_read;
-        return;
-    }
-
-    out_string(c, "ERROR");
-}
-
-void process_command(conn *c, char *command) {
-    
-    int comm = 0;
-    int incr = 0;
-
-    /* 
-     * for commands set/add/replace, we build an item and read the data
-     * directly into it, then continue in nread_complete().
-     */ 
-
-    if (settings.verbose > 1)
-        fprintf(stderr, "<%d %s\n", c->sfd, command);
-
-    /* All incoming commands will require a response, so we cork at the beginning,
-       and uncork at the very end (usually by means of out_string)  */
-    set_cork(c, 1);
-
-    if ((strncmp(command, "add ", 4) == 0 && (comm = NREAD_ADD)) || 
-        (strncmp(command, "set ", 4) == 0 && (comm = NREAD_SET)) ||
-        (strncmp(command, "replace ", 8) == 0 && (comm = NREAD_REPLACE))) {
-
-        char key[251];
-        int flags;
-        time_t expire;
-        int len, res;
-        item *it;
-
-        res = sscanf(command, "%*s %250s %u %ld %d\n", key, &flags, &expire, &len);
-        if (res!=4 || strlen(key)==0 ) {
-            out_string(c, "CLIENT_ERROR bad command line format");
-            return;
-        }
-        expire = realtime(expire);
-        it = item_alloc(key, flags, expire, len+2);
-        if (it == 0) {
-            out_string(c, "SERVER_ERROR out of memory");
-            /* swallow the data line */
-            c->write_and_go = conn_swallow;
-            c->sbytes = len+2;
-            return;
-        }
-
-        c->item_comm = comm;
-        c->item = it;
-        c->rcurr = ITEM_data(it);
-        c->rlbytes = it->nbytes;
-        c->state = conn_nread;
-        return;
-    }
-
-    if ((strncmp(command, "incr ", 5) == 0 && (incr = 1)) ||
-        (strncmp(command, "decr ", 5) == 0)) {
-        char temp[32];
-        unsigned int value;
-        item *it;
-        unsigned int delta;
-        char key[251];
-        int res;
-        char *ptr;
-        time_t now = time(0);
-
-        res = sscanf(command, "%*s %250s %u\n", key, &delta);
-        if (res!=2 || strlen(key)==0 ) {
-            out_string(c, "CLIENT_ERROR bad command line format");
-            return;
-        }
-        
-        it = assoc_find(key);
-        if (it && (it->it_flags & ITEM_DELETED)) {
-            it = 0;
-        }
-        if (it && it->exptime && it->exptime < now) {
-            item_unlink(it);
-            it = 0;
-        }
-
-        if (!it) {
-            out_string(c, "NOT_FOUND");
-            return;
-        }
-
-        ptr = ITEM_data(it);
-        while (*ptr && (*ptr<'0' && *ptr>'9')) ptr++;
-        
-        value = atoi(ptr);
-
-        if (incr)
-            value+=delta;
-        else {
-            if (delta >= value) value = 0;
-            else value-=delta;
-        }
-
-        sprintf(temp, "%u", value);
-        res = strlen(temp);
-        if (res + 2 > it->nbytes) { /* need to realloc */
-            item *new_it;
-            new_it = item_alloc(ITEM_key(it), it->flags, it->exptime, res + 2 );
-            if (new_it == 0) {
-                out_string(c, "SERVER_ERROR out of memory");
-                return;
-            }
-            memcpy(ITEM_data(new_it), temp, res);
-            memcpy(ITEM_data(new_it) + res, "\r\n", 2);
-            item_replace(it, new_it);
-        } else { /* replace in-place */
-            memcpy(ITEM_data(it), temp, res);
-            memset(ITEM_data(it) + res, ' ', it->nbytes-res-2);
-        }
-        out_string(c, temp);
-        return;
-    }
-        
-    if (strncmp(command, "get ", 4) == 0) {
-
-        char *start = command + 4;
-        char key[251];
-        int next;
-        int i = 0;
-        item *it;
-        time_t now = time(0);
-
-        while(sscanf(start, " %250s%n", key, &next) >= 1) {
-            start+=next;
-            stats.get_cmds++;
-            it = assoc_find(key);
-            if (it && (it->it_flags & ITEM_DELETED)) {
-                it = 0;
-            }
-            if (settings.oldest_live && it &&
-                it->time <= settings.oldest_live) {
-                item_unlink(it);
-                it = 0;
-            }
-            if (it && it->exptime && it->exptime < now) {
-                item_unlink(it);
-                it = 0;
-            }
-
-            if (it) {
-                if (i >= c->isize) {
-                    item **new_list = realloc(c->ilist, sizeof(item *)*c->isize*2);
-                    if (new_list) {
-                        c->isize *= 2;
-                        c->ilist = new_list;
-                    } else break;
-                }
-                stats.get_hits++;
-                it->refcount++;
-                item_update(it);
-                *(c->ilist + i) = it;
-                i++;
-            } else stats.get_misses++;
-        }
-        c->icurr = c->ilist;
-        c->ileft = i;
-        if (c->ileft) {
-            c->ipart = 0;
-            c->state = conn_mwrite;
-            c->ibytes = 0;
-            return;
-        } else {
-            out_string(c, "END");
-            return;
-        }
-    }
-
-    if (strncmp(command, "delete ", 7) == 0) {
-        char key[251];
-        item *it;
-        int res;
-        time_t exptime = 0;
-
-        res = sscanf(command, "%*s %250s %ld", key, &exptime);
-        it = assoc_find(key);
-        if (!it) {
-            out_string(c, "NOT_FOUND");
-            return;
-        }
-
-        if (exptime == 0) {
-            item_unlink(it);
-            out_string(c, "DELETED");
-            return;
-        }
-
-        if (delcurr >= deltotal) {
-            item **new_delete = realloc(todelete, sizeof(item *) * deltotal * 2);
-            if (new_delete) {
-                todelete = new_delete;
-                deltotal *= 2;
-            } else { 
-                /* 
-                 * can't delete it immediately, user wants a delay,
-                 * but we ran out of memory for the delete queue
-                 */
-                out_string(c, "SERVER_ERROR out of memory");
-                return;
-            }
-        }
-            
-        exptime = realtime(exptime);
-
-        it->refcount++;
-        /* use its expiration time as its deletion time now */
-        it->exptime = exptime;
-        it->it_flags |= ITEM_DELETED;
-        todelete[delcurr++] = it;
-        out_string(c, "DELETED");
-        return;
-    }
-        
-    if (strncmp(command, "stats", 5) == 0) {
-        process_stat(c, command);
-        return;
-    }
-
-    if (strcmp(command, "flush_all") == 0) {
-        settings.oldest_live = time(0);
-        out_string(c, "OK");
-        return;
-    }
-
-    if (strcmp(command, "version") == 0) {
-        out_string(c, "VERSION " VERSION);
-        return;
-    }
-
-    if (strcmp(command, "quit") == 0) {
-        c->state = conn_closing;
-        return;
-    }
-
-    if (strncmp(command, "slabs reassign ", 15) == 0) {
-        int src, dst;
-        char *start = command+15;
-        if (sscanf(start, "%u %u\r\n", &src, &dst) == 2) {
-            int rv = slabs_reassign(src, dst);
-            if (rv == 1) {
-                out_string(c, "DONE");
-                return;
-            }
-            if (rv == 0) {
-                out_string(c, "CANT");
-                return;
-            }
-            if (rv == -1) {
-                out_string(c, "BUSY");
-                return;
-            }
-        }
-        out_string(c, "CLIENT_ERROR bogus command");
-        return;
-    }
-    
-    out_string(c, "ERROR");
-    return;
-}
-
-/* 
- * if we have a complete line in the buffer, process it and move whatever
- * remains in the buffer to its beginning.
- */
-int try_read_command(conn *c) {
-    char *el, *cont;
-
-    if (!c->rbytes)
-        return 0;
-    el = memchr(c->rbuf, '\n', c->rbytes);
-    if (!el)
-        return 0;
-    cont = el + 1;
-    if (el - c->rbuf > 1 && *(el - 1) == '\r') {
-        el--;
-    }
-    *el = '\0';
-
-    process_command(c, c->rbuf);
-
-    if (cont - c->rbuf < c->rbytes) { /* more stuff in the buffer */
-        memmove(c->rbuf, cont, c->rbytes - (cont - c->rbuf));
-    }
-    c->rbytes -= (cont - c->rbuf);
-    return 1;
-}
-
-/*
- * read from network as much as we can, handle buffer overflow and connection
- * close. 
- * return 0 if there's nothing to read on the first read.
- */
-int try_read_network(conn *c) {
-    int gotdata = 0;
-    int res;
-    while (1) {
-        if (c->rbytes >= c->rsize) {
-            char *new_rbuf = realloc(c->rbuf, c->rsize*2);
-            if (!new_rbuf) {
-                if (settings.verbose > 0)
-                    fprintf(stderr, "Couldn't realloc input buffer\n");
-                c->rbytes = 0; /* ignore what we read */
-                out_string(c, "SERVER_ERROR out of memory");
-                c->write_and_go = conn_closing;
-                return 1;
-            }
-            c->rbuf = new_rbuf; c->rsize *= 2;
-        }
-        res = read(c->sfd, c->rbuf + c->rbytes, c->rsize - c->rbytes);
-        if (res > 0) {
-            stats.bytes_read += res;
-            gotdata = 1;
-            c->rbytes += res;
-            continue;
-        }
-        if (res == 0) {
-            /* connection closed */
-            c->state = conn_closing;
-            return 1;
-        }
-        if (res == -1) {
-            if (errno == EAGAIN || errno == EWOULDBLOCK) break;
-            else return 0;
-        }
-    }
-    return gotdata;
-}
-
-int update_event(conn *c, int new_flags) {
-    if (c->ev_flags == new_flags)
-        return 1;
-    if (event_del(&c->event) == -1) return 0;
-    event_set(&c->event, c->sfd, new_flags, event_handler, (void *)c);
-    c->ev_flags = new_flags;
-    if (event_add(&c->event, 0) == -1) return 0;
-    return 1;
-}
-    
-void drive_machine(conn *c) {
-
-    int exit = 0;
-    int sfd, flags = 1;
-    socklen_t addrlen;
-    struct sockaddr addr;
-    conn *newc;
-    int res;
-
-    while (!exit) {
-        /* printf("state %d\n", c->state);*/
-        switch(c->state) {
-        case conn_listening:
-            addrlen = sizeof(addr);
-            if ((sfd = accept(c->sfd, &addr, &addrlen)) == -1) {
-                if (errno == EAGAIN || errno == EWOULDBLOCK) {
-                    exit = 1;
-                    break;
-                } else {
-                    perror("accept()");
-                }
-                break;
-            }
-            if ((flags = fcntl(sfd, F_GETFL, 0)) < 0 ||
-                fcntl(sfd, F_SETFL, flags | O_NONBLOCK) < 0) {
-                perror("setting O_NONBLOCK");
-                close(sfd);
-                break;
-            }            
-            newc = conn_new(sfd, conn_read, EV_READ | EV_PERSIST);
-            if (!newc) {
-                if (settings.verbose > 0)
-                    fprintf(stderr, "couldn't create new connection\n");
-                close(sfd);
-                break;
-            }
-
-            break;
-
-        case conn_read:
-            if (try_read_command(c)) {
-                continue;
-            }
-            if (try_read_network(c)) {
-                continue;
-            }
-            /* we have no command line and no data to read from network */
-            if (!update_event(c, EV_READ | EV_PERSIST)) {
-                if (settings.verbose > 0)
-                    fprintf(stderr, "Couldn't update event\n");
-                c->state = conn_closing;
-                break;
-            }
-            exit = 1;
-            break;
-
-        case conn_nread:
-            /* we are reading rlbytes into rcurr; */
-            if (c->rlbytes == 0) {
-                complete_nread(c);
-                break;
-            }
-            /* first check if we have leftovers in the conn_read buffer */
-            if (c->rbytes > 0) {
-                int tocopy = c->rbytes > c->rlbytes ? c->rlbytes : c->rbytes;
-                memcpy(c->rcurr, c->rbuf, tocopy);
-                c->rcurr += tocopy;
-                c->rlbytes -= tocopy;
-                if (c->rbytes > tocopy) {
-                    memmove(c->rbuf, c->rbuf+tocopy, c->rbytes - tocopy);
-                }
-                c->rbytes -= tocopy;
-                break;
-            }
-
-            /*  now try reading from the socket */
-            res = read(c->sfd, c->rcurr, c->rlbytes);
-            if (res > 0) {
-                stats.bytes_read += res;
-                c->rcurr += res;
-                c->rlbytes -= res;
-                break;
-            }
-            if (res == 0) { /* end of stream */
-                c->state = conn_closing;
-                break;
-            }
-            if (res == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
-                if (!update_event(c, EV_READ | EV_PERSIST)) {
-                    if (settings.verbose > 0) 
-                        fprintf(stderr, "Couldn't update event\n");
-                    c->state = conn_closing;
-                    break;
-                }
-                exit = 1;
-                break;
-            }
-            /* otherwise we have a real error, on which we close the connection */
-            if (settings.verbose > 0)
-                fprintf(stderr, "Failed to read, and not due to blocking\n");
-            c->state = conn_closing;
-            break;
-
-        case conn_swallow:
-            /* we are reading sbytes and throwing them away */
-            if (c->sbytes == 0) {
-                c->state = conn_read;
-                break;
-            }
-
-            /* first check if we have leftovers in the conn_read buffer */
-            if (c->rbytes > 0) {
-                int tocopy = c->rbytes > c->sbytes ? c->sbytes : c->rbytes;
-                c->sbytes -= tocopy;
-                if (c->rbytes > tocopy) {
-                    memmove(c->rbuf, c->rbuf+tocopy, c->rbytes - tocopy);
-                }
-                c->rbytes -= tocopy;
-                break;
-            }
-
-            /*  now try reading from the socket */
-            res = read(c->sfd, c->rbuf, c->rsize > c->sbytes ? c->sbytes : c->rsize);
-            if (res > 0) {
-                stats.bytes_read += res;
-                c->sbytes -= res;
-                break;
-            }
-            if (res == 0) { /* end of stream */
-                c->state = conn_closing;
-                break;
-            }
-            if (res == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
-                if (!update_event(c, EV_READ | EV_PERSIST)) {
-                    if (settings.verbose > 0)
-                        fprintf(stderr, "Couldn't update event\n");
-                    c->state = conn_closing;
-                    break;
-                }
-                exit = 1;
-                break;
-            }
-            /* otherwise we have a real error, on which we close the connection */
-            if (settings.verbose > 0)
-                fprintf(stderr, "Failed to read, and not due to blocking\n");
-            c->state = conn_closing;
-            break;
-
-        case conn_write:
-            /* we are writing wbytes bytes starting from wcurr */
-            if (c->wbytes == 0) {
-                if (c->write_and_free) {
-                    free(c->write_and_free);
-                    c->write_and_free = 0;
-                }
-                c->state = c->write_and_go;
-                if (c->state == conn_read)
-                    set_cork(c, 0);
-                break;
-            }
-            res = write(c->sfd, c->wcurr, c->wbytes);
-            if (res > 0) {
-                stats.bytes_written += res;
-                c->wcurr  += res;
-                c->wbytes -= res;
-                break;
-            }
-            if (res == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
-                if (!update_event(c, EV_WRITE | EV_PERSIST)) {
-                    if (settings.verbose > 0)
-                        fprintf(stderr, "Couldn't update event\n");
-                    c->state = conn_closing;
-                    break;
-                }                
-                exit = 1;
-                break;
-            }
-            /* if res==0 or res==-1 and error is not EAGAIN or EWOULDBLOCK,
-               we have a real error, on which we close the connection */
-            if (settings.verbose > 0)
-                fprintf(stderr, "Failed to write, and not due to blocking\n");
-            c->state = conn_closing;
-            break;
-        case conn_mwrite:
-            /* 
-             * we're writing ibytes bytes from iptr. iptr alternates between
-             * ibuf, where we build a string "VALUE...", and ITEM_data(it) for the 
-             * current item. When we finish a chunk, we choose the next one using 
-             * ipart, which has the following semantics: 0 - start the loop, 1 - 
-             * we finished ibuf, go to current ITEM_data(it); 2 - we finished ITEM_data(it),
-             * move to the next item and build its ibuf; 3 - we finished all items, 
-             * write "END".
-             */
-            if (c->ibytes > 0) {
-                res = write(c->sfd, c->iptr, c->ibytes);
-                if (res > 0) {
-                    stats.bytes_written += res;
-                    c->iptr += res;
-                    c->ibytes -= res;
-                    break;
-                }
-                if (res == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
-                    if (!update_event(c, EV_WRITE | EV_PERSIST)) {
-                        if (settings.verbose > 0)
-                            fprintf(stderr, "Couldn't update event\n");
-                        c->state = conn_closing;
-                        break;
-                    }
-                    exit = 1;
-                    break;
-                }
-                /* if res==0 or res==-1 and error is not EAGAIN or EWOULDBLOCK,
-                   we have a real error, on which we close the connection */
-                if (settings.verbose > 0)
-                    fprintf(stderr, "Failed to write, and not due to blocking\n");
-                c->state = conn_closing;
-                break;
-            } else {
-                item *it;
-                /* we finished a chunk, decide what to do next */
-                switch (c->ipart) {
-                case 1:
-                    it = *(c->icurr);
-                    assert((it->it_flags & ITEM_SLABBED) == 0);
-                    c->iptr = ITEM_data(it);
-                    c->ibytes = it->nbytes;
-                    c->ipart = 2;
-                    break;
-                case 2:
-                    it = *(c->icurr);
-                    item_remove(it);
-                    c->ileft--;
-                    if (c->ileft <= 0) {
-                        c->ipart = 3;
-                        break;
-                    } else {
-                        c->icurr++;
-                    }
-                    /* FALL THROUGH */
-                case 0:
-                    it = *(c->icurr);
-                    assert((it->it_flags & ITEM_SLABBED) == 0);
-                    c->ibytes = sprintf(c->ibuf, "VALUE %s %u %u\r\n", ITEM_key(it), it->flags, it->nbytes - 2);
-                    if (settings.verbose > 1)
-                        fprintf(stderr, ">%d sending key %s\n", c->sfd, ITEM_key(it));
-                    c->iptr = c->ibuf;
-                    c->ipart = 1;
-                    break;
-                case 3:
-                    out_string(c, "END");
-                    break;
-                }
-            }
-            break;
-
-        case conn_closing:
-            conn_close(c);
-            exit = 1;
-            break;
-        }
-
-    }
-
-    return;
-}
-
-
-void event_handler(int fd, short which, void *arg) {
-    conn *c;
-    
-    c = (conn *)arg;
-    c->which = which;
-
-    /* sanity */
-    if (fd != c->sfd) {
-        if (settings.verbose > 0)
-            fprintf(stderr, "Catastrophic: event fd doesn't match conn fd!\n");
-        conn_close(c);
-        return;
-    }
-
-    /* do as much I/O as possible until we block */
-    drive_machine(c);
-
-    /* wait for next event */
-    return;
-}
-
-int new_socket(void) {
-    int sfd;
-    int flags;
-
-    if ((sfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
-        perror("socket()");
-        return -1;
-    }
-
-    if ((flags = fcntl(sfd, F_GETFL, 0)) < 0 ||
-        fcntl(sfd, F_SETFL, flags | O_NONBLOCK) < 0) {
-        perror("setting O_NONBLOCK");
-        close(sfd);
-        return -1;
-    }
-    return sfd;
-}
-
-int server_socket(int port) {
-    int sfd;
-    struct linger ling = {0, 0};
-    struct sockaddr_in addr;
-    int flags =1;
-
-    if ((sfd = new_socket()) == -1) {
-        return -1;
-    }
-
-    setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &flags, sizeof(flags));
-    setsockopt(sfd, SOL_SOCKET, SO_KEEPALIVE, &flags, sizeof(flags));
-    setsockopt(sfd, SOL_SOCKET, SO_LINGER, &ling, sizeof(ling));
-#if !defined(TCP_NOPUSH)
-    setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, &flags, sizeof(flags));
-#endif
-
-    /* 
-     * the memset call clears nonstandard fields in some impementations
-     * that otherwise mess things up.
-     */
-    memset(&addr, 0, sizeof(addr));
-
-    addr.sin_family = AF_INET;
-    addr.sin_port = htons(port);
-    addr.sin_addr = settings.interface;
-    if (bind(sfd, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
-        perror("bind()");
-        close(sfd);
-        return -1;
-    }
-    if (listen(sfd, 1024) == -1) {
-        perror("listen()");
-        close(sfd);
-        return -1;
-    }
-    return sfd;
-}
-
-/* invoke right before gdb is called, on assert */
-void pre_gdb () {
-    int i = 0;
-    if(l_socket) close(l_socket);
-    for (i=3; i<=500; i++) close(i); /* so lame */
-    kill(getpid(), SIGABRT);
-}
-
-struct event deleteevent;
-
-void delete_handler(int fd, short which, void *arg) {
-    struct timeval t;
-    static int initialized = 0;
-
-    if (initialized) {
-        /* some versions of libevent don't like deleting events that don't exist,
-           so only delete once we know this event has been added. */
-        evtimer_del(&deleteevent);
-    } else {
-        initialized = 1;
-    }
-
-    evtimer_set(&deleteevent, delete_handler, 0);
-    t.tv_sec = 5; t.tv_usec=0;
-    evtimer_add(&deleteevent, &t);
-
-    {
-        int i, j=0;
-        time_t now = time(0);
-        for (i=0; i<delcurr; i++) {
-            item *it = todelete[i];
-            if (it->exptime < now) {
-                assert(it->refcount > 0);
-                it->it_flags &= ~ITEM_DELETED;
-                item_unlink(it);
-                item_remove(it);
-            } else {
-                todelete[j++] = it;
-            }
-        }
-        delcurr = j;
-    }
-                
-    return;
-}
-        
-void usage(void) {
-    printf(PACKAGE " " VERSION "\n");
-    printf("-p <num>      port number to listen on\n");
-    printf("-l <ip_addr>  interface to listen on, default is INDRR_ANY\n");
-    printf("-d            run as a daemon\n");
-    printf("-r            maximize core file limit\n");
-    printf("-u <username> assume identity of <username> (only when run as root)\n");
-    printf("-m <num>      max memory to use for items in megabytes, default is 64 MB\n");
-    printf("-M            return error on memory exhausted (rather than removing items)\n");
-    printf("-c <num>      max simultaneous connections, default is 1024\n");
-    printf("-k            lock down all paged memory\n");
-    printf("-v            verbose (print errors/warnings while in event loop)\n");
-    printf("-vv           very verbose (also print client commands/reponses)\n");
-    printf("-h            print this help and exit\n");
-    printf("-i            print memcached and libevent license\n");
-    printf("-P <file>     save PID in <file>, only used with -d option\n");
-    return;
-}
-
-void usage_license(void) {
-    printf(PACKAGE " " VERSION "\n\n");
-    printf(
-	"Copyright (c) 2003, Danga Interactive, Inc. <http://www.danga.com/>\n"
-	"All rights reserved.\n"
-	"\n"
-	"Redistribution and use in source and binary forms, with or without\n"
-	"modification, are permitted provided that the following conditions are\n"
-	"met:\n"
-	"\n"
-	"    * Redistributions of source code must retain the above copyright\n"
-	"notice, this list of conditions and the following disclaimer.\n"
-	"\n"
-	"    * Redistributions in binary form must reproduce the above\n"
-	"copyright notice, this list of conditions and the following disclaimer\n"
-	"in the documentation and/or other materials provided with the\n"
-	"distribution.\n"
-	"\n"
-	"    * Neither the name of the Danga Interactive nor the names of its\n"
-	"contributors may be used to endorse or promote products derived from\n"
-	"this software without specific prior written permission.\n"
-	"\n"
-	"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n"
-	"\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n"
-	"LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n"
-	"A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n"
-	"OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n"
-	"SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n"
-	"LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n"
-	"DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n"
-	"THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n"
-	"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n"
-	"OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
-	"\n"
-	"\n"
-	"This product includes software developed by Niels Provos.\n"
-	"\n"
-	"[ libevent ]\n"
-	"\n"
-	"Copyright 2000-2003 Niels Provos <provos at citi.umich.edu>\n"
-	"All rights reserved.\n"
-	"\n"
-	"Redistribution and use in source and binary forms, with or without\n"
-	"modification, are permitted provided that the following conditions\n"
-	"are met:\n"
-	"1. Redistributions of source code must retain the above copyright\n"
-	"   notice, this list of conditions and the following disclaimer.\n"
-	"2. Redistributions in binary form must reproduce the above copyright\n"
-	"   notice, this list of conditions and the following disclaimer in the\n"
-	"   documentation and/or other materials provided with the distribution.\n"
-	"3. All advertising materials mentioning features or use of this software\n"
-	"   must display the following acknowledgement:\n"
-	"      This product includes software developed by Niels Provos.\n"
-	"4. The name of the author may not be used to endorse or promote products\n"
-	"   derived from this software without specific prior written permission.\n"
-	"\n"
-	"THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n"
-	"IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n"
-	"OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n"
-	"IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n"
-	"INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n"
-	"NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n"
-	"DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n"
-	"THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n"
-	"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n"
-	"THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
-    );
-
-    return;
-}
-
-void save_pid(pid_t pid,char *pid_file) {
-    FILE *fp;
-    if (!pid_file)
-        return;
-
-    if (!(fp = fopen(pid_file,"w"))) {
-        fprintf(stderr,"Could not open the pid file %s for writing\n",pid_file);
-        return;
-    }
-
-    fprintf(fp,"%ld\n",(long) pid);
-    if (fclose(fp) == -1) {
-        fprintf(stderr,"Could not close the pid file %s.\n",pid_file);
-        return;
-    }
-}
-
-void remove_pidfile(char *pid_file) {
-  if (!pid_file)
-      return;
-
-  if (unlink(pid_file)) {
-      fprintf(stderr,"Could not remove the pid file %s.\n",pid_file);
-  }
-
-}
-
-int l_socket=0;
-
-int main (int argc, char **argv) {
-    int c;
-    conn *l_conn;
-    struct in_addr addr;
-    int lock_memory = 0;
-    int daemonize = 0;
-    int maxcore = 0;
-    char *username = 0;
-    struct passwd *pw;
-    struct sigaction sa;
-    struct rlimit rlim;
-    char *pid_file = NULL;
-
-    /* init settings */
-    settings_init();
-
-    /* process arguments */
-    while ((c = getopt(argc, argv, "p:m:Mc:khirvdl:u:P:")) != -1) {
-        switch (c) {
-        case 'p':
-            settings.port = atoi(optarg);
-            break;
-        case 'm':
-            settings.maxbytes = atoi(optarg)*1024*1024;
-            break;
-        case 'M':
-            settings.evict_to_free = 0;
-            break;
-        case 'c':
-            settings.maxconns = atoi(optarg);
-            break;
-        case 'h':
-            usage();
-            exit(0);
-        case 'i':
-            usage_license();
-            exit(0);
-        case 'k':
-            lock_memory = 1;
-            break;
-        case 'v':
-            settings.verbose++;
-            break;
-        case 'l':
-            if (!inet_aton(optarg, &addr)) {
-                fprintf(stderr, "Illegal address: %s\n", optarg);
-                return 1;
-            } else {
-                settings.interface = addr;
-            }
-            break;
-        case 'd':
-            daemonize = 1;
-            break;
-        case 'r':
-            maxcore = 1;
-            break;
-        case 'u':
-            username = optarg;
-            break;
-        case 'P':
-            pid_file = optarg;
-            break;
-        default:
-            fprintf(stderr, "Illegal argument \"%c\"\n", c);
-            return 1;
-        }
-    }
-
-    if (maxcore) {
-        struct rlimit rlim_new;
-        /* 
-         * First try raising to infinity; if that fails, try bringing
-         * the soft limit to the hard. 
-         */
-        if (getrlimit(RLIMIT_CORE, &rlim)==0) {
-            rlim_new.rlim_cur = rlim_new.rlim_max = RLIM_INFINITY;
-            if (setrlimit(RLIMIT_CORE, &rlim_new)!=0) {
-                /* failed. try raising just to the old max */
-                rlim_new.rlim_cur = rlim_new.rlim_max = 
-                    rlim.rlim_max;
-                (void) setrlimit(RLIMIT_CORE, &rlim_new);
-            }
-        }
-        /* 
-         * getrlimit again to see what we ended up with. Only fail if 
-         * the soft limit ends up 0, because then no core files will be 
-         * created at all.
-         */
-           
-        if ((getrlimit(RLIMIT_CORE, &rlim)!=0) || rlim.rlim_cur==0) {
-            fprintf(stderr, "failed to ensure corefile creation\n");
-            exit(1);
-        }
-    }
-                        
-    /* 
-     * If needed, increase rlimits to allow as many connections
-     * as needed.
-     */
-    
-    if (getrlimit(RLIMIT_NOFILE, &rlim) != 0) {
-        fprintf(stderr, "failed to getrlimit number of files\n");
-        exit(1);
-    } else {
-        int maxfiles = settings.maxconns;
-        if (rlim.rlim_cur < maxfiles) 
-            rlim.rlim_cur = maxfiles + 3;
-        if (rlim.rlim_max < rlim.rlim_cur)
-            rlim.rlim_max = rlim.rlim_cur;
-        if (setrlimit(RLIMIT_NOFILE, &rlim) != 0) {
-            fprintf(stderr, "failed to set rlimit for open files. Try running as root or requesting smaller maxconns value.\n");
-            exit(1);
-        }
-    }
-
-    /* 
-     * initialization order: first create the listening socket
-     * (may need root on low ports), then drop root if needed,
-     * then daemonise if needed, then init libevent (in some cases
-     * descriptors created by libevent wouldn't survive forking).
-     */
-
-    /* create the listening socket and bind it */
-    l_socket = server_socket(settings.port);
-    if (l_socket == -1) {
-        fprintf(stderr, "failed to listen\n");
-        exit(1);
-    }
-
-    /* lose root privileges if we have them */
-    if (getuid()== 0 || geteuid()==0) {
-        if (username==0 || *username=='\0') {
-            fprintf(stderr, "can't run as root without the -u switch\n");
-            return 1;
-        }
-        if ((pw = getpwnam(username)) == 0) {
-            fprintf(stderr, "can't find the user %s to switch to\n", username);
-            return 1;
-        }
-        if (setgid(pw->pw_gid)<0 || setuid(pw->pw_uid)<0) {
-            fprintf(stderr, "failed to assume identity of user %s\n", username);
-            return 1;
-        }
-    }
-
-    /* daemonize if requested */
-    /* if we want to ensure our ability to dump core, don't chdir to / */
-    if (daemonize) {
-        int res;
-        res = daemon(maxcore, settings.verbose);
-        if (res == -1) {
-            fprintf(stderr, "failed to daemon() in order to daemonize\n");
-            return 1;
-        }
-    }
-
-
-    /* initialize other stuff */
-    item_init();
-    event_init();
-    stats_init();
-    assoc_init();
-    conn_init();
-    slabs_init(settings.maxbytes);
-
-    /* lock paged memory if needed */
-    if (lock_memory) {
-#ifdef HAVE_MLOCKALL
-        mlockall(MCL_CURRENT | MCL_FUTURE);
-#else
-        fprintf(stderr, "warning: mlockall() not supported on this platform.  proceeding without.\n");
-#endif
-    }
-
-    /*
-     * ignore SIGPIPE signals; we can use errno==EPIPE if we
-     * need that information
-     */
-    sa.sa_handler = SIG_IGN;
-    sa.sa_flags = 0;
-    if (sigemptyset(&sa.sa_mask) == -1 ||
-        sigaction(SIGPIPE, &sa, 0) == -1) {
-        perror("failed to ignore SIGPIPE; sigaction");
-        exit(1); 
-    }
-
-    /* create the initial listening connection */
-    if (!(l_conn = conn_new(l_socket, conn_listening, EV_READ | EV_PERSIST))) {
-        fprintf(stderr, "failed to create listening connection");
-        exit(1);
-    }
-
-    /* initialise deletion array and timer event */
-    deltotal = 200; delcurr = 0;
-    todelete = malloc(sizeof(item *)*deltotal);
-    delete_handler(0,0,0); /* sets up the event */
-
-    /* save the PID in if we're a daemon */
-    if (daemonize)
-        save_pid(getpid(),pid_file);
-
-    /* enter the loop */
-    event_loop(0);
-
-    /* remove the PID file if we're a daemon */
-    if (daemonize)
-        remove_pidfile(pid_file);
-
-    return 0;
-}
-

Deleted: csw/mgar/pkg/memcached/trunk/files/memcached.h
===================================================================
--- csw/mgar/pkg/memcached/trunk/files/memcached.h	2009-11-06 13:56:34 UTC (rev 7145)
+++ csw/mgar/pkg/memcached/trunk/files/memcached.h	2009-11-06 14:01:38 UTC (rev 7146)
@@ -1,212 +0,0 @@
-/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-/* $Id: memcached.h,v 1.21 2004/02/24 23:42:02 bradfitz Exp $ */
-
-#define DATA_BUFFER_SIZE 2048
-
-#if defined(TCP_CORK) && !defined(TCP_NOPUSH)
-#define TCP_NOPUSH TCP_CORK
-#endif
-
-struct stats {
-    unsigned int  curr_items;
-    unsigned int  total_items;
-    unsigned long long  curr_bytes;
-    unsigned int  curr_conns;
-    unsigned int  total_conns;
-    unsigned int  conn_structs;
-    unsigned int  get_cmds;
-    unsigned int  set_cmds;
-    unsigned int  get_hits;
-    unsigned int  get_misses;
-    time_t        started;          /* when the process was started */
-    unsigned long long bytes_read;
-    unsigned long long bytes_written;
-};
-
-struct settings {
-    unsigned int maxbytes;
-    int maxconns;
-    int port;
-    struct in_addr interface;
-    int verbose;
-    time_t oldest_live;   /* ignore existing items older than this */
-    int evict_to_free;
-};
-
-extern struct stats stats;
-extern struct settings settings;
-
-#define ITEM_LINKED 1
-#define ITEM_DELETED 2
-
-/* temp */
-#define ITEM_SLABBED 4
-
-typedef struct _stritem {
-    struct _stritem *next;
-    struct _stritem *prev;
-    struct _stritem *h_next;  /* hash chain next */
-    unsigned short  refcount; 
-    unsigned short  flags;
-    int    nbytes;  /* size of data */
-    time_t time;    /* least recent access */
-    time_t exptime; /* expire time */
-    unsigned char it_flags;     /* ITEM_* above */
-    unsigned char slabs_clsid;
-    unsigned char nkey;         /* key length, with terminating null and padding */
-    unsigned char dummy1;
-    void *end;
-} item;
-
-#define ITEM_key(item) ((char*)&((item)->end))
-
-/* warning: don't use these macros with a function, as it evals its arg twice */
-#define ITEM_data(item) ((char*) &((item)->end) + (item)->nkey)
-#define ITEM_ntotal(item) (sizeof(struct _stritem) + (item)->nkey + (item)->nbytes)
-
-enum conn_states {
-    conn_listening,  /* the socket which listens for connections */
-    conn_read,       /* reading in a command line */
-    conn_write,      /* writing out a simple response */
-    conn_nread,      /* reading in a fixed number of bytes */
-    conn_swallow,    /* swallowing unnecessary bytes w/o storing */
-    conn_closing,    /* closing this connection */
-    conn_mwrite      /* writing out many items sequentially */
-};
-
-#define NREAD_ADD 1
-#define NREAD_SET 2
-#define NREAD_REPLACE 3
-
-typedef struct {
-    int    sfd;
-    int    state;
-    struct event event;
-    short  ev_flags;
-    short  which;  /* which events were just triggered */
-
-    char   *rbuf;  
-    int    rsize;  
-    int    rbytes;
-
-    char   *wbuf;
-    char   *wcurr;
-    int    wsize;
-    int    wbytes; 
-    int    write_and_go; /* which state to go into after finishing current write */
-    void   *write_and_free; /* free this memory after finishing writing */
-    char    is_corked;         /* boolean, connection is corked */
-
-    char   *rcurr;
-    int    rlbytes;
-    
-    /* data for the nread state */
-
-    /* 
-     * item is used to hold an item structure created after reading the command
-     * line of set/add/replace commands, but before we finished reading the actual 
-     * data. The data is read into ITEM_data(item) to avoid extra copying.
-     */
-
-    void   *item;     /* for commands set/add/replace  */
-    int    item_comm; /* which one is it: set/add/replace */
-
-    /* data for the swallow state */
-    int    sbytes;    /* how many bytes to swallow */
-
-    /* data for the mwrite state */
-    item   **ilist;   /* list of items to write out */
-    int    isize;
-    item   **icurr;
-    int    ileft;
-    int    ipart;     /* 1 if we're writing a VALUE line, 2 if we're writing data */
-    char   ibuf[300]; /* for VALUE lines */
-    char   *iptr;
-    int    ibytes;
-                         
-} conn;
-
-/* listening socket */
-extern int l_socket;
-
-/* temporary hack */
-/* #define assert(x) if(!(x)) { printf("assert failure: %s\n", #x); pre_gdb(); }
-   void pre_gdb (); */
-
-/*
- * Functions
- */
-
-/* 
- * given time value that's either unix time or delta from current unix time, return
- * unix time. Use the fact that delta can't exceed one month (and real time value can't 
- * be that low).
- */
-
-time_t realtime(time_t exptime);
-
-/* slabs memory allocation */
-
-/* Init the subsystem. The argument is the limit on no. of bytes to allocate, 0 if no limit */
-void slabs_init(unsigned int limit);
-
-/* Given object size, return id to use when allocating/freeing memory for object */
-/* 0 means error: can't store such a large object */
-unsigned int slabs_clsid(unsigned int size);
-
-/* Allocate object of given length. 0 on error */
-void *slabs_alloc(unsigned int size);
-
-/* Free previously allocated object */
-void slabs_free(void *ptr, unsigned int size);
-    
-/* Fill buffer with stats */
-char* slabs_stats(int *buflen);
-
-/* Request some slab be moved between classes
-  1 = success
-   0 = fail
-   -1 = tried. busy. send again shortly. */
-int slabs_reassign(unsigned char srcid, unsigned char dstid);
-    
-/* event handling, network IO */
-void event_handler(int fd, short which, void *arg);
-conn *conn_new(int sfd, int init_state, int event_flags);
-void conn_close(conn *c);
-void conn_init(void);
-void drive_machine(conn *c);
-int new_socket(void);
-int server_socket(int port);
-int update_event(conn *c, int new_flags);
-int try_read_command(conn *c);
-int try_read_network(conn *c);
-void complete_nread(conn *c);
-void process_command(conn *c, char *command);
-
-/* stats */
-void stats_reset(void);
-void stats_init(void);
-
-/* defaults */
-void settings_init(void);
-
-/* associative array */
-void assoc_init(void);
-item *assoc_find(char *key);
-int assoc_insert(char *key, item *item);
-void assoc_delete(char *key);
-
-
-void item_init(void);
-item *item_alloc(char *key, int flags, time_t exptime, int nbytes);
-void item_free(item *it);
-
-int item_link(item *it);    /* may fail if transgresses limits */
-void item_unlink(item *it);
-void item_remove(item *it);
-
-void item_update(item *it);   /* update LRU time to current and reposition */
-int item_replace(item *it, item *new_it);
-char *item_cachedump(unsigned int slabs_clsid, unsigned int limit, unsigned int *bytes);
-char *item_stats_sizes(int *bytes);
-void item_stats(char *buffer, int buflen);

Deleted: csw/mgar/pkg/memcached/trunk/files/solaris.diff
===================================================================
--- csw/mgar/pkg/memcached/trunk/files/solaris.diff	2009-11-06 13:56:34 UTC (rev 7145)
+++ csw/mgar/pkg/memcached/trunk/files/solaris.diff	2009-11-06 14:01:38 UTC (rev 7146)
@@ -1,56 +0,0 @@
-diff --speed-large-files --minimal -Nru memcached-1.1.12.orig/Makefile.in memcached-1.1.12/Makefile.in
---- memcached-1.1.12.orig/Makefile.in	2005-12-13 03:33:09.453997000 -0500
-+++ memcached-1.1.12/Makefile.in	2005-12-13 03:32:52.961025000 -0500
-@@ -73,7 +73,7 @@
- 
- bin_PROGRAMS = memcached
- 
--memcached_SOURCES = memcached.c slabs.c items.c memcached.h assoc.c
-+memcached_SOURCES = memcached.c slabs.c items.c memcached.h assoc.c daemon.c
- 
- SUBDIRS = doc
- DIST_DIRS = scripts
-@@ -90,8 +90,8 @@
- DEFS = @DEFS@ -I. -I$(srcdir) -I.
- CPPFLAGS = @CPPFLAGS@
- LDFLAGS = @LDFLAGS@
--LIBS = @LIBS@
--memcached_OBJECTS =  memcached.o slabs.o items.o assoc.o
-+LIBS = @LIBS@ -lsocket -lresolv -lmalloc
-+memcached_OBJECTS =  memcached.o slabs.o items.o assoc.o daemon.o
- memcached_LDADD = $(LDADD)
- memcached_DEPENDENCIES = 
- memcached_LDFLAGS = 
-diff --speed-large-files --minimal -Nru memcached-1.1.12.orig/memcached.c memcached-1.1.12/memcached.c
---- memcached-1.1.12.orig/memcached.c	2005-12-13 03:33:09.998675000 -0500
-+++ memcached-1.1.12/memcached.c	2005-12-13 03:32:48.075669000 -0500
-@@ -16,7 +16,9 @@
-  *  $Id: memcached.c,v 1.56 2005/04/05 00:10:26 bradfitz Exp $
-  */
- 
-+#include "daemon.h"
- #include "config.h"
-+#include <signal.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/time.h>
-diff --speed-large-files --minimal -Nru memcached-1.1.12.orig/memcached.h memcached-1.1.12/memcached.h
---- memcached-1.1.12.orig/memcached.h	2005-12-13 03:33:10.090457000 -0500
-+++ memcached-1.1.12/memcached.h	2005-12-13 03:32:48.110122000 -0500
-@@ -55,13 +55,13 @@
-     unsigned char slabs_clsid;
-     unsigned char nkey;         /* key length, with terminating null and padding */
-     unsigned char dummy1;
--    void * end[0];
-+    void *end;
- } item;
- 
--#define ITEM_key(item) ((char*)&((item)->end[0]))
-+#define ITEM_key(item) ((char*)&((item)->end))
- 
- /* warning: don't use these macros with a function, as it evals its arg twice */
--#define ITEM_data(item) ((char*) &((item)->end[0]) + (item)->nkey)
-+#define ITEM_data(item) ((char*) &((item)->end) + (item)->nkey)
- #define ITEM_ntotal(item) (sizeof(struct _stritem) + (item)->nkey + (item)->nbytes)
- 
- enum conn_states {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list