Re: new oaf timout patch ...
- From: Maciej Stachowiak <mjs eazel com>
- To: Michael Meeks <mmeeks gnu org>
- Cc: gnome-components-list gnome org
- Subject: Re: new oaf timout patch ...
- Date: 23 Jul 2000 23:44:29 -0700
Michael Meeks <michael@helixcode.com> writes:
> Hi,
>
> This time, the patch uses a timeout instead and renames the API to
> show that, I used 1000ms as a sensible value; seems to work well.
Looks all right.
> Incidentaly I seem to be getting 2 results in my selection dialog
> for every component ( try bonobo/selector_test ), I have no GNOME_PATH and
> no OAF_INFO_PATH set.
I will look into it.
- Maciej
> Regards,
>
> Michael.
>
> ? a.out
> ? mjs
> ? b.out
> Index: ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/oaf/ChangeLog,v
> retrieving revision 1.45
> diff -u -r1.45 ChangeLog
> --- ChangeLog 2000/07/23 15:01:53 1.45
> +++ ChangeLog 2000/07/24 04:35:32
> @@ -1,3 +1,22 @@
> +2000-07-18 Michael Meeks <michael@helixcode.com>
> +
> + * oafd/main.c (main): fix some brokenness.
> +
> +2000-07-17 Michael Meeks <michael@helixcode.com>
> +
> + * test/broken.oafinfo: add NotInServer entry.
> +
> + * test/oaf-test-client.c (main): add test for non-registering
> + server.
> +
> + * liboaf/oaf-servreg.c (oaf_active_server_register): make
> + need_printout module global, rename to need_ior_printout.
> + (oaf_timeout_reg_check): implement catch for norberts.
> + (oaf_timeout_reg_check_set): allow turning it off.
> +
> + * liboaf/oaf-mainloop.c (oaf_postinit): hook in the check function
> + if appropriate, be a bit defensive.
> +
> 2000-07-23 ERDI Gergo <cactus@cactus.rulez.org>
>
> * idl/gnome-factory.idl: Changed `supports' to `manufactures' to
> Index: liboaf/liboaf-private.h
> ===================================================================
> RCS file: /cvs/gnome/oaf/liboaf/liboaf-private.h,v
> retrieving revision 1.8
> diff -u -r1.8 liboaf-private.h
> --- liboaf/liboaf-private.h 2000/07/09 17:54:59 1.8
> +++ liboaf/liboaf-private.h 2000/07/24 04:35:33
> @@ -15,11 +15,14 @@
> #endif
> #endif
>
> +#define OAF_FACTORY_TIMEOUT 1000
>
> -CORBA_Object oaf_server_by_forking (const char **cmd, int fd_Arg,
> - CORBA_Environment * ev);
> -void oaf_rloc_file_register (void);
> -int oaf_ior_fd_get (void);
> +void oaf_timeout_reg_check_set (gboolean on);
> +gboolean oaf_timeout_reg_check (gpointer data);
> +CORBA_Object oaf_server_by_forking (const char **cmd, int fd_Arg,
> + CORBA_Environment * ev);
> +void oaf_rloc_file_register (void);
> +int oaf_ior_fd_get (void);
> CORBA_Object oaf_activation_context_get (void);
>
> extern gboolean oaf_private;
> Index: liboaf/oaf-mainloop.c
> ===================================================================
> RCS file: /cvs/gnome/oaf/liboaf/oaf-mainloop.c,v
> retrieving revision 1.19
> diff -u -r1.19 oaf-mainloop.c
> --- liboaf/oaf-mainloop.c 2000/07/09 17:54:59 1.19
> +++ liboaf/oaf-mainloop.c 2000/07/24 04:35:34
> @@ -293,6 +293,14 @@
> if (oaf_od_ior)
> oaf_registration_location_add (&cmdline_regloc, -1000, NULL);
>
> + if (oaf_activate_iid)
> + g_timeout_add_full (G_PRIORITY_LOW,
> + OAF_FACTORY_TIMEOUT,
> + oaf_timeout_reg_check,
> + NULL, NULL);
> + else
> + oaf_timeout_reg_check_set (FALSE);
> +
> is_initialized = TRUE;
> }
>
> Index: liboaf/oaf-servreg.c
> ===================================================================
> RCS file: /cvs/gnome/oaf/liboaf/oaf-servreg.c,v
> retrieving revision 1.7
> diff -u -r1.7 oaf-servreg.c
> --- liboaf/oaf-servreg.c 2000/07/15 11:42:17 1.7
> +++ liboaf/oaf-servreg.c 2000/07/24 04:35:34
> @@ -4,6 +4,32 @@
> #include "liboaf/liboaf-private.h"
> #include <stdio.h>
>
> +static gboolean check_registration = TRUE;
> +static gboolean need_ior_printout = TRUE;
> +
> +void
> +oaf_timeout_reg_check_set (gboolean on)
> +{
> + check_registration = on;
> +}
> +
> +gboolean
> +oaf_timeout_reg_check (gpointer data)
> +{
> + if (!check_registration)
> + return FALSE;
> +
> + if (need_ior_printout) {
> + g_error ("This process has not registered the required OafIID "
> + "your source code should register '%s'. If your code is "
> + "performing delayed registration and this message is trapped "
> + "in error, see oaf_idle_reg_check_set.",
> + oaf_activation_iid_get ());
> + }
> +
> + return FALSE;
> +}
> +
> OAF_RegistrationResult
> oaf_active_server_register (const char *iid, CORBA_Object obj)
> {
> @@ -13,18 +39,17 @@
> CORBA_Environment ev;
> OAF_RegistrationResult retval;
> const char *actid;
> - static gboolean need_printout = TRUE;
>
> CORBA_exception_init (&ev);
>
> actid = oaf_activation_iid_get ();
>
> - if (actid && !strcmp (actid, iid) && need_printout) {
> + if (actid && !strcmp (actid, iid) && need_ior_printout) {
> char *iorstr;
> FILE *fh;
> int iorfd = oaf_ior_fd_get ();
>
> - need_printout = FALSE;
> + need_ior_printout = FALSE;
>
> if (iorfd == 1)
> fh = stdout;
> @@ -47,7 +72,7 @@
> close (iorfd);
> }
> #ifdef OAF_DEBUG
> - else if (actid && need_printout) {
> + else if (actid && need_ior_printout) {
> g_message ("Unusual '%s' was activated, but "
> "'%s' is needed", iid, actid);
> }
> Index: test/broken.oafinfo
> ===================================================================
> RCS file: /cvs/gnome/oaf/test/broken.oafinfo,v
> retrieving revision 1.2
> diff -u -r1.2 broken.oafinfo
> --- test/broken.oafinfo 2000/06/02 23:03:55 1.2
> +++ test/broken.oafinfo 2000/07/24 04:35:34
> @@ -1,5 +1,8 @@
> <oaf_info>
>
> +<oaf_server iid="OAFIID:NotInServer:20000717" type="exe" location="./oaf-empty-server">
> +</oaf_server>
> +
> <oaf_server iid="OAFIID:Bogus:20000526" type="factory" location="OAFIID:Empty:19991025-Deliberate-Typo">
> </oaf_server>
>
> Index: test/oaf-test-client.c
> ===================================================================
> RCS file: /cvs/gnome/oaf/test/oaf-test-client.c,v
> retrieving revision 1.9
> diff -u -r1.9 oaf-test-client.c
> --- test/oaf-test-client.c 2000/07/05 21:50:01 1.9
> +++ test/oaf-test-client.c 2000/07/24 04:35:35
> @@ -4,7 +4,7 @@
> #include <stdlib.h>
> #include "empty.h"
>
> -#define TOTAL_TEST_SCORE 9
> +#define TOTAL_TEST_SCORE 11
>
> CORBA_Object name_service = CORBA_OBJECT_NIL;
>
> @@ -170,13 +170,34 @@
> }
> fprintf (stderr, "\n");
>
> - fprintf (stderr, "\n%d tests passed (%s)\n", passed,
> +
> + fprintf (stderr, "Server that doesn't register IID test ");
> + obj = oaf_activate_from_id ("OAFIID:NotInServer:20000717", 0, NULL, &ev);
> + if (obj || ev._major == CORBA_NO_EXCEPTION) {
> + fprintf (stderr, "failed 1");
> + } else {
> + fprintf (stderr, "passed 1 ('%s')", oaf_exception_id (&ev));
> + CORBA_exception_free (&ev);
> + passed++;
> + }
> + if (test_oafd (&ev, "with non-registering server")) {
> + fprintf (stderr, ", passed 2");
> + passed++;
> + } else {
> + fprintf (stderr, ", failed 2");
> + }
> + fprintf (stderr, "\n");
> +
> +
> + fprintf (stderr, "\n%d of %d tests passed (%s)\n", passed,
> + TOTAL_TEST_SCORE,
> passed == TOTAL_TEST_SCORE? "All": "some failures");
>
> CORBA_exception_free (&ev);
>
> - if (passed == TOTAL_TEST_SCORE)
> + if (passed == TOTAL_TEST_SCORE) {
> return 0;
> - else
> + } else {
> return 1;
> + }
> }
>
>
> --
> mmeeks@gnu.org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]