Skip to content

Commit

Permalink
Doc.
Browse files Browse the repository at this point in the history
Correction from Nelson Beebe: argument to functions such as isspace()
must be an int, not a char.  This could cause sign-extension problems.
  • Loading branch information
Martin Pool committed Apr 9, 2002
1 parent 07a874f commit a7dc44d
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@
#include "rsync.h"


/* Establish a proxy connection on an open socket to a web roxy by
* using the CONNECT method. */
/**
* Establish a proxy connection on an open socket to a web proxy by
* using the HTTP CONNECT method.
**/
static int establish_proxy_connection(int fd, char *host, int port)
{
char buffer[1024];
Expand Down Expand Up @@ -68,7 +70,7 @@ static int establish_proxy_connection(int fd, char *host, int port)
buffer);
return -1;
}
for (cp = &buffer[5]; isdigit(*cp) || (*cp == '.'); cp++)
for (cp = &buffer[5]; isdigit((int) *cp) || (*cp == '.'); cp++)
;
while (*cp == ' ')
cp++;
Expand Down Expand Up @@ -494,9 +496,9 @@ struct



/****************************************************************************
set user socket options
****************************************************************************/
/**
* Set user socket options
**/
void set_socket_options(int fd, char *options)
{
char *tok;
Expand Down Expand Up @@ -554,9 +556,9 @@ void set_socket_options(int fd, char *options)
free(options);
}

/****************************************************************************
become a daemon, discarding the controlling terminal
****************************************************************************/
/**
* Become a daemon, discarding the controlling terminal
**/
void become_daemon(void)
{
int i;
Expand Down Expand Up @@ -586,14 +588,15 @@ void become_daemon(void)
}


/*******************************************************************
this is like socketpair but uses tcp. It is used by the Samba
regression test code
The function guarantees that nobody else can attach to the socket,
or if they do that this function fails and the socket gets closed
returns 0 on success, -1 on failure
the resulting file descriptors are symmetrical
******************************************************************/
/**
* This is like socketpair but uses tcp. It is used by the Samba
* regression test code.
*
* The function guarantees that nobody else can attach to the socket,
* or if they do that this function fails and the socket gets closed
* returns 0 on success, -1 on failure the resulting file descriptors
* are symmetrical.
**/
static int socketpair_tcp(int fd[2])
{
int listener;
Expand Down

0 comments on commit a7dc44d

Please sign in to comment.