Implement Client.connect

Review Request #3185 — Created May 14, 2024 and submitted

Information

ibis/ibis
default

Reviewers

Implement Client.connect

Compiled and ran the turtles.

We don't really have a way to test a TCP connection at the moment.

Summary ID
Implement Client.connect
167951d272d01cd356a2adeeb22a6d3ea06e02e3
Description From Last Updated

Note that this nothing if *error == NULL, meaning no error will be set if connection == NULL. Also, this …

QuLogicQuLogic

ibis_client_disconnect also seems to assume that it's already connected, as it tries to close the streams, so this might not …

QuLogicQuLogic

I'm not sure you need the if, since when the conditions fail, the functions would do what we expect.

QuLogicQuLogic

OK, but do you want it to error out if connection == NULL, or is that guaranteed to have an …

QuLogicQuLogic

This is still a problem because client->stream is still NULL as ibis_client_start hasn't been called.

QuLogicQuLogic
QuLogic
  1. 
      
  2. ibis/ibisclient.c (Diff revision 1)
     
     
    Show all issues

    Note that this nothing if *error == NULL, meaning no error will be set if connection == NULL. Also, this could be g_prefix_error_literal instead.

  3. ibis/ibisclient.c (Diff revision 1)
     
     
    Show all issues

    ibis_client_disconnect also seems to assume that it's already connected, as it tries to close the streams, so this might not be the right call here.

    Just setting the error, state, and clearing the cancellable may be easier?

    1. Per the docs Closing a stream multiple times will not return an error. so that should be fine, but there are some other cleanups we need to do in disconnect.

  4. ibis/ibisclient.c (Diff revision 1)
     
     
     
     
     
     
     
     
    Show all issues

    I'm not sure you need the if, since when the conditions fail, the functions would do what we expect.

    1. The tls check is also redundant?

    2. nice catch!

  5. 
      
grim
QuLogic
  1. 
      
  2. ibis/ibisclient.c (Diff revision 2)
     
     
     
     
    Show all issues

    OK, but do you want it to error out if connection == NULL, or is that guaranteed to have an error != NULL (in which case one condition in the || is redundant)?

  3. ibis/ibisclient.c (Diff revision 2)
     
     
    Show all issues

    This is still a problem because client->stream is still NULL as ibis_client_start hasn't been called.

  4. 
      
grim
grim
QuLogic
  1. Ship It!
  2. 
      
grim
Review request changed
Status:
Completed