|
System | : | Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686 |
Software | : | Apache. PHP/5.3.6-13ubuntu3.10 |
ID | : | uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
|
|
Safe Mode | : | OFF |
Open_Basedir | : | OFF |
Freespace | : | 23.66 GB of 70.42 GB (33.6%) |
|
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON |
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
|
[ System Info ]
[ Processes ]
[ SQL Manager ]
[ Eval ]
[ Encoder ]
[ Mailer ]
[ Back Connection ]
[ Backdoor Server ]
[ Kernel Exploit Search ]
[ MD5 Decrypter ]
[ Reverse IP ]
[ Kill Shell ]
[ FTP Brute-Force ]
|
|
/
usr/
src/
courier-0.66.1/
soxwrap/
- drwxrwxrwx
|
Viewing file: sconnect.c (1.99 KB) -rw-rw-rw-Select action/file-type:  ( +) |  ( +) |  ( +) | Code ( +) | Session ( +) |  ( +) | SDB ( +) |  ( +) |  ( +) |  ( +) |  ( +) |  ( +) |
/* ** Copyright 2001 Double Precision, Inc. ** See COPYING for distribution information. */
#include "sconnect.h"
#if HAVE_UNISTD_H #include <unistd.h> #endif #if HAVE_FCNTL_H #include <fcntl.h> #endif #include <stdio.h> #include <errno.h> #include <string.h>
#include "soxwrap.h"
int s_connect(int sockfd, const struct sockaddr *addr, size_t addr_s, time_t connect_timeout) { fd_set fdr; struct timeval tv; int rc;
#ifdef SOL_KEEPALIVE setsockopt(sockfd, SOL_SOCKET, SOL_KEEPALIVE, (const char *)&dummy, sizeof(dummy)); #endif
#ifdef SOL_LINGER { struct linger l;
l.l_onoff=0; l.l_linger=0;
setsockopt(sockfd, SOL_SOCKET, SOL_LINGER, (const char *)&l, sizeof(l)); } #endif
/* ** If configuration says to use the kernel's timeout settings, ** just call connect, and be done with it. */
if (connect_timeout == 0) return ( sox_connect(sockfd, addr, addr_s));
/* Asynchronous connect with timeout. */
if (fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) return (-1);
if ( sox_connect(sockfd, addr, addr_s) == 0) { /* That was easy, we're done. */
if (fcntl(sockfd, F_SETFL, 0) < 0) return (-1); return (0); } else if (errno != EINPROGRESS) return (-1);
/* Wait for the connection to go through, until the timeout expires */
FD_ZERO(&fdr); FD_SET(sockfd, &fdr); tv.tv_sec=connect_timeout; tv.tv_usec=0;
rc=sox_select(sockfd+1, 0, &fdr, 0, &tv); if (rc < 0) return (-1);
if (!FD_ISSET(sockfd, &fdr)) { errno=ETIMEDOUT; return (-1); }
{ int gserr; socklen_t gslen = sizeof(gserr);
if (sox_getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (char *)&gserr, &gslen)==0) { if (gserr == 0) return 0;
errno=gserr; } } return (-1); }
|