aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2002-04-09 06:18:13 +0000
committerMartin Pool <mbp@samba.org>2002-04-09 06:18:13 +0000
commita7dc44d27d019f57d9ce484feb8d1a363464102b (patch)
treee6d45ff586273be500a55bfb05e9585ffe4a56e8 /socket.c
parent07a874fd9b990c4ea1e370d350fc77f9ecc171b5 (diff)
downloadandroid_external_rsync-a7dc44d27d019f57d9ce484feb8d1a363464102b.tar.gz
android_external_rsync-a7dc44d27d019f57d9ce484feb8d1a363464102b.tar.bz2
android_external_rsync-a7dc44d27d019f57d9ce484feb8d1a363464102b.zip
Doc.
Correction from Nelson Beebe: argument to functions such as isspace() must be an int, not a char. This could cause sign-extension problems.
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/socket.c b/socket.c
index 15dea8b8..6a13b04a 100644
--- a/socket.c
+++ b/socket.c
@@ -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];
@@ -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++;
@@ -494,9 +496,9 @@ struct
-/****************************************************************************
-set user socket options
-****************************************************************************/
+/**
+ * Set user socket options
+ **/
void set_socket_options(int fd, char *options)
{
char *tok;
@@ -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;
@@ -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;