103 |
|
|
104 |
|
|
105 |
/* Basic64 encode the input @inbuf to @outbuf. */ |
/* Basic64 encode the input @inbuf to @outbuf. */ |
106 |
|
#if 0 |
107 |
static void |
static void |
108 |
base64_encode (const char *inbuf, char *outbuf) |
base64_encode (const char *inbuf, char *outbuf) |
109 |
{ |
{ |
146 |
|
|
147 |
outbuf[len] = '\0'; |
outbuf[len] = '\0'; |
148 |
} |
} |
149 |
|
#endif |
150 |
|
|
151 |
/* Check that the given buffer contains a valid keyserver URL |
/* Check that the given buffer contains a valid keyserver URL |
152 |
and return the prefix length, 0 in case of an error. */ |
and return the prefix length, 0 in case of an error. */ |
574 |
|
|
575 |
|
|
576 |
/* Update the keyserver proxy user. */ |
/* Update the keyserver proxy user. */ |
577 |
|
#if 0 |
578 |
static void |
static void |
579 |
update_proxy_user (const char *proxy_user, const char *proxy_pass) |
update_proxy_user (const char *proxy_user, const char *proxy_pass) |
580 |
{ |
{ |
591 |
proxy.user = m_strdup (proxy_user); |
proxy.user = m_strdup (proxy_user); |
592 |
proxy.pass = m_strdup (proxy_pass); |
proxy.pass = m_strdup (proxy_pass); |
593 |
} |
} |
594 |
|
#endif |
595 |
|
|
596 |
/* Set the default keyserver. The position is always one. */ |
/* Set the default keyserver. The position is always one. */ |
597 |
void |
void |
623 |
} |
} |
624 |
|
|
625 |
|
|
626 |
/* Skip all kind of whitespace chars in @str. |
/* Skip all kind of whitespace chars in @str. */ |
627 |
|
#if 0 |
628 |
static const char* |
static const char* |
629 |
skip_whitespace (const char *str) |
skip_whitespace (const char *str) |
630 |
{ |
{ |
639 |
break; |
break; |
640 |
} |
} |
641 |
return str; |
return str; |
642 |
}*/ |
} |
643 |
|
#endif |
644 |
|
|
645 |
|
|
646 |
/* Return the specified keyserver config setting @key as an integer. */ |
/* Return the specified keyserver config setting @key as an integer. */ |
647 |
|
#if 0 |
648 |
static int |
static int |
649 |
get_conf_kserver_int (const char *key) |
get_conf_kserver_int (const char *key) |
650 |
{ |
{ |
657 |
free_if_alloc (p); |
free_if_alloc (p); |
658 |
return val; |
return val; |
659 |
} |
} |
660 |
|
#endif |
661 |
|
|
662 |
/* Read the proxy configuration and store it into @prox. */ |
/* Read the proxy configuration and store it into @prox. */ |
663 |
|
#if 0 |
664 |
static void |
static void |
665 |
read_proxy_config (keyserver_proxy_t prox) |
read_proxy_config (keyserver_proxy_t prox) |
666 |
{ |
{ |
687 |
|
|
688 |
prox->port = get_conf_kserver_int ("Port"); |
prox->port = get_conf_kserver_int ("Port"); |
689 |
} |
} |
690 |
|
#endif |
691 |
|
|
692 |
|
|
693 |
static int |
static int |
781 |
return use_proxy? WPTERR_WINSOCK_PROXY : WPTERR_WINSOCK_RESOLVE; |
return use_proxy? WPTERR_WINSOCK_PROXY : WPTERR_WINSOCK_RESOLVE; |
782 |
} |
} |
783 |
fd = socket (AF_INET, SOCK_STREAM, 0); |
fd = socket (AF_INET, SOCK_STREAM, 0); |
784 |
if (fd == INVALID_SOCKET) |
if (fd == (int)INVALID_SOCKET) |
785 |
return WPTERR_WINSOCK_SOCKET; |
return WPTERR_WINSOCK_SOCKET; |
786 |
rc = connect (fd, (struct sockaddr *) &sock, sizeof (sock)); |
rc = connect (fd, (struct sockaddr *) &sock, sizeof (sock)); |
787 |
if (rc == SOCKET_ERROR) { |
if (rc == SOCKET_ERROR) { |