1 |
#include <stdio.h> |
#include <stdio.h> |
|
#include <string.h> |
|
2 |
#include <unistd.h> |
#include <unistd.h> |
3 |
|
#include <string.h> |
4 |
#include <errno.h> |
#include <errno.h> |
|
#include <sys/types.h> |
|
|
#include <sys/socket.h> |
|
5 |
#include <netinet/in.h> |
#include <netinet/in.h> |
6 |
#include <netdb.h> |
#include <netdb.h> |
7 |
|
#include <sys/socket.h> |
8 |
|
#include <sys/types.h> /* IEEE Std 1003.1-2001 non-conformance. */ |
9 |
|
#include <sys/time.h> /* IEEE Std 1003.1-2001 non-conformance. */ |
10 |
|
#include <sys/select.h> |
11 |
#include <fcntl.h> |
#include <fcntl.h> |
12 |
|
|
13 |
#include "config.h" |
#include "config.h" |
16 |
#ifdef SSL_TLS |
#ifdef SSL_TLS |
17 |
#include <openssl/ssl.h> |
#include <openssl/ssl.h> |
18 |
#include <openssl/err.h> |
#include <openssl/err.h> |
|
#include <openssl/x509.h> |
|
19 |
#endif |
#endif |
20 |
|
|
21 |
|
|
44 |
|
|
45 |
memset((char *)&sa, 0, sizeof(struct sockaddr_in)); |
memset((char *)&sa, 0, sizeof(struct sockaddr_in)); |
46 |
|
|
47 |
conn->sock = socket(PF_INET, SOCK_STREAM, 0); |
conn->sock = socket(AF_INET, SOCK_STREAM, 0); |
48 |
|
|
49 |
if (conn->sock < 0) { |
if (conn->sock < 0) { |
50 |
error("create socket; %s\n", strerror(errno)); |
error("create socket; %s\n", strerror(errno)); |