comparison libpurple/sslconn.c @ 18968:1677ead39ee3

- Add purple_ssl_strerror for handy error description power!
author William Ehlhardt <williamehlhardt@gmail.com>
date Wed, 27 Jun 2007 04:56:21 +0000
parents db67f6b39b72
children 90d8d8bb395a
comparison
equal deleted inserted replaced
18967:cf3d2780138e 18968:1677ead39ee3
154 gsc->recv_cb = func; 154 gsc->recv_cb = func;
155 155
156 gsc->inpa = purple_input_add(gsc->fd, PURPLE_INPUT_READ, recv_cb, gsc); 156 gsc->inpa = purple_input_add(gsc->fd, PURPLE_INPUT_READ, recv_cb, gsc);
157 } 157 }
158 158
159 const gchar *
160 purple_ssl_strerror(PurpleSslErrorType error)
161 {
162 switch(error) {
163 case PURPLE_SSL_CONNECT_FAILED:
164 return _("SSL Connection Failed");
165 case PURPLE_SSL_HANDSHAKE_FAILED:
166 return _("SSL Handshake Failed");
167 case PURPLE_SSL_CERTIFICATE_INVALID:
168 return _("SSL peer presented an invalid certificate");
169 default:
170 purple_debug_warning("sslconn", "Unknown SSL error code %d\n", error);
171 return _("Unknown SSL error");
172 }
173 }
174
159 PurpleSslConnection * 175 PurpleSslConnection *
160 purple_ssl_connect_fd(PurpleAccount *account, int fd, 176 purple_ssl_connect_fd(PurpleAccount *account, int fd,
161 PurpleSslInputFunction func, 177 PurpleSslInputFunction func,
162 PurpleSslErrorFunction error_func, 178 PurpleSslErrorFunction error_func,
163 void *data) 179 void *data)