  	default: return "x";
  	}
  }
-diff -ur lighttpd-1.4.26/src/connections.c lighttpd-1.4.26.new/src/connections.c
---- lighttpd-1.4.26/src/connections.c	2010-02-04 19:07:45.000000000 +0900
-+++ lighttpd-1.4.26.new/src/connections.c	2010-02-13 20:39:41.000000000 +0900
+diff -ur lighttpd-1.4.26.orig/src/connections.c lighttpd-1.4.26/src/connections.c
+--- lighttpd-1.4.26.orig/src/connections.c	2010-02-04 19:07:45.000000000 +0900
++++ lighttpd-1.4.26/src/connections.c	2010-06-08 18:27:51.000000000 +0900
 @@ -1155,6 +1155,8 @@
  		}
  

 	default:
 		fdevent_event_del(srv->ev, &(con->fde_ndx), con->fd);
 		break;
diff -ur lighttpd-1.4.26/src/plugin.c lighttpd-1.4.26.new/src/plugin.c
--- lighttpd-1.4.26/src/plugin.c	2010-02-02 08:28:20.000000000 +0900
+++ lighttpd-1.4.26.new/src/plugin.c	2010-02-13 20:39:41.000000000 +0900
@@ -44,6 +44,7 @@
 		PLUGIN_FUNC_INIT,
 		PLUGIN_FUNC_CLEANUP,

diff -ur lighttpd-1.4.26.orig/configure.ac lighttpd-1.4.26/configure.ac
--- lighttpd-1.4.26.orig/configure.ac	2010-02-02 08:28:20.000000000 +0900
+++ lighttpd-1.4.26/configure.ac	2010-06-08 18:28:02.000000000 +0900
@@ -67,6 +67,7 @@
 AC_TYPE_OFF_T
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
+AC_TYPE_UINT32_T
 
 AC_CHECK_MEMBER(struct tm.tm_gmtoff,[AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm])],,[#include <time.h>])
 AC_CHECK_TYPES(struct sockaddr_storage,,,[#include <sys/socket.h>])
@@ -81,7 +82,7 @@
 AC_TYPE_SIGNAL
 AC_FUNC_STAT
 AC_FUNC_STRFTIME
-AC_CHECK_FUNCS([issetugid inet_pton])
+AC_CHECK_FUNCS([issetugid inet_pton strtoul nl_langinfo setlocale])
 
 dnl Checks for database.
 MYSQL_INCLUDE=""
@@ -174,6 +175,64 @@
  AC_SUBST(ATTR_LIB)
 fi
 
+dnl Check for iconv
+AC_MSG_CHECKING(whether --with-libiconv option specified)
+AC_ARG_WITH(
+	libiconv,
+	[  --with-libiconv=DIR	enable to convert locale: default=yes],
+	[ libiconv_dir=$withval ],
+	[ libiconv_dir=yes ]) 
+
+if test "x${libiconv_dir}" != "xno"; then
+   AC_MSG_RESULT($libiconv_dir)
+   if test "x${libiconv_dir}" != "xyes"; then
+      LIBICONV_CFLAGS="-I${libiconv_dir}/include"
+      LIBICONV_LDFLAGS="-L${libiconv_dir}/lib"
+   fi
+   save_CFLAGS="$CFLAGS"
+   save_LDFLAGS="$LDFLAGS"
+   CFLAGS=$LIBICONV_CFLAGS
+   LDFLAGS=$LIBICONV_LDFLAGS
+   AC_CHECK_FUNC(iconv, has_iconv=yes, has_iconv=no)
+   AC_CHECK_LIB(iconv, iconv, has_libiconv=yes, has_libiconv=no)
+   if test "x${has_iconv}" == "xno" &&
+      test "x${has_libiconv}" == "xno"; then
+      HAS_LIBICONV=""
+   else
+      HAS_LIBICONV="yes"
+   fi
+   if test "x${has_iconv}" == "xno" &&
+      test "x${has_libiconv}" == "xyes"; then
+      	   LIBICONV_LIBS="-liconv"
+   fi
+   CFLAGS="$save_CFLAGS"
+   LDFLAGS="$save_LDFLAGS"
+fi
+AC_SUBST(HAS_LIBICONV)
+AC_SUBST(LIBICONV_CFLAGS)
+AC_SUBST(LIBICONV_LDFLAGS)
+AC_SUBST(LIBICONV_LIBS)
+CFLAGS="$CFLAGS $LIBICONV_CFLAGS"
+LDFLAGS="$LDFLAGS $LIBICONV_LDFLAGS"
+LIBS="$LIBS $LIBICONV_LIBS"
+
+dnl Check for websocket version
+AC_MSG_CHECKING(whether --with-websocket-version option specified)
+AC_ARG_WITH(
+	websocket-version,
+	[  --with-websocket-version=VER	determine websocket version : default=75],
+	[ websocket_version_num=$withval ],
+	[ websocket_version_num=75 ]) 
+AC_MSG_RESULT(${websocket_version_num})
+if test "x${websocket_version_num}" == "x75"; then
+   WEBSOCKET_VERSION_CFLAGS="-D_MOD_WEBSOCKET_SPEC_UP_TO_75_"
+fi
+if test "x${websocket_version_num}" == "x76"; then
+   WEBSOCKET_VERSION_CFLAGS="-D_MOD_WEBSOCKET_SPEC_76_"
+fi
+AC_SUBST(WEBSOCKET_VERSION_CFLAGS)
+CFLAGS="$CFLAGS $WEBSOCKET_VERSION_CFLAGS"
+
 dnl openssl on solaris needs -lsocket -lnsl
 AC_SEARCH_LIBS(socket,socket)
 AC_SEARCH_LIBS(gethostbyname,nsl socket)
@@ -581,6 +640,13 @@
 do_build="mod_cgi mod_fastcgi mod_extforward mod_proxy mod_evhost mod_simple_vhost mod_access mod_alias mod_setenv mod_usertrack mod_auth mod_status mod_accesslog"
 do_build="$do_build mod_rrdtool mod_secdownload mod_expire mod_compress mod_dirlisting mod_indexfile mod_userdir mod_webdav mod_staticfile mod_scgi mod_flv_streaming"
 
+plugins="mod_websocket(SPEC-${websocket_version_num})"
+if test ! "x$HAS_LIBICONV" = x; then
+   	do_build="$do_build $plugins"
+else
+	no_build="$no_build $plugins"
+fi
+
 plugins="mod_rewrite mod_redirect mod_ssi mod_trigger_b4_dl"
 features="regex-conditionals"
 if test ! "x$PCRE_LIB" = x; then
diff -ur lighttpd-1.4.26.orig/src/Makefile.am lighttpd-1.4.26/src/Makefile.am
--- lighttpd-1.4.26.orig/src/Makefile.am	2010-02-02 08:28:20.000000000 +0900
+++ lighttpd-1.4.26/src/Makefile.am	2010-06-08 18:28:10.000000000 +0900
@@ -95,6 +95,11 @@
 common_libadd =
 endif
 
+lib_LTLIBRARIES += mod_websocket.la
+mod_websocket_la_SOURCES = mod_websocket.c
+mod_websocket_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
+mod_websocket_la_LIBADD = $(common_libadd)
+
 lib_LTLIBRARIES += mod_flv_streaming.la
 mod_flv_streaming_la_SOURCES = mod_flv_streaming.c
 mod_flv_streaming_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
diff -ur lighttpd-1.4.26.orig/src/base.h lighttpd-1.4.26/src/base.h
--- lighttpd-1.4.26.orig/src/base.h	2010-02-02 08:28:20.000000000 +0900
+++ lighttpd-1.4.26/src/base.h	2010-06-08 18:27:51.000000000 +0900
@@ -331,7 +331,8 @@
 	CON_STATE_WRITE,
 	CON_STATE_RESPONSE_END,
