Skip to content

Commit

Permalink
2008-08-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Browse files Browse the repository at this point in the history
	Added firefox3 cookie support based on the patch submitted by
	tizianomueller.
	firefox3 cookie is SQLite3 database. libsqlite3 is required to 
enable
	this functionality.
	* configure.ac
	* m4/sqlite3.m4
	* src/CookieBoxFactory.cc
	* src/CookieBoxFactory.h
	* src/Makefile.am
	* src/Makefile.in
	* src/Sqlite3MozCookieParser.cc
	* src/Sqlite3MozCookieParser.h
	* src/main.cc
	* test/CookieBoxFactoryTest.cc
	* test/Makefile.am
	* test/Makefile.in
	* test/Sqlite3MozCookieParserTest.cc
	* test/badcookies.sqlite
	* test/cookies.sqlite
  • Loading branch information
tatsuhiro-t committed Aug 17, 2008
1 parent 72d2188 commit 0cac0da
Show file tree
Hide file tree
Showing 23 changed files with 657 additions and 103 deletions.
22 changes: 22 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
2008-08-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Added firefox3 cookie support based on the patch submitted by
tizianomueller.
firefox3 cookie is SQLite3 database. libsqlite3 is required to enable
this functionality.
* configure.ac
* m4/sqlite3.m4
* src/CookieBoxFactory.cc
* src/CookieBoxFactory.h
* src/Makefile.am
* src/Makefile.in
* src/Sqlite3MozCookieParser.cc
* src/Sqlite3MozCookieParser.h
* src/main.cc
* test/CookieBoxFactoryTest.cc
* test/Makefile.am
* test/Makefile.in
* test/Sqlite3MozCookieParserTest.cc
* test/badcookies.sqlite
* test/cookies.sqlite

2008-08-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Added Danish and Greek translations.
Expand Down
11 changes: 7 additions & 4 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aria2_arg.m4 \
$(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/printf-posix.m4 $(top_srcdir)/m4/progtest.m4 \
$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/visibility.m4 \
$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
$(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac
$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sqlite3.m4 \
$(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/uintmax_t.m4 \
$(top_srcdir)/m4/visibility.m4 $(top_srcdir)/m4/wchar_t.m4 \
$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
Expand Down Expand Up @@ -204,6 +205,8 @@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SQLITE3_CPPFLAGS = @SQLITE3_CPPFLAGS@
SQLITE3_LIBS = @SQLITE3_LIBS@
STRIP = @STRIP@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
Expand Down
1 change: 1 addition & 0 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,7 @@ m4_include([m4/po.m4])
m4_include([m4/printf-posix.m4])
m4_include([m4/progtest.m4])
m4_include([m4/size_max.m4])
m4_include([m4/sqlite3.m4])
m4_include([m4/stdint_h.m4])
m4_include([m4/uintmax_t.m4])
m4_include([m4/visibility.m4])
Expand Down
3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET

/* Define to 1 if you have sqlite3. */
#undef HAVE_SQLITE3

/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
Expand Down
153 changes: 148 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,8 @@ XML_CPPFLAGS
XML_LIBS
LIBEXPAT_LIBS
LIBEXPAT_CPPFLAGS
SQLITE3_LIBS
SQLITE3_CPPFLAGS
LIBGNUTLS_CONFIG
LIBGNUTLS_CFLAGS
LIBGNUTLS_LIBS
Expand Down Expand Up @@ -754,6 +756,8 @@ ENABLE_ASYNC_DNS_TRUE
ENABLE_ASYNC_DNS_FALSE
HAVE_LIBZ_TRUE
HAVE_LIBZ_FALSE
HAVE_SQLITE3_TRUE
HAVE_SQLITE3_FALSE
ALLOCA
USE_NLS
GETTEXT_MACRO_VERSION
Expand Down Expand Up @@ -1436,6 +1440,7 @@ Optional Packages:
--with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)
--with-gnutls use gnutls if it is installed.
--with-openssl use openssl if it is installed.
--with-sqlite3 use sqlite3 if it is installed.
--with-libxml2 use libxml2 if it is installed.
--with-libexpat use libexpat if it is installed.
--with-libares use libares if it is installed.
Expand All @@ -1444,6 +1449,7 @@ Optional Packages:
--with-xml-prefix=PFX Prefix where libxml is installed (optional)
--with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)
--with-libexpat-prefix=PREFIX Prefix where libexpat installed (optional)
--with-sqlite3-prefix=PREFIX Prefix where SQLite3 installed (optional)
--with-libgnutls-prefix=PFX Prefix where libgnutls is installed (optional)
--with-libgcrypt-prefix=PFX
prefix where LIBGCRYPT is installed (optional)
Expand Down Expand Up @@ -2703,6 +2709,15 @@ fi



# Check whether --with-sqlite3 was given.
if test "${with_sqlite3+set}" = set; then
withval=$with_sqlite3; with_sqlite3=$withval
else
with_sqlite3=yes
fi



# Check whether --with-libxml2 was given.
if test "${with_libxml2+set}" = set; then
withval=$with_libxml2; with_libxml2=$withval
Expand Down Expand Up @@ -5936,6 +5951,112 @@ LIBS=$LIBS_save
CPPFLAGS=$CPPFLAGS_save


fi

if test "x$with_sqlite3" = "xyes"; then


# Check whether --with-sqlite3-prefix was given.
if test "${with_sqlite3_prefix+set}" = set; then
withval=$with_sqlite3_prefix; sqlite3_prefix=$withval
else
sqlite3_prefix=""
fi

if test "x$sqlite3_prefix" = "x"; then
sqlite3_prefix="/usr"
fi

sqlite3_prefix_lib=$sqlite3_prefix/lib
sqlite3_prefix_include=$sqlite3_prefix/include

LIBS_save=$LIBS
CPPFLAGS_save=$CPPFLAGS

LIBS="-L$sqlite3_prefix_lib $LIBS"
CPPFLAGS="-I$sqlite3_prefix_include $CPPFLAGS"

{ echo "$as_me:$LINENO: checking for sqlite3_open in -lsqlite3" >&5
echo $ECHO_N "checking for sqlite3_open in -lsqlite3... $ECHO_C" >&6; }
if test "${ac_cv_lib_sqlite3_sqlite3_open+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsqlite3 $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */

/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char sqlite3_open ();
int
main ()
{
return sqlite3_open ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_sqlite3_sqlite3_open=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_sqlite3_sqlite3_open=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5
echo "${ECHO_T}$ac_cv_lib_sqlite3_sqlite3_open" >&6; }
if test $ac_cv_lib_sqlite3_sqlite3_open = yes; then
have_sqlite3=yes
fi

if test "x$have_sqlite3" = "xyes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_SQLITE3 1
_ACEOF

SQLITE3_LIBS="-L$sqlite3_prefix_lib -lsqlite3"
SQLITE3_CPPFLAGS="-I$sqlite3_prefix_include"


fi

LIBS=$LIBS_save
CPPFLAGS=$CPPFLAGS_save


fi

if test "x$with_gnutls" = "xyes"; then
Expand Down Expand Up @@ -7255,6 +7376,16 @@ else
fi


# Set conditional for sqlite3
if test "x$have_sqlite3" = "xyes"; then
HAVE_SQLITE3_TRUE=
HAVE_SQLITE3_FALSE='#'
else
HAVE_SQLITE3_TRUE='#'
HAVE_SQLITE3_FALSE=
fi


# Checks for header files.
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
Expand Down Expand Up @@ -21757,6 +21888,13 @@ echo "$as_me: error: conditional \"HAVE_LIBZ\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
if test -z "${HAVE_SQLITE3_TRUE}" && test -z "${HAVE_SQLITE3_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"HAVE_SQLITE3\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
echo "$as_me: error: conditional \"HAVE_SQLITE3\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
if test -z "${HAVE_ASCTIME_R_TRUE}" && test -z "${HAVE_ASCTIME_R_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"HAVE_ASCTIME_R\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
Expand Down Expand Up @@ -22593,6 +22731,8 @@ XML_CPPFLAGS!$XML_CPPFLAGS$ac_delim
XML_LIBS!$XML_LIBS$ac_delim
LIBEXPAT_LIBS!$LIBEXPAT_LIBS$ac_delim
LIBEXPAT_CPPFLAGS!$LIBEXPAT_CPPFLAGS$ac_delim
SQLITE3_LIBS!$SQLITE3_LIBS$ac_delim
SQLITE3_CPPFLAGS!$SQLITE3_CPPFLAGS$ac_delim
LIBGNUTLS_CONFIG!$LIBGNUTLS_CONFIG$ac_delim
LIBGNUTLS_CFLAGS!$LIBGNUTLS_CFLAGS$ac_delim
LIBGNUTLS_LIBS!$LIBGNUTLS_LIBS$ac_delim
Expand Down Expand Up @@ -22621,6 +22761,8 @@ ENABLE_ASYNC_DNS_TRUE!$ENABLE_ASYNC_DNS_TRUE$ac_delim
ENABLE_ASYNC_DNS_FALSE!$ENABLE_ASYNC_DNS_FALSE$ac_delim
HAVE_LIBZ_TRUE!$HAVE_LIBZ_TRUE$ac_delim
HAVE_LIBZ_FALSE!$HAVE_LIBZ_FALSE$ac_delim
HAVE_SQLITE3_TRUE!$HAVE_SQLITE3_TRUE$ac_delim
HAVE_SQLITE3_FALSE!$HAVE_SQLITE3_FALSE$ac_delim
ALLOCA!$ALLOCA$ac_delim
USE_NLS!$USE_NLS$ac_delim
GETTEXT_MACRO_VERSION!$GETTEXT_MACRO_VERSION$ac_delim
Expand Down Expand Up @@ -22675,10 +22817,6 @@ HAVE_BASENAME_TRUE!$HAVE_BASENAME_TRUE$ac_delim
HAVE_BASENAME_FALSE!$HAVE_BASENAME_FALSE$ac_delim
HAVE_GAI_STRERROR_TRUE!$HAVE_GAI_STRERROR_TRUE$ac_delim
HAVE_GAI_STRERROR_FALSE!$HAVE_GAI_STRERROR_FALSE$ac_delim
HAVE_GETADDRINFO_TRUE!$HAVE_GETADDRINFO_TRUE$ac_delim
HAVE_GETADDRINFO_FALSE!$HAVE_GETADDRINFO_FALSE$ac_delim
HAVE_GETTIMEOFDAY_TRUE!$HAVE_GETTIMEOFDAY_TRUE$ac_delim
HAVE_GETTIMEOFDAY_FALSE!$HAVE_GETTIMEOFDAY_FALSE$ac_delim
_ACEOF

if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
Expand Down Expand Up @@ -22720,6 +22858,10 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
HAVE_GETADDRINFO_TRUE!$HAVE_GETADDRINFO_TRUE$ac_delim
HAVE_GETADDRINFO_FALSE!$HAVE_GETADDRINFO_FALSE$ac_delim
HAVE_GETTIMEOFDAY_TRUE!$HAVE_GETTIMEOFDAY_TRUE$ac_delim
HAVE_GETTIMEOFDAY_FALSE!$HAVE_GETTIMEOFDAY_FALSE$ac_delim
HAVE_INET_ATON_TRUE!$HAVE_INET_ATON_TRUE$ac_delim
HAVE_INET_ATON_FALSE!$HAVE_INET_ATON_FALSE$ac_delim
HAVE_LOCALTIME_R_TRUE!$HAVE_LOCALTIME_R_TRUE$ac_delim
Expand All @@ -22731,7 +22873,7 @@ HAVE_TIMEGM_FALSE!$HAVE_TIMEGM_FALSE$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF

if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 9; then
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 13; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
Expand Down Expand Up @@ -23452,6 +23594,7 @@ echo "CFLAGS: $CFLAGS"
echo "CPPFLAGS: $CPPFLAGS"
echo "LDFLAGS: $LDFLAGS"
echo "LIBS: $LIBS"
echo "SQLite3: $have_sqlite3"
echo "GnuTLS: $have_libgnutls"
echo "OpenSSL: $have_openssl"
echo "LibXML2: $have_libxml2"
Expand Down
9 changes: 9 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ AC_SUBST(localedir)
# Checks for arguments.
ARIA2_ARG_WITH([gnutls])
ARIA2_ARG_WITH([openssl])
ARIA2_ARG_WITH([sqlite3])
ARIA2_ARG_WITH([libxml2])
ARIA2_ARG_WITH([libexpat])
ARIA2_ARG_WITH([libares])
Expand Down Expand Up @@ -65,6 +66,10 @@ if test "x$with_libexpat" = "xyes" && test "x$have_libxml2" != "xyes"; then
AM_PATH_LIBEXPAT
fi

if test "x$with_sqlite3" = "xyes"; then
AM_PATH_SQLITE3
fi

if test "x$with_gnutls" = "xyes"; then
AM_PATH_LIBGNUTLS([1.2.9], [have_libgnutls=yes])
if test "x$have_libgnutls" = "xyes"; then
Expand Down Expand Up @@ -148,6 +153,9 @@ fi
# Set conditional for libz
AM_CONDITIONAL([HAVE_LIBZ], [test "x$have_libz" = "xyes"])

# Set conditional for sqlite3
AM_CONDITIONAL([HAVE_SQLITE3], [test "x$have_sqlite3" = "xyes"])

# Checks for header files.
AC_FUNC_ALLOCA
AC_HEADER_STDC
Expand Down Expand Up @@ -325,6 +333,7 @@ echo "CFLAGS: $CFLAGS"
echo "CPPFLAGS: $CPPFLAGS"
echo "LDFLAGS: $LDFLAGS"
echo "LIBS: $LIBS"
echo "SQLite3: $have_sqlite3"
echo "GnuTLS: $have_libgnutls"
echo "OpenSSL: $have_openssl"
echo "LibXML2: $have_libxml2"
Expand Down
11 changes: 7 additions & 4 deletions doc/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aria2_arg.m4 \
$(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/printf-posix.m4 $(top_srcdir)/m4/progtest.m4 \
$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/visibility.m4 \
$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
$(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac
$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sqlite3.m4 \
$(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/uintmax_t.m4 \
$(top_srcdir)/m4/visibility.m4 $(top_srcdir)/m4/wchar_t.m4 \
$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
Expand Down Expand Up @@ -178,6 +179,8 @@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SQLITE3_CPPFLAGS = @SQLITE3_CPPFLAGS@
SQLITE3_LIBS = @SQLITE3_LIBS@
STRIP = @STRIP@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
Expand Down
Loading

0 comments on commit 0cac0da

Please sign in to comment.