+Fri Feb 1 22:33:11 EET 2002 Pekka Riikonen <priikone@silcnet.org>
+
+ * Fixed a bug in hash table internal routine for traversing
+ the table with foreach callback. The current entry may
+ become invalid in the callback but it was referenced after
+ the callback returned.
+
+ Do not allow auto rehashing of hash table during the
+ silc_hash_table_foreach operation, for same reasons as it is
+ not allowed for SilcHashTableList. Affected files are
+ lib/silcutil/silchashtable.[ch].
+
Fri Feb 1 14:55:00 CET 2002 Pekka Riikonen <priikone@silcnet.org>
* Defined DLLAPI into silcincludes.h and silcwin32.h for
--- /dev/null
+/* XPM */
+static char * folder_xpm[] = {
+"48 48 352 2",
+" c None",
+". c #101110",
+"+ c #000000",
+"@ c #1D1F1C",
+"# c #D3D9D2",
+"$ c #E7E8E7",
+"% c #0D0E0D",
+"& c #202320",
+"* c #ABB9AA",
+"= c #C5CFC4",
+"- c #F4F5F4",
+"; c #BABABA",
+"> c #080908",
+", c #010101",
+"' c #212421",
+") c #B1BEAF",
+"! c #DEE3DE",
+"~ c #F8F9F8",
+"{ c #7F7B80",
+"] c #272B27",
+"^ c #060706",
+"/ c #FAFAFA",
+"( c #B3B3B3",
+"_ c #2B2E2B",
+": c #B9C4B7",
+"< c #E9ECE9",
+"[ c #C2C8C1",
+"} c #1D201D",
+"| c #E0E5E0",
+"1 c #E7E8E8",
+"2 c #FFFFFF",
+"3 c #FEFEFE",
+"4 c #DADADA",
+"5 c #4F554E",
+"6 c #9AA798",
+"7 c #AAB8A9",
+"8 c #4D5B4C",
+"9 c #353B34",
+"0 c #E9EBE9",
+"a c #FDFDFD",
+"b c #F6F6F6",
+"c c #252625",
+"d c #3D423D",
+"e c #7D877C",
+"f c #99A598",
+"g c #576655",
+"h c #2D332C",
+"i c #A8B6A7",
+"j c #ADBAAC",
+"k c #E7EBE6",
+"l c #F9FAF9",
+"m c #535653",
+"n c #1A1C19",
+"o c #575F56",
+"p c #818B80",
+"q c #A3B0A1",
+"r c #697867",
+"s c #D1D7D0",
+"t c #383A37",
+"u c #5B635A",
+"v c #C9D2C8",
+"w c #201E20",
+"x c #FBFBFB",
+"y c #FCFDFC",
+"z c #BABDBA",
+"A c #050605",
+"B c #3B3F3A",
+"C c #757F74",
+"D c #A0AE9F",
+"E c #C3CDC2",
+"F c #E7EAE7",
+"G c #AFAFAF",
+"H c #343833",
+"I c #B0BDAF",
+"J c #F7F8F7",
+"K c #B4B4B4",
+"L c #0A0B0A",
+"M c #C4C5C4",
+"N c #FCFCFC",
+"O c #5E615E",
+"P c #0E0F0E",
+"Q c #525851",
+"R c #909C8F",
+"S c #F0F2EF",
+"T c #5C5B5C",
+"U c #1D1F1D",
+"V c #D1D7D1",
+"W c #FDFDFC",
+"X c #F5F5F6",
+"Y c #464546",
+"Z c #474747",
+"` c #B2B6B1",
+" . c #242724",
+".. c #262926",
+"+. c #757E73",
+"@. c #A4B1A2",
+"#. c #BEC8BD",
+"$. c #ECEFEC",
+"%. c #0F100F",
+"&. c #1C1D1B",
+"*. c #869285",
+"=. c #ECEEEC",
+"-. c #BBB5BC",
+";. c #212221",
+">. c #ACACAC",
+",. c #F2F3F2",
+"'. c #8B8F8A",
+"). c #000100",
+"!. c #434942",
+"~. c #95A194",
+"{. c #AEBBAC",
+"]. c #D4DAD3",
+"^. c #868586",
+"/. c #030403",
+"(. c #080907",
+"_. c #4F554F",
+":. c #C8D1C8",
+"<. c #F7F7F7",
+"[. c #E4E5E4",
+"}. c #454645",
+"|. c #3C3E3B",
+"1. c #F5F5F5",
+"2. c #BDC1BC",
+"3. c #252825",
+"4. c #232623",
+"5. c #717A6F",
+"6. c #B2BEB1",
+"7. c #DCE2DB",
+"8. c #CED1CE",
+"9. c #121312",
+"0. c #262825",
+"a. c #B3C0B2",
+"b. c #EBEDEB",
+"c. c #777877",
+"d. c #2F302F",
+"e. c #ACAEAB",
+"f. c #666A65",
+"g. c #4C524B",
+"h. c #9CA99A",
+"i. c #C7D0C5",
+"j. c #D4D8D3",
+"k. c #585A57",
+"l. c #181A18",
+"m. c #ADBBAC",
+"n. c #D3DAD2",
+"o. c #F3F4F3",
+"p. c #C4C3C4",
+"q. c #505050",
+"r. c #757875",
+"s. c #E6E6E6",
+"t. c #F9F9F9",
+"u. c #FBFCFB",
+"v. c #ABB1AA",
+"w. c #161716",
+"x. c #454B44",
+"y. c #A9B6A7",
+"z. c #B7C3B6",
+"A. c #141514",
+"B. c #131513",
+"C. c #B6C1B5",
+"D. c #E3E7E2",
+"E. c #E0E1E0",
+"F. c #767676",
+"G. c #595959",
+"H. c #A9ACA9",
+"I. c #DFE3DF",
+"J. c #5D615C",
+"K. c #9EAB9C",
+"L. c #BCC4BB",
+"M. c #545E53",
+"N. c #0B0C0B",
+"O. c #141614",
+"P. c #A6B3A6",
+"Q. c #B3BFB2",
+"R. c #CCD4CB",
+"S. c #E6E9E6",
+"T. c #A4A4A4",
+"U. c #5D5C5D",
+"V. c #5A5D5A",
+"W. c #DEDEDE",
+"X. c #0C0D0C",
+"Y. c #7A8479",
+"Z. c #747D72",
+"`. c #8E998C",
+" + c #8A9988",
+".+ c #364035",
+"++ c #191B18",
+"@+ c #030303",
+"#+ c #7E887D",
+"$+ c #B2BFB1",
+"%+ c #C6CFC5",
+"&+ c #D9E0D9",
+"*+ c #E0E0E0",
+"=+ c #747474",
+"-+ c #282B28",
+";+ c #B6B6B6",
+">+ c #E3E3E3",
+",+ c #CACBCA",
+"'+ c #646C63",
+")+ c #676F66",
+"!+ c #697168",
+"~+ c #9DAA9B",
+"{+ c #728170",
+"]+ c #1C221B",
+"^+ c #090A09",
+"/+ c #4F564E",
+"(+ c #BDC7BC",
+"_+ c #C6D0C6",
+":+ c #D6DCD5",
+"<+ c #464F44",
+"[+ c #404540",
+"}+ c #999999",
+"|+ c #BEBEBE",
+"1+ c #BCBCBC",
+"2+ c #566554",
+"3+ c #121611",
+"4+ c #1C1E1C",
+"5+ c #A8B5A7",
+"6+ c #4C5B4A",
+"7+ c #BFBFBF",
+"8+ c #757675",
+"9+ c #040504",
+"0+ c #374635",
+"a+ c #151914",
+"b+ c #0A0B09",
+"c+ c #869184",
+"d+ c #526150",
+"e+ c #868686",
+"f+ c #C0C0C0",
+"g+ c #5E5E5E",
+"h+ c #7B857A",
+"i+ c #93A291",
+"j+ c #263025",
+"k+ c #191C19",
+"l+ c #202520",
+"m+ c #7B8679",
+"n+ c #677764",
+"o+ c #151815",
+"p+ c #6C6C6C",
+"q+ c #C2C2C2",
+"r+ c #585858",
+"s+ c #929D90",
+"t+ c #6A7968",
+"u+ c #1D231C",
+"v+ c #141714",
+"w+ c #2B332A",
+"x+ c #798578",
+"y+ c #6C7C69",
+"z+ c #454545",
+"A+ c #4A4A4A",
+"B+ c #A6B3A4",
+"C+ c #3E4D3C",
+"D+ c #181D18",
+"E+ c #313B30",
+"F+ c #6D7A6B",
+"G+ c #72826F",
+"H+ c #313930",
+"I+ c #242524",
+"J+ c #292C29",
+"K+ c #717970",
+"L+ c #394637",
+"M+ c #121512",
+"N+ c #212621",
+"O+ c #545F52",
+"P+ c #A6B5A4",
+"Q+ c #748372",
+"R+ c #374235",
+"S+ c #1C1D1C",
+"T+ c #969696",
+"U+ c #161616",
+"V+ c #474D46",
+"W+ c #758473",
+"X+ c #2B352A",
+"Y+ c #242A23",
+"Z+ c #455043",
+"`+ c #9DAC9B",
+" @ c #3B4639",
+".@ c #272827",
+"+@ c #7B7B7B",
+"@@ c #111111",
+"#@ c #596158",
+"$@ c #4A5948",
+"%@ c #131613",
+"&@ c #859483",
+"*@ c #808F7E",
+"=@ c #1F211E",
+"-@ c #7D7D7D",
+";@ c #080808",
+">@ c #666E65",
+",@ c #798677",
+"'@ c #2D392C",
+")@ c #333D32",
+"!@ c #869584",
+"~@ c #394437",
+"{@ c #2D312C",
+"]@ c #687067",
+"^@ c #5D6C5B",
+"/@ c #181E17",
+"(@ c #2C342B",
+"_@ c #566653",
+":@ c #899887",
+"<@ c #8C9B8A",
+"[@ c #404D3E",
+"}@ c #070807",
+"|@ c #687267",
+"1@ c #344132",
+"2@ c #010201",
+"3@ c #232A23",
+"4@ c #4F5E4D",
+"5@ c #738271",
+"6@ c #95A493",
+"7@ c #222821",
+"8@ c #222522",
+"9@ c #4E5A4D",
+"0@ c #080A07",
+"a@ c #20261F",
+"b@ c #546552",
+"c@ c #7A8978",
+"d@ c #A4B2A3",
+"e@ c #98A697",
+"f@ c #526350",
+"g@ c #30382F",
+"h@ c #2A2D2A",
+"i@ c #5C645B",
+"j@ c #192018",
+"k@ c #232823",
+"l@ c #536451",
+"m@ c #5A6B58",
+"n@ c #8F9E8D",
+"o@ c #3D453C",
+"p@ c #353F34",
+"q@ c #272B26",
+"r@ c #2D352C",
+"s@ c #8E9D8C",
+"t@ c #525C51",
+"u@ c #4D554C",
+"v@ c #1A2019",
+"w@ c #3E443D",
+"x@ c #242924",
+"y@ c #596956",
+"z@ c #495847",
+"A@ c #1E211E",
+"B@ c #252D24",
+"C@ c #313730",
+"D@ c #323A31",
+"E@ c #4F5F4C",
+"F@ c #334031",
+"G@ c #272C27",
+"H@ c #141713",
+"I@ c #545D52",
+"J@ c #323831",
+"K@ c #10130F",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" . + ",
+" @ # $ % + ",
+" & * = - ; > , ",
+" + + + + ' * * ) ! ~ { . + ",
+" + ] ^ + / ( + _ * * * * : < [ } ",
+" + | 1 + + + 2 3 4 + 5 6 7 * * * * 8 9 ",
+" + 7 0 + + + a 2 2 b c d e f * * * g h + ",
+" + i j k + + 3 2 3 2 l m n o p q * r s t + + ",
+" u * * v a + w x 3 3 x y z A B C 6 D E F G ^ + + ",
+" H * * * I J a K L M N a N a F O P Q R * ) ! S T + + ",
+" U * * * * * V W X Y Z b 3 2 / y ` ...+.@.* #.$.$ %.+ + ",
+" &.*.* * * * * I =.N -.;.>.3 2 2 x ,.'.).!.~.* {.].$.^./.+ + ",
+" (._.* * * * * * * :.<.[.}.|.1.3 2 a 2 2.3.4.5.@.* 6.7.8.9.+ + ",
+" 0.* * * * * * * * a.b.b.c.d.e.3 2 2 x $.f.> g.h.* * i.j.k.A + ",
+" l.* * * * * * * * * m.n.o.p.q.r.s.a 2 t.u.v.w.x.R y.* z.7.` A.+ ",
+" B.* * * * * * * * * * * C.D.E.F.G.H.b 2 2 a I.J.' +.K.* ) L.M.N. ",
+" O.P.* * * * * * * * * * * Q.R.S.T.U.V.W.N 2 3 F X.Y.Z.`.7 +.+++ ",
+" @+#+* * * * * * * * * * * * $+%+&+*+=+-+;+>+a ,+X.'+)+!+~+{+]+^+ ",
+" + /+* * * * * * * * * * * * * * (+_+:+<+[+}+|+1+N.)+)+)+~+2+3+ ",
+" 4+K.* * * * * * * * * * * * * * $+5+6+^+}+7+8+9+)+)+)+~+0+a+ ",
+" b+c+* * * * * * * * * * * * * * * * d+L e+f+g+% )+)+h+i+j+k+ ",
+" l+m+* * * * * * * * * * * * * * * n+o+p+q+r+9.)+)+s+t+u+v+ ",
+" w+x+* * * * * * * * * * * * * * y+w+z+f+A+n )+)+B+C+D+ ",
+" E+F+* * * * * * * * * * * * * G+H+I+G J+..)+K+i+L+M+ ",
+" N+O+P+* * * * * * * * * * * Q+R+S+T+U+V+)+h+W+X+^+ ",
+" Y+Z+`+* * * * * * * * * * Q+ @.@+@@@#@)+c+$@%@ ",
+" %@E+&@7 * * * * * * * * *@ @=@-@;@>@)+,@'@9+ ",
+" X.)@G+q * * * * * * * !@~@{@J+> )+]@^@/@+ + ",
+" 9+(@_@:@* * * * * * <@[@h }@w.)+|@1@2@+ + + + ",
+" }@3@4@5@`+* * * * 6@6+7@, 8@)+9@0@+ + + + + + + ",
+" a@$@b@c@d@* * e@f@g@A h@i@j@+ + + + + + + + ",
+" k@ @l@m@n@* e@l@o@9+5 p@2@+ + + + + + + ",
+" q@r@4@l@c@s@l@t@% u@v@+ + + + + + + ",
+" w@x@~@l@y@z@i@A@B@A + + + + + ",
+" C@D@E@F@o@G@H@+ + + + + ",
+" I@J@K@+ + + + + + ",
+" + + + + ",
+" ",
+" ",
+" ",
+" "};
--- /dev/null
+<?xml version="1.0"?>
+<GTK-Interface>
+
+<project>
+ <name>Gabber</name>
+ <program_name>gabber</program_name>
+ <directory></directory>
+ <source_directory>src</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+ <use_widget_names>True</use_widget_names>
+ <gnome_help_support>True</gnome_help_support>
+</project>
+
+<widget>
+ <class>GnomeDialog</class>
+ <name>dialog2</name>
+ <title>Confirm New Public Key</title>
+ <type>GTK_WINDOW_DIALOG</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>True</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+ <auto_close>False</auto_close>
+ <hide_on_close>False</hide_on_close>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDialog:vbox</child_name>
+ <name>dialog-vbox2</name>
+ <homogeneous>False</homogeneous>
+ <spacing>8</spacing>
+ <child>
+ <padding>4</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <child_name>GnomeDialog:action_area</child_name>
+ <name>dialog-action_area2</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>13</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>3</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button7</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>View...</label>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button8</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_YES</stock_button>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button9</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_NO</stock_button>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox97</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkPixmap</class>
+ <name>pixmap1</name>
+ <filename>folder.xpm</filename>
+ <xalign>0.5</xalign>
+ <yalign>0.15</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <build_insensitive>True</build_insensitive>
+ <child>
+ <padding>3</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label353</name>
+ <label>You have received the remote users public key. Would you
+like to accept and save the public key?
+
+Public Key Fingerprint:
+
+8321 1A83 88AB 091B 9BBF 6017 A72E 2971 89AB CAE9</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>10</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+</widget>
+
+</GTK-Interface>
/*
- silchashtable.c
+ silchashtable.c
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2001 Pekka Riikonen
+ Copyright (C) 2001 - 2002 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
+ the Free Software Foundation; version 2 of the License.
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
SilcHashForeach foreach,
void *foreach_user_context)
{
- SilcHashTableEntry *entry;
+ SilcHashTableEntry *entry, *tmp;
bool auto_rehash;
uint32 i = SILC_HASH_TABLE_HASH(hash, hash_user_context);
SILC_HT_DEBUG(("index %d key %p", i, key));
+ /* Disallow auto rehashing while going through the table since we call
+ the `foreach' function which could alter the table. */
auto_rehash = ht->auto_rehash;
ht->auto_rehash = FALSE;
entry = &ht->table[i];
if (compare) {
while (*entry) {
- if (compare((*entry)->key, key, compare_user_context))
+ if (compare((*entry)->key, key, compare_user_context)) {
+ tmp = &(*entry)->next;
foreach((*entry)->key, (*entry)->context, foreach_user_context);
+ entry = tmp;
+ continue;
+ }
entry = &(*entry)->next;
}
} else {
while (*entry) {
- if ((*entry)->key == key)
+ if ((*entry)->key == key) {
+ tmp = &(*entry)->next;
foreach((*entry)->key, (*entry)->context, foreach_user_context);
+ entry = tmp;
+ continue;
+ }
entry = &(*entry)->next;
}
}
/*
- silchashtable.h
-
+ silchashtable.h
+
Author: Pekka Riikonen <priikone@silcnet.org>
-
- Copyright (C) 2001 Pekka Riikonen
-
+
+ Copyright (C) 2001 - 2002 Pekka Riikonen
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
+ the Free Software Foundation; version 2 of the License.
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* and contexts from the hash table that are found using the `key'. The
* `foreach' is called for every found key.
*
+ * NOTES
+ *
+ * The hash table will not be rehashed during the traversing of the list,
+ * even if the table was marked as auto rehashable. The caller also must
+ * not call silc_hash_table_rehash while traversing the table.
+ *
***/
void silc_hash_table_find_foreach(SilcHashTable ht, void *key,
SilcHashForeach foreach, void *user_context);
* Traverse all entrys in the hash table and call the `foreach' for
* every entry with the `user_context' context.
*
+ * NOTES
+ *
+ * The hash table will not be rehashed during the traversing of the list,
+ * even if the table was marked as auto rehashable. The caller also must
+ * not call silc_hash_table_rehash while traversing the table.
+ *
***/
void silc_hash_table_foreach(SilcHashTable ht, SilcHashForeach foreach,
void *user_context);
* The `compare' and `compare_user_context' are application specified
* comparing function. If not provided the hash table's default is used.
*
+ * NOTES
+ *
+ * The hash table will not be rehashed during the traversing of the list,
+ * even if the table was marked as auto rehashable. The caller also must
+ * not call silc_hash_table_rehash while traversing the table.
+ *
***/
void silc_hash_table_find_foreach_ext(SilcHashTable ht, void *key,
SilcHashFunction hash,