Michal Sojka [Thu, 24 Jun 2010 22:38:26 +0000 (00:38 +0200)]
Get compilable output for sequences of a typedeffed type
This change is a workaround rather than a real fix. This way be generate
unnecessarily more [de]serialization functions even if they do the same
as the function of the original type.
Michal Sojka [Fri, 18 Jun 2010 14:08:38 +0000 (16:08 +0200)]
Do not destroy forb automatically on exit
I do not know how to deregister the exit handler which is needed if
forb_destroy() is called manually. If the handler is not deregister
we get double free error.
Michal Sojka [Thu, 28 May 2009 03:29:59 +0000 (05:29 +0200)]
Added redistribution of HELLO packets
In FRSH_FORB, contract broker acts as central node and redistributes
HELLO packets to all connected applications. This way every application
can connect to every other.
Michal Sojka [Wed, 27 May 2009 21:34:29 +0000 (23:34 +0200)]
Inet protocol sends HELLO as the first message after connect()
This allows the receiver to know sender's listening address, which is different
from the address of the connect()ed socket. Besides the address, also orb_id is
sent, which makes debugging easier.
It this approach is found successful, this functionality should be moved to
iop.c and protocols should have new connect callback which will be called by iop
if the peer was never contacted.
Michal Sojka [Wed, 27 May 2009 18:33:14 +0000 (20:33 +0200)]
Correct handling of closed TCP connections in proto_inet
In FRSH_FORB this allows restarting resource managers without restart of fcb.
The problem of previous implementation was, that if the socket was closed but
peer structure was not unregistered the disconnected peer structure stored
fd of closed socket and when a new connection was made, the fd was the same
as stored in disconnected peer structure. Therefore the disconnected peer
appeared as alive.
Michal Sojka [Wed, 27 May 2009 18:32:15 +0000 (20:32 +0200)]
Discovery handling moved to discovery.c
This was done to defined better (more higher level) interface to peer
manipulation. The interface is represented by forb_new_peer_discovered(),
forb_peer_disconnected() and forb_peer_find[_timer]().
Michal Sojka [Tue, 26 May 2009 15:03:27 +0000 (17:03 +0200)]
Automatically register FCB peer when INET is default
FCB is always found on a fixed port. If FCB_ADDR environment variable
it not set, it is registered on 127.0.0.1, otherwise it is registered
on address according to the FCB_ADDR.
Michal Sojka [Tue, 26 May 2009 14:50:11 +0000 (16:50 +0200)]
Reference registry disabled when INET proto is default
Reference registry was moved to a regref.c. When INET protocol is used,
the regitration to /tmp/forb is disabled. For now we use a hack to handle
registration with INET protocol.
Michal Sojka [Tue, 26 May 2009 05:43:59 +0000 (07:43 +0200)]
Implement peer discovery based on incoming requests
For INET protocol, our simple discovery protocol is not reliable,
therfore, we discover peers also according to incomming requests. Whenever
INET protocol receives first request on accept()ed socket, it prepares
a forb_peer_t corresponding to the socket. In iop.c this peers is added
FORB server_id and then the peer is treated as discovered.
Michal Sojka [Thu, 21 May 2009 10:21:58 +0000 (12:21 +0200)]
Fixed deserialization of empty sequences
When an empty sequence was deserialized, malloc(0) returned NULL which
was treated as malloc error. Now allocation of sequence buffers is moved
to a separate function which return allocation success.
Michal Sojka [Tue, 12 May 2009 22:32:15 +0000 (00:32 +0200)]
Maximum request size increased to 4 kB
When huge contracts with spare capacity was sent, the limit of request
size was exceeded so we need to provide a bigger buffer. Alternative
solution would be dynamically sized CDR buffers.
Michal Sojka [Tue, 12 May 2009 21:57:43 +0000 (23:57 +0200)]
Do not free buffer when deserializing sequences
This commit fixes crashes of FORB applications. The sequence variable
which is being deserialized might be uninitialized and therefore it is
not good idea to free the memory referenced by an uninitialized pointer
(seq->_buffer).
Michal Sojka [Sun, 10 May 2009 21:41:28 +0000 (23:41 +0200)]
forb_init() prototype changed to be extensible
The third parameter to forb_init() is a pointer to a structure
containing attributes to control FORB initialization. Currently, only
orb_id (the original third parameter of forb_init()) is present in the
structure. Future additions to this structure do not break source code
compatibility.
Michal Sojka [Thu, 23 Apr 2009 05:15:33 +0000 (07:15 +0200)]
Fixed some problems with big-endian architecture
Although this patch fixes the most important problems, there are still
some incompatibilities when big-endian machines communicate with
little-endian ones. Big to big communication works correctly.