cl->error_code = 0;
uloop_timeout_cancel(&cl->timeout);
}
+
+const char * uclient_strerror(unsigned err)
+{
+ switch (err) {
+ case UCLIENT_ERROR_UNKNOWN:
+ return "unknown error";
+ case UCLIENT_ERROR_CONNECT:
+ return "connect failed";
+ case UCLIENT_ERROR_TIMEDOUT:
+ return "timeout";
+ case UCLIENT_ERROR_SSL_INVALID_CERT:
+ return "ssl invalid cert";
+ case UCLIENT_ERROR_SSL_CN_MISMATCH:
+ return "ssl cn mismatch";
+ case UCLIENT_ERROR_MISSING_SSL_CONTEXT:
+ return "missing ssl context";
+ default:
+ return "invalid error code";
+ }
+}
UCLIENT_ERROR_SSL_INVALID_CERT,
UCLIENT_ERROR_SSL_CN_MISMATCH,
UCLIENT_ERROR_MISSING_SSL_CONTEXT,
+ __UCLIENT_ERROR_MAX
};
union uclient_addr {
int uclient_http_set_ssl_ctx(struct uclient *cl, const struct ustream_ssl_ops *ops,
struct ustream_ssl_ctx *ctx, bool require_validation);
int uclient_http_set_address_family(struct uclient *cl, int af);
+const char *uclient_strerror(unsigned err);
#endif