Fix more whitespaces
This commit is contained in:
parent
585882edd2
commit
917b68f28c
@ -26,3 +26,4 @@
|
||||
void base64enc(char *dst, const void* src, size_t count);
|
||||
|
||||
#endif
|
||||
|
||||
|
10
src/reqs.c
10
src/reqs.c
@ -1255,7 +1255,7 @@ static void relay_connection (struct conn_s *connptr)
|
||||
if (ret != 0) {
|
||||
log_message(LOG_ERR,
|
||||
"Failed to set client socket to blocking: %s",
|
||||
strerror (errno));
|
||||
strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1298,6 +1298,7 @@ connect_to_upstream_proxy(struct conn_s *connptr, struct request_s *request)
|
||||
ulen = cur_upstream->ua.user ? strlen(cur_upstream->ua.user) : 0;
|
||||
passlen = cur_upstream->pass ? strlen(cur_upstream->pass) : 0;
|
||||
|
||||
|
||||
log_message(LOG_CONN,
|
||||
"Established connection to %s proxy \"%s\" using file descriptor %d.",
|
||||
proxy_type_name (cur_upstream->type), cur_upstream->host, connptr->server_fd);
|
||||
@ -1307,16 +1308,19 @@ connect_to_upstream_proxy(struct conn_s *connptr, struct request_s *request)
|
||||
buff[0] = 4; /* socks version */
|
||||
buff[1] = 1; /* connect command */
|
||||
port = htons(request->port);
|
||||
memcpy (&buff[2], &port, 2); /* dest port */
|
||||
memcpy(&buff[2], &port, 2); /* dest port */
|
||||
host = gethostbyname(request->host);
|
||||
memcpy (&buff[4], host->h_addr_list[0], 4); /* dest ip */
|
||||
memcpy(&buff[4], host->h_addr_list[0], 4); /* dest ip */
|
||||
buff[8] = 0; /* user */
|
||||
if (9 != safe_write(connptr->server_fd, buff, 9))
|
||||
return -1;
|
||||
if (8 != safe_read(connptr->server_fd, buff, 8))
|
||||
return -1;
|
||||
if (buff[0]!=0 || buff[1]!=90)
|
||||
return -1;
|
||||
|
||||
} else if (cur_upstream->type == PT_SOCKS5) {
|
||||
|
||||
/* init */
|
||||
int n_methods = ulen ? 2 : 1;
|
||||
buff[0] = 5; /* socks version */
|
||||
|
@ -145,7 +145,7 @@ static char *get_hostip (int *lookup_err, char *host, in_addr_t ip,
|
||||
}
|
||||
|
||||
const char *
|
||||
proxy_type_name (proxy_type type)
|
||||
proxy_type_name(proxy_type type)
|
||||
{
|
||||
switch (type) {
|
||||
case PT_NONE: return "none";
|
||||
@ -246,7 +246,7 @@ static struct upstream *upstream_build (const struct upstream_proxy_list *plist,
|
||||
up->ip = up->mask = 0;
|
||||
if (user) {
|
||||
if (type == PT_HTTP) {
|
||||
char b[BASE64ENC_BYTES((256+2) - 1) + 1];
|
||||
char b[BASE64ENC_BYTES((256+2)-1) + 1];
|
||||
ssize_t ret;
|
||||
ret = basicauth_string(user, pass, b, sizeof b);
|
||||
if (ret == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user