RFC: make IcedTea-web to be compatible with RHEL5 libraries
Jiri Vanek
jvanek at redhat.com
Wed May 18 04:56:54 PDT 2011
On 05/18/2011 12:48 PM, Pavel Tisnovsky wrote:
> Hi all,
>
> I've found that IcedTea-web can not be build on RHEL5 because this
> system has older glibc libraries (2.5-*) and some code in
> IcedTeaNPPlugin.cc depends on newer functions.
>
> I've tried to rewrite this class not to use these functions. Can anybody
> please look at these changes? They are stored in an attachments as patch
> file.
>
> Any comments are welcome!
>
> Cheers,
> Pavel
>
My knowledge of C languages is not your match, but Those changes gives sense to me.
>
> hg_diff
>
>
> diff -r f1615c79971d plugin/icedteanp/IcedTeaNPPlugin.cc
> --- a/plugin/icedteanp/IcedTeaNPPlugin.cc Tue May 17 16:43:45 2011 +0200
> +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Wed May 18 12:36:44 2011 +0200
> @@ -46,6 +46,7 @@
> #include<sys/stat.h>
> #include<sys/types.h>
> #include<unistd.h>
> +#include<glib.h>
I wonder how it was buildable without it.
>
> // Liveconnect extension
> #include "IcedTeaScriptablePluginObject.h"
> @@ -863,6 +864,14 @@
> PLUGIN_DEBUG ("ITNP_URLNotify return\n");
> }
>
> +// Returns key from first item stored in hashtable
> +gboolean
> +find_first_item_in_hash_table(gpointer key, gpointer value, gpointer user_data)
> +{
> + user_data = key;
> + return (gboolean)TRUE;
> +}
> +
> NPError
> get_cookie_info(const char* siteAddr, char** cookieString, uint32_t* len)
> {
> @@ -909,11 +918,13 @@
>
> if (browser_functions.getvalueforurl)
> {
> - GHashTableIter iter;
> + //GHashTableIter iter;
> gpointer id, instance;
>
> - g_hash_table_iter_init (&iter, instance_to_id_map);
> - g_hash_table_iter_next (&iter,&instance,&id);
> + g_hash_table_find(instance_to_id_map, (GHRFunc)find_first_item_in_hash_table,&instance);
> +
As previous implemetation just returned first found value, then semas ok. But - how will this behave when nothing found?
> + //g_hash_table_iter_init (&iter, instance_to_id_map);
> + //g_hash_table_iter_next (&iter,&instance,&id);
>
> return browser_functions.getvalueforurl((NPP) instance, NPNURLVCookie, siteAddr, cookieString, len);
> } else
> @@ -1380,11 +1391,13 @@
> {
>
> // As in get_cookie_info, we use the first active instance
> - GHashTableIter iter;
> + //GHashTableIter iter;
> gpointer id, instance;
>
> - g_hash_table_iter_init (&iter, instance_to_id_map);
> - g_hash_table_iter_next (&iter,&instance,&id);
same as above
> + //g_hash_table_iter_init (&iter, instance_to_id_map);
> + //g_hash_table_iter_next (&iter,&instance,&id);
> +
> + g_hash_table_find(instance_to_id_map, (GHRFunc)find_first_item_in_hash_table,&instance);
>
> browser_functions.getvalueforurl((NPP) instance, NPNURLVProxy, siteAddr, proxy, len);
> } else
> @@ -1416,6 +1429,15 @@
> return FALSE;
> }
>
> +int
> +strcmp0(char *str1, char *str2)
> +{
> + if (str1 != NULL)
> + return str2 != NULL ? strcmp(str1, str2) : 1;
> + else // str1 == NULL
> + return str2 != NULL ? 1 : 0;
> +}
> +
> // remove all components from LD_LIBRARY_PATH, which start with
> // MOZILLA_FIVE_HOME; firefox has its own NSS based security provider,
> // which conflicts with the one configured in nss.cfg.
> @@ -1437,7 +1459,7 @@
> components = g_strsplit (path_old, ":", -1);
> for (i1 = 0, i2 = 0; components[i1] != NULL; i1++)
> {
> - if (g_strcmp0 (components[i1], moz_home) == 0
> + if (strcmp0 (components[i1], moz_home) == 0
> || g_str_has_prefix (components[i1], moz_home))
> components[i2] = components[i1];
> else
More information about the distro-pkg-dev
mailing list