author | Tero Marttila <terom@fixme.fi> |
Sun, 03 May 2009 17:16:30 +0300 | |
branch | new-transport |
changeset 164 | 7847a7c3b678 |
parent 156 | 6534a4ac957b |
child 178 | 3d357d055d67 |
permissions | -rw-r--r-- |
6 | 1 |
|
2 |
#include "error.h" |
|
3 |
||
30
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
4 |
// for the error_desc tables |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
5 |
#include "sock.h" |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
6 |
#include "sock_gnutls.h" |
55
6f7f6ae729d0
'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents:
41
diff
changeset
|
7 |
#include "module.h" |
30
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
8 |
|
7 | 9 |
#include <string.h> |
10 |
#include <stdio.h> |
|
11 |
||
30
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
12 |
struct error_desc _core_error_desc[] = { |
31 | 13 |
{ ERR_CALLOC, "calloc", ERR_EXTRA_NONE }, |
37
4fe4a3c4496e
change irc_chan.state into bool fields, move irc_cmd implementation from irc_conn.c into irc_cmd.c, remove irc_conn arg from irc_cmd_handler, add irc_conn.nickname tracking, and handle irc_chan JOINs
Tero Marttila <terom@fixme.fi>
parents:
31
diff
changeset
|
14 |
{ ERR_STRDUP, "strdup", ERR_EXTRA_NONE }, |
71
0a13030f795d
implement signal_ignore using sigaction directly, without any libevent in between
Tero Marttila <terom@fixme.fi>
parents:
68
diff
changeset
|
15 |
{ ERR_SIGACTION, "sigaction", ERR_EXTRA_ERRNO }, |
108
50ff7ac8a725
implement modules_path + module_load with NULL path
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
16 |
{ ERR_ACCESS_READ, "access(R_OK)", ERR_EXTRA_ERRNO }, |
31 | 17 |
{ ERR_GETADDRINFO, "getaddrinfo", ERR_EXTRA_GAI }, |
18 |
{ ERR_GETADDRINFO_EMPTY, "getaddrinfo: no results", ERR_EXTRA_NONE }, |
|
19 |
{ ERR_EVENT_NEW, "event_new", ERR_EXTRA_NONE }, |
|
20 |
{ ERR_EVENT_ADD, "event_add", ERR_EXTRA_NONE }, |
|
21 |
{ ERR_EVSQL_NEW_PQ, "evsql_new_pq", ERR_EXTRA_NONE }, |
|
68
591a574f390e
add FindEvsql/FindLibPQ cmake modules and irc_log.sql definition, and implement logging of JOIN, PART, MODE, TOPIC, KICK, PRIVMSG, NOTICE and OPEN messages
Tero Marttila <terom@fixme.fi>
parents:
63
diff
changeset
|
22 |
{ ERR_EVSQL_QUERY_EXEC, "evsql_query_exec", ERR_EXTRA_NONE }, |
63
d399a1d915a3
start reworking option-parsing, but --module/--config is still unimplemented
Tero Marttila <terom@fixme.fi>
parents:
57
diff
changeset
|
23 |
{ ERR_CMD_OPT, "argv", ERR_EXTRA_STR }, |
31 | 24 |
{ _ERR_INVALID, NULL, 0 } |
7 | 25 |
|
31 | 26 |
}, _sock_error_desc[] = { |
27 |
{ ERR_SOCKET, "socket", ERR_EXTRA_ERRNO }, |
|
28 |
{ ERR_CONNECT, "connect", ERR_EXTRA_ERRNO }, |
|
29 |
{ ERR_READ, "read", ERR_EXTRA_ERRNO }, |
|
30 |
{ ERR_WRITE, "write", ERR_EXTRA_ERRNO }, |
|
31 |
{ ERR_WRITE_EOF, "write: EOF", ERR_EXTRA_NONE }, |
|
32 |
{ ERR_FCNTL, "fcntl", ERR_EXTRA_ERRNO }, |
|
33 |
{ ERR_CLOSE, "close", ERR_EXTRA_ERRNO }, |
|
134
978041c1c04d
update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents:
121
diff
changeset
|
34 |
{ ERR_GETSOCKOPT, "getsockopt", ERR_EXTRA_ERRNO }, |
978041c1c04d
update TODO, partially update error.c, rename module_get to modules_get, update config.lua
Tero Marttila <terom@fixme.fi>
parents:
121
diff
changeset
|
35 |
{ ERR_OPEN, "open", ERR_EXTRA_ERRNO }, |
31 | 36 |
{ _ERR_INVALID, NULL, 0 } |
30
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
37 |
|
31 | 38 |
}, _sock_gnutls_error_desc[] = { |
39 |
{ ERR_GNUTLS_CERT_ALLOC_CRED, "gnutls_certificate_allocate_credentials", ERR_EXTRA_GNUTLS }, |
|
40 |
{ ERR_GNUTLS_GLOBAL_INIT, "gnutls_global_init", ERR_EXTRA_GNUTLS }, |
|
41 |
{ ERR_GNUTLS_SET_DEFAULT_PRIORITY, "gnutls_set_default_priority", ERR_EXTRA_GNUTLS }, |
|
42 |
{ ERR_GNUTLS_CRED_SET, "gnutls_credentials_set", ERR_EXTRA_GNUTLS }, |
|
43 |
{ ERR_GNUTLS_HANDSHAKE, "gnutls_handshake", ERR_EXTRA_GNUTLS }, |
|
44 |
{ ERR_GNUTLS_RECORD_SEND, "gnutls_record_send", ERR_EXTRA_GNUTLS }, |
|
45 |
{ ERR_GNUTLS_RECORD_RECV, "gnutls_record_recv", ERR_EXTRA_GNUTLS }, |
|
46 |
{ ERR_GNUTLS_RECORD_GET_DIRECTION, "gnutls_record_get_direction", ERR_EXTRA_GNUTLS }, |
|
140
aa390e52eda8
implement ssl_cafile/verify/cert/pkey for x509 credentials
Tero Marttila <terom@fixme.fi>
parents:
138
diff
changeset
|
47 |
{ ERR_GNUTLS_CERT_VERIFY_PEERS2, "gnutls_certificate_verify_peers2", ERR_EXTRA_GNUTLS }, |
aa390e52eda8
implement ssl_cafile/verify/cert/pkey for x509 credentials
Tero Marttila <terom@fixme.fi>
parents:
138
diff
changeset
|
48 |
{ ERR_GNUTLS_CERT_VERIFY, "X.509 Certificate verification failed", ERR_EXTRA_STR }, |
aa390e52eda8
implement ssl_cafile/verify/cert/pkey for x509 credentials
Tero Marttila <terom@fixme.fi>
parents:
138
diff
changeset
|
49 |
{ ERR_GNUTLS_CERT_SET_X509_TRUST_FILE,"gnutls_certificate_set_x509_trust_file", ERR_EXTRA_GNUTLS }, |
aa390e52eda8
implement ssl_cafile/verify/cert/pkey for x509 credentials
Tero Marttila <terom@fixme.fi>
parents:
138
diff
changeset
|
50 |
{ ERR_GNUTLS_CERT_SET_X509_KEY_FILE, "gnutls_certificate_set_x509_key_file", ERR_EXTRA_GNUTLS }, |
31 | 51 |
{ _ERR_INVALID, NULL, 0 } |
52 |
||
100
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
53 |
}, _irc_error_desc[] = { |
37
4fe4a3c4496e
change irc_chan.state into bool fields, move irc_cmd implementation from irc_conn.c into irc_cmd.c, remove irc_conn arg from irc_cmd_handler, add irc_conn.nickname tracking, and handle irc_chan JOINs
Tero Marttila <terom@fixme.fi>
parents:
31
diff
changeset
|
54 |
{ ERR_LINE_TOO_LONG, "IRC line is too long", ERR_EXTRA_NONE }, |
4fe4a3c4496e
change irc_chan.state into bool fields, move irc_cmd implementation from irc_conn.c into irc_cmd.c, remove irc_conn arg from irc_cmd_handler, add irc_conn.nickname tracking, and handle irc_chan JOINs
Tero Marttila <terom@fixme.fi>
parents:
31
diff
changeset
|
55 |
{ ERR_LINE_INVALID_TOKEN, "Illegal token value for IRC line", ERR_EXTRA_NONE }, |
4fe4a3c4496e
change irc_chan.state into bool fields, move irc_cmd implementation from irc_conn.c into irc_cmd.c, remove irc_conn arg from irc_cmd_handler, add irc_conn.nickname tracking, and handle irc_chan JOINs
Tero Marttila <terom@fixme.fi>
parents:
31
diff
changeset
|
56 |
{ ERR_INVALID_NM, "Invalid nickmask", ERR_EXTRA_NONE }, |
4fe4a3c4496e
change irc_chan.state into bool fields, move irc_cmd implementation from irc_conn.c into irc_cmd.c, remove irc_conn arg from irc_cmd_handler, add irc_conn.nickname tracking, and handle irc_chan JOINs
Tero Marttila <terom@fixme.fi>
parents:
31
diff
changeset
|
57 |
{ ERR_INVALID_NICK_LENGTH, "Nickname is too long", ERR_EXTRA_NONE }, |
100
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
58 |
|
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
59 |
// extra: the name of the invalid field |
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
60 |
{ ERR_IRC_NET_INFO, "invalid irc_net_info", ERR_EXTRA_STR }, |
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
61 |
{ ERR_IRC_NET_STATE, "invalid irc_net state for operation", ERR_EXTRA_NONE }, |
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
62 |
{ ERR_IRC_CHAN_STATE, "invalid irc_chan state for operation", ERR_EXTRA_NONE }, |
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
63 |
|
37
4fe4a3c4496e
change irc_chan.state into bool fields, move irc_cmd implementation from irc_conn.c into irc_cmd.c, remove irc_conn arg from irc_cmd_handler, add irc_conn.nickname tracking, and handle irc_chan JOINs
Tero Marttila <terom@fixme.fi>
parents:
31
diff
changeset
|
64 |
{ _ERR_INVALID, NULL, 0 } |
100
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
65 |
|
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
66 |
}, _config_error_desc[] = { |
121
4682ebbc5644
implement logwatch_conf_filter such that it compiles and loads, but not yet tested
Tero Marttila <terom@fixme.fi>
parents:
108
diff
changeset
|
67 |
{ ERR_CONFIG_NAME, "unknown config option", ERR_EXTRA_STR }, |
4682ebbc5644
implement logwatch_conf_filter such that it compiles and loads, but not yet tested
Tero Marttila <terom@fixme.fi>
parents:
108
diff
changeset
|
68 |
{ ERR_CONFIG_TYPE, "invalid config type", ERR_EXTRA_NONE }, |
100
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
69 |
{ ERR_CONFIG_REQUIRED, "missing required value", ERR_EXTRA_STR }, |
121
4682ebbc5644
implement logwatch_conf_filter such that it compiles and loads, but not yet tested
Tero Marttila <terom@fixme.fi>
parents:
108
diff
changeset
|
70 |
{ ERR_CONFIG_VALUE, "invalid value", ERR_EXTRA_STR }, |
4682ebbc5644
implement logwatch_conf_filter such that it compiles and loads, but not yet tested
Tero Marttila <terom@fixme.fi>
parents:
108
diff
changeset
|
71 |
{ ERR_CONFIG_PARAMS, "invalid number of paramters", ERR_EXTRA_NONE }, |
100
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
72 |
|
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
73 |
{ _ERR_INVALID, NULL, 0 } |
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
74 |
|
55
6f7f6ae729d0
'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents:
41
diff
changeset
|
75 |
}, _module_error_desc[] = { |
108
50ff7ac8a725
implement modules_path + module_load with NULL path
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
76 |
{ ERR_MODULE_NAME, "invalid module name", ERR_EXTRA_NONE }, |
50ff7ac8a725
implement modules_path + module_load with NULL path
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
77 |
{ ERR_MODULE_DUP, "module already loaded", ERR_EXTRA_NONE }, |
50ff7ac8a725
implement modules_path + module_load with NULL path
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
78 |
{ ERR_MODULE_PATH, "invalid module path", ERR_EXTRA_STR }, |
57
ce1accba5fc7
slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents:
56
diff
changeset
|
79 |
{ ERR_MODULE_OPEN, "module dlopen() failed", ERR_EXTRA_STR }, |
108
50ff7ac8a725
implement modules_path + module_load with NULL path
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
80 |
{ ERR_MODULE_SYM, "module dlsym() failed", ERR_EXTRA_STR }, |
57
ce1accba5fc7
slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents:
56
diff
changeset
|
81 |
{ ERR_MODULE_INIT_FUNC, "invalid module init func", ERR_EXTRA_STR }, |
56
942370000450
compiling, working, but still ugly module code
Tero Marttila <terom@fixme.fi>
parents:
55
diff
changeset
|
82 |
{ ERR_MODULE_CONF, "module_conf", ERR_EXTRA_STR }, |
55
6f7f6ae729d0
'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents:
41
diff
changeset
|
83 |
{ _ERR_INVALID, NULL, 0 } |
100
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
84 |
|
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
85 |
}, _lua_error_desc[] = { |
106
f00661136ac2
add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
100
diff
changeset
|
86 |
{ ERR_LUA_MEM, "lua: out of memory", ERR_EXTRA_STR }, |
f00661136ac2
add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
100
diff
changeset
|
87 |
{ ERR_LUA_SYNTAX, "lua: syntax error", ERR_EXTRA_STR }, |
f00661136ac2
add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
100
diff
changeset
|
88 |
{ ERR_LUA_RUN, "lua: runtime error", ERR_EXTRA_STR }, |
f00661136ac2
add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
100
diff
changeset
|
89 |
{ ERR_LUA_ERR, "lua: error handling error", ERR_EXTRA_STR }, |
f00661136ac2
add nexus_lua_error for unified LUA_ERR* -> ERR_LUA_* mapping, and lua configuration support
Tero Marttila <terom@fixme.fi>
parents:
100
diff
changeset
|
90 |
{ ERR_LUA_FILE, "lua: error loading file", ERR_EXTRA_STR }, |
100
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
91 |
{ _ERR_INVALID, NULL, 0 } |
156
6534a4ac957b
add transport/sock/line_proto/etc code compiles
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
92 |
|
138
a716c621cb90
implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents:
134
diff
changeset
|
93 |
}, _pcre_error_desc[] = { |
a716c621cb90
implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents:
134
diff
changeset
|
94 |
{ ERR_PCRE_COMPILE, "pcre_compile", ERR_EXTRA_STR }, |
a716c621cb90
implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents:
134
diff
changeset
|
95 |
{ ERR_PCRE_EXEC, "pcre_exec", ERR_EXTRA_STR }, |
a716c621cb90
implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents:
134
diff
changeset
|
96 |
{ _ERR_INVALID, NULL, 0 } |
156
6534a4ac957b
add transport/sock/line_proto/etc code compiles
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
97 |
}, _general_error_desc[] = { |
6534a4ac957b
add transport/sock/line_proto/etc code compiles
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
98 |
{ ERR_MISC, "miscellaneous error", ERR_EXTRA_STR }, |
6534a4ac957b
add transport/sock/line_proto/etc code compiles
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
99 |
{ ERR_CMD_OPT, "invalid command line option", ERR_EXTRA_STR }, |
6534a4ac957b
add transport/sock/line_proto/etc code compiles
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
100 |
{ ERR_DUP_NAME, "duplicate name", ERR_EXTRA_STR }, |
6534a4ac957b
add transport/sock/line_proto/etc code compiles
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
101 |
{ ERR_EOF, "EOF", ERR_EXTRA_NONE }, |
164
7847a7c3b678
remove ERR_READ_EOF, add more general errors, add missing _general_error_desc, and have error_name return for SUCCESS
Tero Marttila <terom@fixme.fi>
parents:
156
diff
changeset
|
102 |
{ ERR_MEM, "memory allocation error", ERR_EXTRA_NONE }, |
7847a7c3b678
remove ERR_READ_EOF, add more general errors, add missing _general_error_desc, and have error_name return for SUCCESS
Tero Marttila <terom@fixme.fi>
parents:
156
diff
changeset
|
103 |
{ ERR_NOT_IMPLEMENTED, "function not implemented", ERR_EXTRA_NONE }, |
156
6534a4ac957b
add transport/sock/line_proto/etc code compiles
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
104 |
{ _ERR_INVALID, NULL, 0 } |
30
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
105 |
}; |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
106 |
|
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
107 |
/** |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
108 |
* Array of error_desc tables |
6 | 109 |
*/ |
30
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
110 |
static struct error_desc* _desc_tables[] = { |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
111 |
_core_error_desc, |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
112 |
_sock_error_desc, |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
113 |
_sock_gnutls_error_desc, |
100
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
114 |
_irc_error_desc, |
121
4682ebbc5644
implement logwatch_conf_filter such that it compiles and loads, but not yet tested
Tero Marttila <terom@fixme.fi>
parents:
108
diff
changeset
|
115 |
_config_error_desc, |
55
6f7f6ae729d0
'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents:
41
diff
changeset
|
116 |
_module_error_desc, |
100
cfb7776bd6f0
improve the config module futher, now the module_desc interface uses structured config_value's
Tero Marttila <terom@fixme.fi>
parents:
83
diff
changeset
|
117 |
_lua_error_desc, |
138
a716c621cb90
implement blackhole filters for logwatch, and stop applying filters after the first hit
Tero Marttila <terom@fixme.fi>
parents:
134
diff
changeset
|
118 |
_pcre_error_desc, |
164
7847a7c3b678
remove ERR_READ_EOF, add more general errors, add missing _general_error_desc, and have error_name return for SUCCESS
Tero Marttila <terom@fixme.fi>
parents:
156
diff
changeset
|
119 |
_general_error_desc, |
30
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
120 |
NULL |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
121 |
}; |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
122 |
|
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
123 |
/** |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
124 |
* Look up the error_desc for the given error code |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
125 |
*/ |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
126 |
static const struct error_desc* error_lookup_desc (err_t code) |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
127 |
{ |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
128 |
struct error_desc **desc_table, *desc = NULL; |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
129 |
|
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
130 |
// iterate over each defined error_desc array |
41
40f7aa051acb
add line_proto test, enhance others
Tero Marttila <terom@fixme.fi>
parents:
37
diff
changeset
|
131 |
for (desc_table = _desc_tables; *desc_table; desc_table++) { |
30
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
132 |
for (desc = *desc_table; desc->code && desc->name; desc++) { |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
133 |
// compare code |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
134 |
if (desc->code == code) |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
135 |
// found |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
136 |
return desc; |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
137 |
} |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
138 |
} |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
139 |
|
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
140 |
// not found |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
141 |
return NULL; |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
142 |
} |
6 | 143 |
|
144 |
const char *error_name (err_t code) |
|
145 |
{ |
|
30
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
146 |
const struct error_desc *desc; |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
147 |
|
164
7847a7c3b678
remove ERR_READ_EOF, add more general errors, add missing _general_error_desc, and have error_name return for SUCCESS
Tero Marttila <terom@fixme.fi>
parents:
156
diff
changeset
|
148 |
if (!code) |
7847a7c3b678
remove ERR_READ_EOF, add more general errors, add missing _general_error_desc, and have error_name return for SUCCESS
Tero Marttila <terom@fixme.fi>
parents:
156
diff
changeset
|
149 |
// no error... |
7847a7c3b678
remove ERR_READ_EOF, add more general errors, add missing _general_error_desc, and have error_name return for SUCCESS
Tero Marttila <terom@fixme.fi>
parents:
156
diff
changeset
|
150 |
return "success"; |
7847a7c3b678
remove ERR_READ_EOF, add more general errors, add missing _general_error_desc, and have error_name return for SUCCESS
Tero Marttila <terom@fixme.fi>
parents:
156
diff
changeset
|
151 |
|
7847a7c3b678
remove ERR_READ_EOF, add more general errors, add missing _general_error_desc, and have error_name return for SUCCESS
Tero Marttila <terom@fixme.fi>
parents:
156
diff
changeset
|
152 |
else if ((desc = error_lookup_desc(code))) |
7847a7c3b678
remove ERR_READ_EOF, add more general errors, add missing _general_error_desc, and have error_name return for SUCCESS
Tero Marttila <terom@fixme.fi>
parents:
156
diff
changeset
|
153 |
// found an error_desc for it |
30
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
154 |
return desc->name; |
164
7847a7c3b678
remove ERR_READ_EOF, add more general errors, add missing _general_error_desc, and have error_name return for SUCCESS
Tero Marttila <terom@fixme.fi>
parents:
156
diff
changeset
|
155 |
|
30
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
156 |
else |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
157 |
// unknown |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
158 |
return "[unknown]"; |
6 | 159 |
} |
160 |
||
8
be88e543c8ff
split off line_proto, and make sock_stream_error return a const error_info
Tero Marttila <terom@fixme.fi>
parents:
7
diff
changeset
|
161 |
const char *error_msg (const struct error_info *err) |
7 | 162 |
{ |
163 |
static char msg[ERROR_MSG_MAXLEN]; |
|
30
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
164 |
const struct error_desc *desc; |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
165 |
|
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
166 |
// do we have an error_desc for it? |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
167 |
if ((desc = error_lookup_desc(err->code)) == NULL) |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
168 |
// ??? |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
169 |
snprintf(msg, ERROR_MSG_MAXLEN, "[%#.8x]: %#.8x", err->code, err->extra); |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
170 |
|
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
171 |
else |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
172 |
// intrepret .extra |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
173 |
switch (desc->extra_type) { |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
174 |
case ERR_EXTRA_NONE: |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
175 |
// no additional info |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
176 |
snprintf(msg, ERROR_MSG_MAXLEN, "%s", desc->name); |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
177 |
break; |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
178 |
|
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
179 |
case ERR_EXTRA_ERRNO: |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
180 |
// strerror |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
181 |
snprintf(msg, ERROR_MSG_MAXLEN, "%s: %s", desc->name, strerror(err->extra)); |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
182 |
break; |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
183 |
|
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
184 |
case ERR_EXTRA_GAI: |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
185 |
// gai_strerror |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
186 |
snprintf(msg, ERROR_MSG_MAXLEN, "%s: %s", desc->name, gai_strerror(err->extra)); |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
187 |
break; |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
188 |
|
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
189 |
case ERR_EXTRA_GNUTLS: |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
190 |
// gnutls_strerror |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
191 |
snprintf(msg, ERROR_MSG_MAXLEN, "%s: %s", desc->name, gnutls_strerror(err->extra)); |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
192 |
break; |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
193 |
|
56
942370000450
compiling, working, but still ugly module code
Tero Marttila <terom@fixme.fi>
parents:
55
diff
changeset
|
194 |
case ERR_EXTRA_STR: |
942370000450
compiling, working, but still ugly module code
Tero Marttila <terom@fixme.fi>
parents:
55
diff
changeset
|
195 |
// static error message string |
942370000450
compiling, working, but still ugly module code
Tero Marttila <terom@fixme.fi>
parents:
55
diff
changeset
|
196 |
snprintf(msg, ERROR_MSG_MAXLEN, "%s: %s", desc->name, err->extra_str); |
942370000450
compiling, working, but still ugly module code
Tero Marttila <terom@fixme.fi>
parents:
55
diff
changeset
|
197 |
break; |
942370000450
compiling, working, but still ugly module code
Tero Marttila <terom@fixme.fi>
parents:
55
diff
changeset
|
198 |
|
30
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
199 |
default: |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
200 |
// ??? |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
201 |
snprintf(msg, ERROR_MSG_MAXLEN, "%s: %#.8x", desc->name, err->extra); |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
202 |
break; |
7f8dd120933f
rework error to use a struct error_desc, and move ERR_SOCK/ERR_GNUTLS definitions to sock.h/sock_gnutls.h. error_desc definitions are still in error.c, though :(
Tero Marttila <terom@fixme.fi>
parents:
10
diff
changeset
|
203 |
} |
7 | 204 |
|
205 |
// return static pointer |
|
206 |
return msg; |
|
207 |
} |
|
208 |