equal
deleted
inserted
replaced
1 |
1 |
2 #include "sock_gnutls.h" |
2 #include "sock_gnutls.h" |
3 |
3 |
4 #include <stdlib.h> |
4 #include <stdlib.h> |
5 #include <err.h> |
5 #include <err.h> |
6 |
|
7 static void _sock_gnutls_error (struct sock_gnutls *sock, const char *func, int _err) { |
|
8 if (_err == GNUTLS_E_FATAL_ALERT_RECEIVED) |
|
9 errx(1, "%s: %s: %s", func, gnutls_strerror(_err), gnutls_alert_get_name(gnutls_alert_get(sock->session))); |
|
10 |
|
11 else |
|
12 errx(1, "%s: %s", func, gnutls_strerror(_err)); |
|
13 } |
|
14 |
6 |
15 static err_t sock_gnutls_read (struct sock_stream *base_sock, void *buf, size_t len) |
7 static err_t sock_gnutls_read (struct sock_stream *base_sock, void *buf, size_t len) |
16 { |
8 { |
17 struct sock_gnutls *sock = SOCK_FROM_BASE(base_sock, struct sock_gnutls); |
9 struct sock_gnutls *sock = SOCK_FROM_BASE(base_sock, struct sock_gnutls); |
18 |
10 |