Re: ORBit-0.5.7 bug: non-root process can't talk to root process!



Hi Yonghong,

> > >   res = writev(fd, curvec, nvecs);
> > >
> > >   sum = (GIOP_MESSAGE_BUFFER(send_buffer)->message_header.message_size +
> > > sizeof(GIOPMessageHeader));
> > >
> > >   if(res < sum) {
> > >     if(res < 0) {
> > >       if(errno != EAGAIN) {
> > >         giop_main_handle_connection_exception(cnx);
> > >         goto out;
> > >       }
> > >
> > >       res = 0;
> >
> > This is from the original code. This should actually do, what you want, or
> > am I missing something? In giop_init SIGPIPE is set to ignore, which means,
> > that write will set errno to EPIPE, which is != EAGAIN and thus the
> > connection is marked invalid.
> >
> 
> Yes, this is from the original code, but it really doesn't do what I
> want.

Indeed, the problem ist that the return value of giop_send_buffer_write is
ignored and the subsequent read from the connection simply hangs. That could
be changed by the attached patch. As I see no reason to not apply this change
(There doesn't seem to be a problem for also including it for
BACKWARDS_COMPAT_0_4) I will commit it unless there are objections.

Bye,
Sebastian
-- 
Sebastian Wilhelmi
mailto:wilhelmi ira uka de
http://goethe.ira.uka.de/~wilhelmi
Index: src/orbit-idl-compiler/backends/c/orbit-idl-c-stubs.c
===================================================================
RCS file: /cvs/gnome/ORBit/src/orbit-idl-compiler/backends/c/orbit-idl-c-stubs.c,v
retrieving revision 1.22.4.4
diff -p -u -b -B -r1.22.4.4 orbit-idl-c-stubs.c
--- src/orbit-idl-compiler/backends/c/orbit-idl-c-stubs.c	2001/01/28 22:17:50	1.22.4.4
+++ src/orbit-idl-compiler/backends/c/orbit-idl-c-stubs.c	2001/04/18 12:51:08
@@ -193,11 +193,8 @@ cs_output_stub(IDL_tree tree, OIDL_C_Inf
 
   c_marshalling_generate(oi->in_stubs, ci, TRUE);
 
-#ifdef BACKWARDS_COMPAT_0_4
-  fprintf(ci->fh, "giop_send_buffer_write(_ORBIT_send_buffer);\n");
-#else
   fprintf(ci->fh, "if(giop_send_buffer_write(_ORBIT_send_buffer)) goto _ORBIT_system_exception;\n");
-#endif
+
   fprintf(ci->fh, "_ORBIT_completion_status = CORBA_COMPLETED_MAYBE;\n");
   fprintf(ci->fh, "giop_send_buffer_unuse(_ORBIT_send_buffer); _ORBIT_send_buffer = NULL;\n");
   fprintf(ci->fh, "}\n");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]