Skip to content

Commit

Permalink
Merge pull request #3 from jo-tools/feature/improve-connect-multiaddr
Browse files Browse the repository at this point in the history
Improve Socket Connect for Hostnames with Multi Addr (e.g. IPv4 and IPv6)
  • Loading branch information
marcobambini authored Jun 30, 2024
2 parents 904e2f4 + 1a3dab6 commit a44647e
Show file tree
Hide file tree
Showing 4 changed files with 503 additions and 442 deletions.
16 changes: 8 additions & 8 deletions CubeSQL_SDK/csql.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ typedef unsigned long in_addr_t;
#define kMAXCHUNK 100*1024
#define NO_TIMEOUT 0
#define CONNECT_TIMEOUT 5
#if defined(HAVE_BZERO) || defined(bzero)
// do nothing
#else
Expand Down Expand Up @@ -218,7 +218,7 @@ const char *tls_config_error(struct tls_config *_config);
void tls_free(struct tls *_ctx);
const char* SSLeay_version(int t);
#endif
/* COMMANDS */
#define kCOMMAND_CONNECT 1
#define kCOMMAND_SELECT 2
Expand Down Expand Up @@ -310,14 +310,14 @@ struct csqldb {
int errcode; // last error code
int useOldProtocol; // flag to set if you want to use the old REALSQLServer protocol
int verifyPeer; // flag to check if peer verification must be performed
int family;
int family;

char *token; // optional token used in token connect
char *hostverification; // optional host verification name to use in SSL peer verification
void *userptr; // optional pointer saved by the user
int encryption; // CUBESQL_ENCRYPTION_NONE - CUBESQL_ENCRYPTION_AES128
// CUBESQL_ENCRYPTION_AES192 - CUBESQL_ENCRYPTION_AES256
// CUBESQL_ENCRYPTION_AES192 - CUBESQL_ENCRYPTION_AES256
csql_aes_encrypt_ctx encryptkey[1]; // session key used to encrypt data
csql_aes_decrypt_ctx decryptkey[1]; // session key used to decrypt data

Expand All @@ -328,9 +328,9 @@ struct csqldb {
inhead request; // request header
outhead reply; // response header

#ifndef CUBESQL_DISABLE_SSL_ENCRYPTION
struct tls *tls_context; // TLS context connection
#endif
#ifndef CUBESQL_DISABLE_SSL_ENCRYPTION
struct tls *tls_context; // TLS context connection
#endif

void (*trace) (const char*, void*); // trace callback
void *data; // user argument to be passed to the callbacks function
Expand Down
Loading

0 comments on commit a44647e

Please sign in to comment.