You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ig...@apache.org on 2013/02/25 19:12:36 UTC

git commit: TS-1723 remove (lib)iconv dependency

Updated Branches:
  refs/heads/master bc0526922 -> 8cbc7c87e


TS-1723 remove (lib)iconv dependency

We don't need it anymore, for one, and for the other it might help
us finally fix the Solaris 10 build


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8cbc7c87
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8cbc7c87
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8cbc7c87

Branch: refs/heads/master
Commit: 8cbc7c87e5f44d47f7a96b27bbae5456f008e3f5
Parents: bc05269
Author: Igor Galić <i....@brainsware.org>
Authored: Mon Feb 25 10:09:13 2013 -0800
Committer: Igor Galić <i....@brainsware.org>
Committed: Mon Feb 25 10:09:13 2013 -0800

----------------------------------------------------------------------
 configure.ac         |    3 --
 lib/ts/ink_string.cc |   57 ---------------------------------------------
 2 files changed, 0 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8cbc7c87/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 770ff4a..69f2bed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -926,9 +926,6 @@ AC_CHECK_LIB([resolv],[__putlong],[AC_SUBST([LIBRESOLV],["-lresolv"])])
 AC_CHECK_LIB([pthread],[pthread_exit],[AC_SUBST([LIBTHREAD],["-lpthread"])])
 AC_CHECK_LIB([rt],[clock_gettime],[AC_SUBST([LIBRT],["-lrt"])])
 AC_CHECK_LIB([posix4],[clock_gettime],[AC_SUBST([LIBRT],["-lposix4"])])
-AC_CHECK_LIB([c],[iconv_open],[AC_SUBST([LIBICONV],["-lc"])])
-AC_CHECK_LIB([iconv],[iconv_open],[AC_SUBST([LIBICONV],["-liconv"])])
-AC_CHECK_LIB([iconv],[libiconv_open],[AC_SUBST([LIBICONV],["-liconv"])])
 
 #
 # The header_rewrite module depends on boost.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8cbc7c87/lib/ts/ink_string.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_string.cc b/lib/ts/ink_string.cc
index 0ae3075..0d45fad 100644
--- a/lib/ts/ink_string.cc
+++ b/lib/ts/ink_string.cc
@@ -309,60 +309,3 @@ ink_strtok_r(char *s1, const char *s2, char **lasts)
   return strtok_r(s1, s2, lasts);
 }
 
-// XXX/lomew this might not be portable.  If not check in configure
-//   and always squash if no iconv available.
-#include <iconv.h>
-
-/*
- * This is a front-end to iconv(3).
- *
- * latin-1 is a subset of utf-8 so the output string len you pass
- * can be the same as the input string len.
- */
-void
-ink_utf8_to_latin1(const char *in, int inlen, char *out, int *outlen)
-{
-  size_t inbytesleft, outbytesleft;
-  iconv_t ic;
-
-  // XXX/lomew should have a configure test for the first arg
-  ic = iconv_open("8859-1", "UTF-8");   // solaris
-  if (ic == (iconv_t) - 1) {
-    ic = iconv_open("iso-8859-1", "UTF-8");     // linux
-    if (ic == (iconv_t) - 1) {
-      goto strip;
-    }
-  }
-
-  inbytesleft = inlen;
-  outbytesleft = *outlen;
-#if !defined(kfreebsd) && (defined(freebsd) || (!defined(__GNUC__) && defined(solaris)))
-  if (iconv(ic, &in, &inbytesleft, &out, &outbytesleft) == (size_t) - 1)
-#else
-  if (iconv(ic, (char **) &in, &inbytesleft, &out, &outbytesleft) == (size_t) - 1)
-#endif
-    {
-      iconv_close(ic);
-      goto strip;
-    }
-
-  *outlen -= outbytesleft;
-  iconv_close(ic);
-  return;
-
-strip:
-
-  /* Strip out chars with the high bit set.
-     This only happens if iconv can't convert. */
-  inbytesleft = inlen;
-  outbytesleft = *outlen;
-  while (inbytesleft && outbytesleft) {
-    if (!(*in & 0x80)) {
-      *out++ = *in;
-      outbytesleft--;
-    }
-    in++;
-    inbytesleft--;
-  }
-  *outlen -= outbytesleft;
-}