~ubuntu-branches/ubuntu/oneiric/orbit2/oneiric

« back to all changes in this revision

Viewing changes to src/orb/orb-core/corba-orb.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-07-24 18:18:08 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20060724181808-mc9ma0ouhzwa5nj1
Tags: upstream-2.14.2
ImportĀ upstreamĀ versionĀ 2.14.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
static gboolean     orbit_use_irda           = FALSE;
49
49
static gboolean     orbit_use_ssl            = FALSE;
50
50
static gboolean     orbit_use_genuid_simple  = FALSE;
 
51
#ifdef G_OS_WIN32
 
52
static gboolean     orbit_local_only         = TRUE;
 
53
#else
51
54
static gboolean     orbit_local_only         = FALSE;
 
55
#endif
52
56
static char        *orbit_net_id             = NULL;
53
57
static gboolean     orbit_use_http_iors      = FALSE;
54
58
static char        *orbit_ipsock             = NULL;
280
284
static gulong    init_level = 0;
281
285
static gboolean  atexit_shutdown = FALSE;
282
286
 
 
287
#ifndef G_OS_WIN32 /* See comment at g_atexit() call below */
283
288
/*
284
289
 *   This is neccessary to clean up any remaining UDS
285
290
 * and to flush any remaining oneway traffic in buffers.
305
310
 
306
311
        atexit_shutdown = FALSE;
307
312
}
 
313
#endif
308
314
 
309
315
static
310
316
gboolean
433
439
        /* released by CORBA_ORB_destroy */
434
440
        _ORBit_orb = ORBit_RootObject_duplicate (retval);
435
441
        _ORBit_orb->lock = link_mutex_new ();
 
442
#ifndef G_OS_WIN32
 
443
        /* atexit(), which g_atexit() is just a #define for on Win32,
 
444
         * often causes breakage when invoked from DLLs. It causes the
 
445
         * registered function to be called when the calling DLL is
 
446
         * being unloaded. At that time, however, random other DLLs
 
447
         * might also have already been unloaded. There is no
 
448
         * guarantee WinSock even works any longer. Etc. Best to avoid
 
449
         * atexit() completely on Win32, and hope that just exiting
 
450
         * the process and thus severing all connections will be
 
451
         * noticed by all peers the process was connected to and acted
 
452
         * upon properly.
 
453
         *
 
454
         * In the evolution-exchange-storage process's case, the
 
455
         * shutdown_orb() function caused the process to hang and not
 
456
         * exit, leaving the sockets it was listening on still in a
 
457
         * LISTEN state. bonobo-activation-server thought the bonobo
 
458
         * servers in evolution-exchange-storage were still OK and
 
459
         * tried to contact them when Evolution was started the next
 
460
         * time, causing it to hang, too.
 
461
         */
436
462
        g_atexit (shutdown_orb);
 
463
#endif
437
464
 
438
465
        retval->default_giop_version = GIOP_LATEST;
439
466
 
534
561
        CORBA_Object         retval = CORBA_OBJECT_NIL;
535
562
        CORBA_unsigned_long  len;
536
563
        GIOPRecvBuffer      *buf;
 
564
#if defined ENABLE_HTTP
537
565
        gchar               *ior = NULL;
 
566
#endif
538
567
        guchar              *tmpbuf;
539
568
        int                  i;
540
569
 
550
579
                    strstr (string, "://")) {
551
580
                        /* FIXME: this code is a security hazard */
552
581
                        ior = orb_http_resolve (string);
553
 
                        if (!ior)
 
582
                        if (!ior) {
 
583
                                /* FIXME, set error minor code
 
584
                                 * (vendor's error code) to tell user
 
585
                                 * initial location of error, ie my
 
586
                                 * local ORB, proxy's ORB, server's
 
587
                                 * ORB, etc. */
 
588
                                CORBA_exception_set_system (
 
589
                                        ev,
 
590
                                        ex_CORBA_BAD_PARAM,
 
591
                                        CORBA_COMPLETED_NO);
 
592
 
554
593
                                return CORBA_OBJECT_NIL;
555
 
 
 
594
                        }
556
595
                        string = ior;
557
596
                } else 
558
597
#endif
574
613
                        len--;
575
614
                
576
615
                if (len % 2) {
577
 
                        if (ior)
578
 
                                g_free (ior);
579
 
                        
 
616
#if defined ENABLE_HTTP
 
617
                        g_free (ior);
 
618
#endif
580
619
                        return CORBA_OBJECT_NIL;
581
620
                }
582
621
                
598
637
                }
599
638
                
600
639
                giop_recv_buffer_unuse (buf);
601
 
                
602
 
                if (ior)
603
 
                        g_free (ior);
604
 
                
 
640
#if defined ENABLE_HTTP         
 
641
                g_free (ior);
 
642
#endif
605
643
                return retval;
606
644
        } else {
607
645
                return ORBit_object_by_corbaloc (orb, string, ev);
1384
1422
        return FALSE;
1385
1423
}
1386
1424
 
 
1425
glong
 
1426
ORBit_get_giop_recv_limit (void)
 
1427
{
 
1428
        return giop_recv_get_limit ();
 
1429
}
 
1430
 
1387
1431
const ORBit_option orbit_supported_options[] = {
1388
1432
        { "ORBid",              ORBIT_OPTION_STRING,  NULL }, /* FIXME: unimplemented */
1389
1433
        { "ORBImplRepoIOR",     ORBIT_OPTION_STRING,  NULL }, /* FIXME: unimplemented */