CCI / cci

Other
25 stars 8 forks source link

connection accepted events do not hold the ctx provided to cci_connect #10

Closed facundominguez closed 12 years ago

facundominguez commented 12 years ago

Modifying the client program as shown below prints the ctx field to standard output. The value printed is not the same as the value provided to cci_connect (NULL).

This happens with the sock driver: $ cat config.ini [eth1] driver = sock ip = 192.168.0.1 mac = 00:e0:7d:ad:95:5e default = 1

diff --git a/src/tests/client.c b/src/tests/client.c
index 2ad3415..0a1471a 100644
--- a/src/tests/client.c
+++ b/src/tests/client.c
@@ -50,6 +50,8 @@ poll_events(cci_endpoint_t * endpoint, cci_connection_t ** connection,
        case CCI_EVENT_CONNECT_ACCEPTED:
            *done = 1;
            *connection = event->accepted.connection;
+           fprintf(stderr, "accepted %d\n",
+               (int)((uintptr_t) event->accepted.context));
            break;
        case CCI_EVENT_CONNECT_TIMEDOUT:
        case CCI_EVENT_CONNECT_REJECTED:
bgoglin commented 12 years ago

This should be fixed in commit fdbb2496a66139cc5331ff3914b51d9039d096e2 I removed the context field from the accepted events and move the context assignment to where the connection was created. Please reopen if not solved.