fi
#[, ACTION-IF-GIVEN[, ACTION-IF-NOT-GIVEN]])
-if test "x$with_apache_header" = "x"; then
- { { echo "$as_me:$LINENO: error:
-Please specify the --with-apache-header option.
-" >&5
-echo "$as_me: error:
-Please specify the --with-apache-header option.
-" >&2;}
- { (exit 1); exit 1; }; }
-fi
+
if test "x$with_apache_header" = "xyes"; then
{ { echo "$as_me:$LINENO: error:
Please specify the --with-apache-header option. And, please specify the place of the header file.
APU_CONFIG=$with_apu_config
fi
+if test "x$with_apache_header" = "x" ; then
+ with_apache_header=`${APXS} -q includedir`
-#AC_ARG_WITH(iconv, [ --with-iconv=ARG specify the place of the libiconv directory.])
-#AC_ARG_WITH(iconv_hook, [ --with-iconv_hook=ARG specify the place of the libiconv_hook directory.])
-#if test "x$with_iconv" = "x" -a "x$with_iconv_hook" = "x" ; then
-# AC_CHECK_LIB([iconv_hook], [iconv_open], [
-# with_iconv="ok"
-# AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv library file.])
-# LIBS="${LIBS} -liconv_hook"
-# ],[
-# AC_CHECK_LIB([iconv], [iconv_open], [
-# with_iconv="ok"
-# AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
-# LIBS="${LIBS} -liconv"
-# ], [
-# witn_iconv=""
-# ],[])
-# ],[])
-#fi
-#
-#if test "x$with_iconv" != "xok" ; then
-# if test "x$with_iconv" = "xyes" ; then
-# AC_MSG_ERROR([
-# Please specify the --with-iconv option. And, please specify the place of the libiconv program.
-# ])
-# fi
-# if test "x$with_iconv" != "x" ; then
-# LIBS="${LIBS} -L$with_iconv -liconv "
-# AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
-# fi
-#fi
-#if test "x$with_iconv" = "x" ; then
-# if test "x$with_iconv_hook" = "xyes" ; then
-# AC_MSG_ERROR([
-# Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program.
-# ])
-# fi
-# if test "x$with_iconv_hook" != "x" ; then
-# LIBS="${LIBS} -L${with_iconv_hook} -liconv_hook "
-# AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv_hook library file.])
-# fi
-# if test "x$with_iconv_hook" = "x" ; then
-# AC_MSG_ERROR([
-# Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program.
-# ])
-# fi
-#fi
-
+fi
case $host_os in
freebsd*)
CFLAGS="${CFLAGS} `${WAND_CONFIG} --cppflags` `${WAND_CONFIG} --cflags`"
CFLAGS="${CFLAGS} `${APR_CONFIG} --includes` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`"
CFLAGS="${CFLAGS} `${APU_CONFIG} --includes`"
-CPPFLAGS="${CPPFLAGS} `${APR_CONFIG} --includes` -I${with_apache_header}"
+CFLAGS="${CFLAGS} -I${with_apache_header}"
+CPPFLAGS="${CPPFLAGS} `${APR_CONFIG} --includes` "
+CPPFLAGS="${CPPFLAGS} -I${with_apache_header}"
AC_ARG_WITH(apache-header, [ --with-apache-header=ARG The directory with the header file of apache2.x is specified. ])
#[, ACTION-IF-GIVEN[, ACTION-IF-NOT-GIVEN]])
-if test "x$with_apache_header" = "x"; then
- AC_MSG_ERROR([
-Please specify the --with-apache-header option.
-])
-fi
+
if test "x$with_apache_header" = "xyes"; then
AC_MSG_ERROR([
Please specify the --with-apache-header option. And, please specify the place of the header file.
APU_CONFIG=$with_apu_config
fi
-
-#AC_ARG_WITH(iconv, [ --with-iconv=ARG specify the place of the libiconv directory.])
-#AC_ARG_WITH(iconv_hook, [ --with-iconv_hook=ARG specify the place of the libiconv_hook directory.])
-#if test "x$with_iconv" = "x" -a "x$with_iconv_hook" = "x" ; then
-# AC_CHECK_LIB([iconv_hook], [iconv_open], [
-# with_iconv="ok"
-# AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv library file.])
-# LIBS="${LIBS} -liconv_hook"
-# ],[
-# AC_CHECK_LIB([iconv], [iconv_open], [
-# with_iconv="ok"
-# AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
-# LIBS="${LIBS} -liconv"
-# ], [
-# witn_iconv=""
-# ],[])
-# ],[])
-#fi
-#
-#if test "x$with_iconv" != "xok" ; then
-# if test "x$with_iconv" = "xyes" ; then
-# AC_MSG_ERROR([
-# Please specify the --with-iconv option. And, please specify the place of the libiconv program.
-# ])
-# fi
-# if test "x$with_iconv" != "x" ; then
-# LIBS="${LIBS} -L$with_iconv -liconv "
-# AC_DEFINE([HAVE_LIBICONV], [], [Define to 1 if you have the iconv library file.])
-# fi
-#fi
-#if test "x$with_iconv" = "x" ; then
-# if test "x$with_iconv_hook" = "xyes" ; then
-# AC_MSG_ERROR([
-# Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program.
-# ])
-# fi
-# if test "x$with_iconv_hook" != "x" ; then
-# LIBS="${LIBS} -L${with_iconv_hook} -liconv_hook "
-# AC_DEFINE([HAVE_LIBICONV_HOOK], [], [Define to 1 if you have the iconv_hook library file.])
-# fi
-# if test "x$with_iconv_hook" = "x" ; then
-# AC_MSG_ERROR([
-# Please specify the --with-iconv-hook option. And, please specify the place of the libiconv_hook program.
-# ])
-# fi
-#fi
-
+if test "x$with_apache_header" = "x" ; then
+ with_apache_header=`${APXS} -q includedir`
+ AC_SUBST(with_apache_header)
+fi
case $host_os in
freebsd*)
CFLAGS="${CFLAGS} `${WAND_CONFIG} --cppflags` `${WAND_CONFIG} --cflags`"
CFLAGS="${CFLAGS} `${APR_CONFIG} --includes` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`"
CFLAGS="${CFLAGS} `${APU_CONFIG} --includes`"
-CPPFLAGS="${CPPFLAGS} `${APR_CONFIG} --includes` -I${with_apache_header}"
+CFLAGS="${CFLAGS} -I${with_apache_header}"
+CPPFLAGS="${CPPFLAGS} `${APR_CONFIG} --includes` "
+CPPFLAGS="${CPPFLAGS} -I${with_apache_header}"
AC_SUBST(with_apache_header)
AC_SUBST(CC)
AC_SUBST(QDEFS)
request_rec* r);
+/* micro second */
+#define CACHE_RECHECK_WAIT (200000)
+
+/* retry count of creating cache file */
+#define CACHE_RETRY_COUNT (5)
+
#endif
/*
* vim:ts=4 et
ap_log_rerror(APLOG_MARK,APLOG_ERR,0,(request_rec*)(rec),(format), ##args)
#define SERR(rec,format, args...) \
ap_log_error(APLOG_MARK,APLOG_ERR,0,(rec),(format), ##args)
+#define WRN(rec,format, args...) \
+ ap_log_rerror(APLOG_MARK,APLOG_WARNING,0,(rec),(format), ##args)
extern tag_handlers chxj_tag_handlers[];
extern tag_handler chtml10_handler[];
chxj_emoji.c
-libmod_chxj_la_CFLAGS = $(AM_CFLAGS) -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include -I@with_apache_header@
-AM_CFLAGS = @CFLAGS@ -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include -I@with_apache_header@
+libmod_chxj_la_CFLAGS = $(AM_CFLAGS) -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include
+AM_CFLAGS = @CFLAGS@ -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include
lib_LTLIBRARIES = libmod_chxj.la
chxj_cookie.c \
chxj_emoji.c
-libmod_chxj_la_CFLAGS = $(AM_CFLAGS) -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include -I@with_apache_header@
-AM_CFLAGS = @CFLAGS@ -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include -I@with_apache_header@
+libmod_chxj_la_CFLAGS = $(AM_CFLAGS) -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include
+AM_CFLAGS = @CFLAGS@ -O2 -prefer-pic @QDEFS@ @DDEFS@ -I. -I../include
lib_LTLIBRARIES = libmod_chxj.la
all: all-am
#include "chxj_apply_convrule.h"
#include "chxj_url_encode.h"
-#if 0
-#if defined(HAVE_LIBICONV_HOOK)
-# include "iconv_hook/iconv.h"
-#else
-# if defined(HAVE_LIBICONV)
-# include "iconv.h"
-# else
-# error "Please install libiconv or libiconv_hook. and Please set LD_LIBRARY_PATH."
-# endif
-#endif
-#endif
-
#include <iconv.h>
static char *
apr_finfo_t st;
apr_finfo_t cache_st;
char *tmpfile;
+ int try_count;
if (spec->html_spec_type == CHXJ_SPEC_UNKNOWN) {
/*
if (rv != APR_SUCCESS)
return HTTP_NOT_FOUND;
+ try_count = CACHE_RETRY_COUNT;
+ do {
+ rv = apr_stat(&cache_st, tmpfile, APR_FINFO_MIN, r->pool);
- DBG(r,"found [%s]", r->filename);
- rv = apr_stat(&cache_st, tmpfile, APR_FINFO_MIN, r->pool);
- DBG(r,"found [%s]", r->filename);
-
- if (rv != APR_SUCCESS || cache_st.ctime < st.mtime) {
- /*------------------------------------------------------------------------*/
- /* It tries to make the cash file when it doesn't exist or there is */
- /* change time later since the making time of the cash file. */
- /*------------------------------------------------------------------------*/
- rv = s_create_cache_file(r,tmpfile, spec, &st, qsp, conf);
- if (rv != OK)
- return rv;
- }
+ if (rv != APR_SUCCESS || cache_st.ctime < st.mtime) {
+ /*------------------------------------------------------------------------*/
+ /* It tries to make the cash file when it doesn't exist or there is */
+ /* change time later since the making time of the cash file. */
+ /*------------------------------------------------------------------------*/
+ rv = s_create_cache_file(r,tmpfile, spec, &st, qsp, conf);
+ if (rv != OK)
+ return rv;
+ }
- DBG(r,"color=[%d]", spec->color);
- if (! r->header_only) {
- rv = s_send_cache_file(spec, qsp,r, tmpfile);
- if (rv != OK)
- return rv;
- }
- else {
- rv = s_header_only_cache_file(spec, qsp, r, tmpfile);
- if (rv != OK)
- return rv;
+ DBG(r,"color=[%d]", spec->color);
+ if (! r->header_only) {
+ rv = s_send_cache_file(spec, qsp,r, tmpfile);
+ }
+ else {
+ rv = s_header_only_cache_file(spec, qsp, r, tmpfile);
+ }
+ if (rv == OK) break;
+ if (rv == HTTP_NOT_FOUND) {
+ DBG(r, "recheck wait... try_count[%d]", try_count);
+ apr_sleep(CACHE_RECHECK_WAIT);
+ }
+ } while (try_count--);
+ if (try_count <= 0) {
+ WRN(r, "cache retry failure....");
+ WRN(r, "cache file was deleted...");
}
apr_table_setn(r->headers_in, "CHXJ_IMG_CONV", "done");
DBG(r,"end chxj_img_conv_format");
- return OK;
+ return rv;
}
{
Node *child;
char *rtn;
+ int has_ezweb2imode_tag = 0;
+ int has_softbank2imode_tag = 0;
for (child = qs_get_child_node(doc,node);
child;
if ((rtn = s_load_ezweb2imode_tag(doc, p, conf, child))) {
return rtn;
}
+ has_ezweb2imode_tag = 1;
}
else if (STRCASEEQ('s','S',"softbank2imode", name)) {
if ((rtn = s_load_softbank2imode_tag(doc, p, conf, child))) {
return rtn;
}
+ has_softbank2imode_tag = 1;
}
}
+ if (!has_ezweb2imode_tag || !has_softbank2imode_tag) {
+ return apr_pstrdup(p,"``emoji.xml'' is too old(not 0.9.0 nor later). Please setup emoji.xml for a new definition(0.9.0 or later). ");
+ }
return NULL;
}
#include "mod_chxj.h"
-#if 0
-#if defined(HAVE_LIBICONV_HOOK)
-# include "iconv_hook/iconv.h"
-#else
-# if defined(HAVE_LIBICONV)
-# include "iconv.h"
-# else
-# error "Please install libiconv or libiconv_hook. and Please set LD_LIBRARY_PATH."
-# endif
-#endif
-#endif
-
#include <iconv.h>
static int s_cut_tag (const char *s, int len);