#define ERR_CODE_LEN 512
static canl_err_code resolve_error(glb_ctx *cc, unsigned long err_code,
- canl_error_origin err_orig);
+ canl_err_origin err_orig);
static void get_error_string(glb_ctx *cc, char *code_str);
/* TODO: produce error messages immediately (to chain them) */
/* Save error message into err_msg
* use NULL for empty err_format */
canl_err_code update_error (glb_ctx *cc, unsigned long err_code,
- canl_error_origin err_orig,
+ canl_err_origin err_orig,
const char *err_format, ...)
{
unsigned int err_msg_len = 0;
/* If there was some error message in ctx, delete it and make new */
canl_err_code set_error (glb_ctx *cc, unsigned long err_code,
- canl_error_origin err_orig,
+ canl_err_origin err_orig,
const char *err_format, ...)
{
va_list ap;
TODO go through ssl errors and assign appr. canl code
?preserve original one? */
static canl_err_code resolve_error(glb_ctx *cc, unsigned long err_code,
- canl_error_origin err_orig)
+ canl_err_origin err_orig)
{
if (err_orig == CANL_ERROR) {
cc->err_code = err_code;
unsigned long openssl_reason;
} canl_err_desc;
-typedef enum canl_error_origin {
+typedef enum canl_err_origin {
UNKNOWN_ERROR = 0,
POSIX_ERROR,
SSL_ERROR,
CANL_ERROR,
NETDB_ERROR,
-} canl_error_origin;
+} canl_err_origin;
typedef enum _CANL_AUTH_MECHANISM
{
{
char * err_msg;
canl_err_code err_code;
- canl_error_origin err_orig;
+ canl_err_origin err_orig;
cert_key_store *cert_key;
} glb_ctx;
void reset_error (glb_ctx *cc, unsigned long err_code);
canl_err_code set_error (glb_ctx *cc, unsigned long err_code,
- canl_error_origin err_orig, const char *err_format, ...);
+ canl_err_origin err_orig, const char *err_format, ...);
canl_err_code update_error (glb_ctx *cc, unsigned long err_code,
- canl_error_origin err_orig, const char *err_format, ...);
+ canl_err_origin err_orig, const char *err_format, ...);
void free_hostent(struct hostent *h); //TODO is there some standard funcion to free hostent?
int asyn_getservbyname(int a_family, asyn_result *ares_result,char const *name,
struct timeval *timeout);
int ret = -1, ret2 = -1;
unsigned long ssl_err = 0;
int err = 0;
- canl_error_origin e_orig = UNKNOWN_ERROR;
+ canl_err_origin e_orig = UNKNOWN_ERROR;
long errorcode = 0;
int expected = 0;
int locl_timeout = -1;
int ret = -1, ret2 = -1;
unsigned long ssl_err = 0;
int err = 0;
- canl_error_origin e_orig = UNKNOWN_ERROR;
+ canl_err_origin e_orig = UNKNOWN_ERROR;
long errorcode = 0;
int expected = 0;
int locl_timeout = -1;