Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions | Variables
strsclnt.c File Reference
#include <stdio.h>
#include <string.h>
#include "secutil.h"
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include "plgetopt.h"
#include "nspr.h"
#include "prio.h"
#include "prnetdb.h"
#include "prerror.h"
#include "pk11func.h"
#include "secitem.h"
#include "sslproto.h"
#include "nss.h"
#include "ssl.h"

Go to the source code of this file.

Classes

struct  perThreadStr
struct  lockedVarsStr
struct  cert_and_key

Defines

#define PORT_Sprintf   sprintf
#define PORT_Strstr   strstr
#define PORT_Malloc   PR_Malloc
#define RD_BUF_SIZE   (60 * 1024)
#define NO_FULLHS_PERCENTAGE   -1
#define PRINTF   if (verbose) printf
#define FPRINTF   if (verbose) fprintf
#define MAX_THREADS   128
#define USE_SOCK_PEER_ID   1
#define h_addr   h_addr_list[0] /* address, for backward compatibility */
#define HEXCHAR_TO_INT(c, i)

Typedefs

typedef int startFn (void *a, void *b, int c)
typedef struct perThreadStr perThread
typedef struct lockedVarsStr

Functions

char * ownPasswd (PK11SlotInfo *slot, PRBool retry, void *arg)
static void Usage (const char *progName)
static void errWarn (char *funcString)
static void errExit (char *funcString)
void disableAllSSLCiphers (void)
static SECStatus myGoodSSLAuthCertificate (void *arg, PRFileDesc *fd, PRBool checkSig, PRBool isServer)
static SECStatus mySSLAuthCertificate (void *arg, PRFileDesc *fd, PRBool checkSig, PRBool isServer)
static SECStatus myBadCertHandler (void *arg, PRFileDesc *fd)
void printSecurityInfo (PRFileDesc *fd)
void thread_wrapper (void *arg)
SECStatus launch_thread (startFn *startFunc, void *a, void *b, int tid)
int reap_threads (void)
void destroy_thread_data (void)
void init_thread_data (void)
void lockedVars_Init (lockedVars *lv)
void lockedVars_Destroy (lockedVars *lv)
void lockedVars_WaitForDone (lockedVars *lv)
int lockedVars_AddToCount (lockedVars *lv, int addend)
int do_writes (void *a, void *b, int c)
int handle_fdx_connection (PRFileDesc *ssl_sock, int connection)
SECStatus handle_connection (PRFileDesc *ssl_sock, int tid)
SECStatus myHandshakeCallback (PRFileDesc *socket, void *arg)
int do_connects (void *a, void *b, int tid)
PRUint32 getIPAddress (const char *hostName)
PRBool FindCertAndKey (cert_and_key *Cert_And_Key)
PRBool LoggedIn (CERTCertificate *cert, SECKEYPrivateKey *key)
SECStatus StressClient_GetClientAuthData (void *arg, PRFileDesc *socket, struct CERTDistNamesStr *caNames, struct CERTCertificateStr **pRetCert, struct SECKEYPrivateKeyStr **pRetKey)
void client_main (unsigned short port, int connections, cert_and_key *Cert_And_Key, const char *hostName)
SECStatus readBigFile (const char *fileName)
int main (int argc, char **argv)
 The Xalan testcases app.

Variables

int ssl2CipherSuites []
int ssl3CipherSuites []
static const char * cipherString
static PRInt32 certsTested
static int MakeCertOK
static int NoReuse
static int fullhs = NO_FULLHS_PERCENTAGE
static PRInt32 globalconid = 0
static int total_connections
static int total_connections_rounded_down_to_hundreds
static int total_connections_modulo_100
static PRBool NoDelay
static PRBool QuitOnTimeout = PR_FALSE
static PRBool ThrottleUp = PR_FALSE
static PRLockthreadLock
static PRTime lastConnectFailure
static PRTime lastConnectSuccess
static PRTime lastThrottleUp
static PRInt32 remaining_connections
static int active_threads = 8
static PRInt32 numUsed
static SSL3Statisticsssl3stats
static int failed_already = 0
static PRBool disableSSL2 = PR_FALSE
static PRBool disableSSL3 = PR_FALSE
static PRBool disableTLS = PR_FALSE
static PRBool bypassPKCS11 = PR_FALSE
static PRBool disableLocking = PR_FALSE
static PRBool ignoreErrors = PR_FALSE
PRIntervalTime maxInterval = PR_INTERVAL_NO_TIMEOUT
int stopping
int verbose
SECItem bigBuf
static PRInt32 numConnected
static int max_threads
perThread threads [MAX_THREADS]
PRBool useModelSocket = PR_TRUE
static const char stopCmd [] = { "GET /stop " }
static const char outHeader []
const char request [] = {"GET /abc HTTP/1.0\r\n\r\n" }
PRInt32 lastFullHandshakePeerID

Class Documentation

struct perThreadStr

Definition at line 470 of file selfserv.c.

Collaboration diagram for perThreadStr:
Class Members
void * a
PRFileDesc * a
int b
void * b
PRFileDesc * b
int c
PRBool inUse
PRThread * prThread
runState running
int rv
startFn * startFunc
runState state
int tid
struct lockedVarsStr

Definition at line 153 of file sslsample.h.

Collaboration diagram for lockedVarsStr:
Class Members
PRCondVar * condVar
int count
PRLock * lock
int waiters
struct cert_and_key

Definition at line 902 of file strsclnt.c.

Collaboration diagram for cert_and_key:
Class Members
CERTCertificate * cert
SECKEYPrivateKey * key
PRLock * lock
char * nickname
char * password

Define Documentation

Definition at line 181 of file strsclnt.c.

#define h_addr   h_addr_list[0] /* address, for backward compatibility */
#define HEXCHAR_TO_INT (   c,
  i 
)
Value:
if (((c) >= '0') && ((c) <= '9')) { \
       i = (c) - '0'; \
    } else if (((c) >= 'a') && ((c) <= 'f')) { \
       i = (c) - 'a' + 10; \
    } else if (((c) >= 'A') && ((c) <= 'F')) { \
       i = (c) - 'A' + 10; \
    } else { \
       Usage("strsclnt"); \
    }

Definition at line 1096 of file strsclnt.c.

#define MAX_THREADS   128

Definition at line 365 of file strsclnt.c.

Definition at line 121 of file strsclnt.c.

Definition at line 73 of file strsclnt.c.

#define PORT_Sprintf   sprintf

Definition at line 65 of file strsclnt.c.

#define PORT_Strstr   strstr

Definition at line 69 of file strsclnt.c.

Definition at line 180 of file strsclnt.c.

#define RD_BUF_SIZE   (60 * 1024)

Definition at line 76 of file strsclnt.c.

Definition at line 732 of file strsclnt.c.


Typedef Documentation

typedef struct lockedVarsStr

Definition at line 543 of file strsclnt.c.

typedef struct perThreadStr perThread
typedef int startFn(void *a, void *b, int c)

Definition at line 367 of file strsclnt.c.


Function Documentation

void client_main ( unsigned short  port,
int  connections,
cert_and_key Cert_And_Key,
const char *  hostName 
)

Definition at line 1108 of file strsclnt.c.

{
    PRFileDesc *model_sock  = NULL;
    int         i;
    int         rv;
    PRUint32  ipAddress;    /* in host byte order */
    PRNetAddr   addr;

    /* Assemble NetAddr struct for connections. */
    ipAddress = getIPAddress(hostName);

    addr.inet.family = PR_AF_INET;
    addr.inet.port   = PR_htons(port);
    addr.inet.ip     = PR_htonl(ipAddress);

    /* all suites except RSA_NULL_MD5 are enabled by Domestic Policy */
    NSS_SetDomesticPolicy();

    /* all the SSL2 and SSL3 cipher suites are enabled by default. */
    if (cipherString) {
        int ndx;

        /* disable all the ciphers, then enable the ones we want. */
        disableAllSSLCiphers();

        while (0 != (ndx = *cipherString++)) {
            int  cipher;

           if (ndx == ':') {
              int ctmp;

              cipher = 0;
              HEXCHAR_TO_INT(*cipherString, ctmp)
              cipher |= (ctmp << 12);
              cipherString++;
              HEXCHAR_TO_INT(*cipherString, ctmp)
              cipher |= (ctmp << 8);
              cipherString++;
              HEXCHAR_TO_INT(*cipherString, ctmp)
              cipher |= (ctmp << 4);
              cipherString++;
              HEXCHAR_TO_INT(*cipherString, ctmp)
              cipher |= ctmp;
              cipherString++;
           } else {
              const int *cptr;

              if (! isalpha(ndx))
                  Usage("strsclnt");
              cptr = islower(ndx) ? ssl3CipherSuites : ssl2CipherSuites;
              for (ndx &= 0x1f; (cipher = *cptr++) != 0 && --ndx > 0; ) 
                  /* do nothing */;
           }
            if (cipher > 0) {
              SECStatus rv;
                rv = SSL_CipherPrefSetDefault(cipher, PR_TRUE);
              if (rv != SECSuccess) {
                  fprintf(stderr, 
              "strsclnt: SSL_CipherPrefSetDefault failed with value 0x%04x\n",
                         cipher);
                  exit(1);
              }
            } else {
              Usage("strsclnt");
            }
        }
    }

    /* configure model SSL socket. */

    model_sock = PR_NewTCPSocket();
    if (model_sock == NULL) {
       errExit("PR_NewTCPSocket on model socket");
    }

    model_sock = SSL_ImportFD(NULL, model_sock);
    if (model_sock == NULL) {
       errExit("SSL_ImportFD");
    }

    /* do SSL configuration. */

    rv = SSL_OptionSet(model_sock, SSL_SECURITY, 1);
    if (rv < 0) {
       errExit("SSL_OptionSet SSL_SECURITY");
    }

    /* disabling SSL2 compatible hellos also disables SSL2 */
    rv = SSL_OptionSet(model_sock, SSL_V2_COMPATIBLE_HELLO, !disableSSL2);
    if (rv != SECSuccess) {
       errExit("error enabling SSLv2 compatible hellos ");
    }

    rv = SSL_OptionSet(model_sock, SSL_ENABLE_SSL3, !disableSSL3);
    if (rv != SECSuccess) {
       errExit("error enabling SSLv3 ");
    }

    rv = SSL_OptionSet(model_sock, SSL_ENABLE_TLS, !disableTLS);
    if (rv != SECSuccess) {
       errExit("error enabling TLS ");
    }

    if (bigBuf.data) { /* doing FDX */
       rv = SSL_OptionSet(model_sock, SSL_ENABLE_FDX, 1);
       if (rv < 0) {
           errExit("SSL_OptionSet SSL_ENABLE_FDX");
       }
    }

    if (NoReuse) {
       rv = SSL_OptionSet(model_sock, SSL_NO_CACHE, 1);
       if (rv < 0) {
           errExit("SSL_OptionSet SSL_NO_CACHE");
       }
    }

    if (bypassPKCS11) {
       rv = SSL_OptionSet(model_sock, SSL_BYPASS_PKCS11, 1);
       if (rv < 0) {
           errExit("SSL_OptionSet SSL_BYPASS_PKCS11");
       }
    }

    if (disableLocking) {
        rv = SSL_OptionSet(model_sock, SSL_NO_LOCKS, 1);
       if (rv < 0) {
           errExit("SSL_OptionSet SSL_NO_LOCKS");
       }
    }

    SSL_SetURL(model_sock, hostName);

    SSL_AuthCertificateHook(model_sock, mySSLAuthCertificate, 
                     (void *)CERT_GetDefaultCertDB());
    SSL_BadCertHook(model_sock, myBadCertHandler, NULL);

    SSL_GetClientAuthDataHook(model_sock, StressClient_GetClientAuthData, (void*)Cert_And_Key);

    /* I'm not going to set the HandshakeCallback function. */

    /* end of ssl configuration. */

    init_thread_data();

    remaining_connections = total_connections = connections;
    total_connections_modulo_100 = total_connections % 100;
    total_connections_rounded_down_to_hundreds =
        total_connections - total_connections_modulo_100;

    if (!NoReuse) {
        remaining_connections = 1;
       rv = launch_thread(do_connects, &addr, model_sock, 0);
       /* wait for the first connection to terminate, then launch the rest. */
       reap_threads();
        remaining_connections = total_connections - 1 ;
    }
    if (remaining_connections > 0) {
        active_threads  = PR_MIN(active_threads, remaining_connections);
       /* Start up the threads */
       for (i=0;i<active_threads;i++) {
           rv = launch_thread(do_connects, &addr, model_sock, i);
       }
       reap_threads();
    }
    destroy_thread_data();

    PR_Close(model_sock);
}

Here is the call graph for this function:

Definition at line 505 of file strsclnt.c.

Here is the call graph for this function:

Definition at line 233 of file strsclnt.c.

{
    const PRUint16 *cipherSuites = SSL_ImplementedCiphers;
    int             i            = SSL_NumImplementedCiphers;
    SECStatus       rv;

    /* disable all the SSL3 cipher suites */
    while (--i >= 0) {
       PRUint16 suite = cipherSuites[i];
        rv = SSL_CipherPrefSetDefault(suite, PR_FALSE);
       if (rv != SECSuccess) {
           printf("SSL_CipherPrefSetDefault didn't like value 0x%04x (i = %d)\n",
                 suite, i);
           errWarn("SSL_CipherPrefSetDefault");
           exit(2);
       }
    }
}

Here is the call graph for this function:

int do_connects ( void a,
void b,
int  tid 
)

Definition at line 751 of file strsclnt.c.

{
    PRNetAddr  *        addr              = (PRNetAddr *)  a;
    PRFileDesc *        model_sock = (PRFileDesc *) b;
    PRFileDesc *        ssl_sock   = 0;
    PRFileDesc *        tcp_sock   = 0;
    PRStatus          prStatus;
    PRUint32            sleepInterval     = 50; /* milliseconds */
    SECStatus        result;
    int                 rv         = SECSuccess;
    PRSocketOptionData  opt;

retry:

    tcp_sock = PR_NewTCPSocket();
    if (tcp_sock == NULL) {
       errExit("PR_NewTCPSocket");
    }

    opt.option             = PR_SockOpt_Nonblocking;
    opt.value.non_blocking = PR_FALSE;
    prStatus = PR_SetSocketOption(tcp_sock, &opt);
    if (prStatus != PR_SUCCESS) {
       errWarn("PR_SetSocketOption(PR_SockOpt_Nonblocking, PR_FALSE)");
       PR_Close(tcp_sock);
       return SECSuccess;
    } 

    if (NoDelay) {
       opt.option         = PR_SockOpt_NoDelay;
       opt.value.no_delay = PR_TRUE;
       prStatus = PR_SetSocketOption(tcp_sock, &opt);
       if (prStatus != PR_SUCCESS) {
           errWarn("PR_SetSocketOption(PR_SockOpt_NoDelay, PR_TRUE)");
           PR_Close(tcp_sock);
           return SECSuccess;
       } 
    }

    prStatus = PR_Connect(tcp_sock, addr, PR_INTERVAL_NO_TIMEOUT);
    if (prStatus != PR_SUCCESS) {
        PRErrorCode err = PR_GetError(); /* save error code */
        if (ThrottleUp) {
            PRTime now = PR_Now();
            PR_Lock(threadLock);
            lastConnectFailure = PR_MAX(now, lastConnectFailure);
            PR_Unlock(threadLock);
        }
        if ((err == PR_CONNECT_REFUSED_ERROR) || 
           (err == PR_CONNECT_RESET_ERROR)      ) {
           int connections = numConnected;

           PR_Close(tcp_sock);
            PR_Lock(threadLock);
            if (connections > 2 && active_threads >= connections) {
                active_threads = connections - 1;
                fprintf(stderr,"active_threads set down to %d\n",
                        active_threads);
            }
            PR_Unlock(threadLock);

            if (QuitOnTimeout && sleepInterval > 40000) {
                fprintf(stderr,
                   "strsclnt: Client timed out waiting for connection to server.\n");
                exit(1);
            }
           PR_Sleep(PR_MillisecondsToInterval(sleepInterval));
           sleepInterval <<= 1;
           goto retry;
       }
       errWarn("PR_Connect");
       rv = SECFailure;
       goto done;
    } else {
        if (ThrottleUp) {
            PRTime now = PR_Now();
            PR_Lock(threadLock);
            lastConnectSuccess = PR_MAX(now, lastConnectSuccess);
            PR_Unlock(threadLock);
        }
    }

    ssl_sock = SSL_ImportFD(model_sock, tcp_sock);
    /* XXX if this import fails, close tcp_sock and return. */
    if (!ssl_sock) {
       PR_Close(tcp_sock);
       return SECSuccess;
    }
    if (fullhs != NO_FULLHS_PERCENTAGE) {
#ifdef USE_SOCK_PEER_ID
        char sockPeerIDString[512];
        static PRInt32 sockPeerID = 0; /* atomically incremented */
        PRInt32 thisPeerID;
#endif
        PRInt32 savid = PR_AtomicIncrement(&globalconid);
        PRInt32 conid = 1 + (savid - 1) % 100;
        /* don't change peer ID on the very first handshake, which is always
           a full, so the session gets stored into the client cache */
        if ( (savid != 1) &&
            ( ( (savid <= total_connections_rounded_down_to_hundreds) &&
                (conid <= fullhs) ) ||
              (conid*100 <= total_connections_modulo_100*fullhs ) ) ) {
#ifdef USE_SOCK_PEER_ID
            /* force a full handshake by changing the socket peer ID */
            thisPeerID = PR_AtomicIncrement(&sockPeerID);
        } else {
            /* reuse previous sockPeerID for restart handhsake */
            thisPeerID = lastFullHandshakePeerID;
        }
        PR_snprintf(sockPeerIDString, sizeof(sockPeerIDString), "ID%d",
                    thisPeerID);
        SSL_SetSockPeerID(ssl_sock, sockPeerIDString);
        SSL_HandshakeCallback(ssl_sock, myHandshakeCallback, (void*)thisPeerID);
#else
            /* force a full handshake by setting the no cache option */
            SSL_OptionSet(ssl_sock, SSL_NO_CACHE, 1);
        }
#endif
    }
    rv = SSL_ResetHandshake(ssl_sock, /* asServer */ 0);
    if (rv != SECSuccess) {
       errWarn("SSL_ResetHandshake");
       goto done;
    }

    PR_AtomicIncrement(&numConnected);

    if (bigBuf.data != NULL) {
       result = handle_fdx_connection( ssl_sock, tid);
    } else {
       result = handle_connection( ssl_sock, tid);
    }

    PR_AtomicDecrement(&numConnected);

done:
    if (ssl_sock) {
       PR_Close(ssl_sock);
    } else if (tcp_sock) {
       PR_Close(tcp_sock);
    }
    return SECSuccess;
}

Here is the call graph for this function:

int do_writes ( void a,
void b,
int  c 
)

Definition at line 589 of file strsclnt.c.

{
    PRFileDesc *     ssl_sock      = (PRFileDesc *)a;
    lockedVars *     lv            = (lockedVars *)b;
    int                     sent          = 0;
    int              count         = 0;

    while (sent < bigBuf.len) {

       count = PR_Send(ssl_sock, bigBuf.data + sent, bigBuf.len - sent, 
                       0, maxInterval);
       if (count < 0) {
           errWarn("PR_Send bigBuf");
           break;
       }
       FPRINTF(stderr, "strsclnt: PR_Send wrote %d bytes from bigBuf\n", 
              count );
       sent += count;
    }
    if (count >= 0) {       /* last write didn't fail. */
       PR_Shutdown(ssl_sock, PR_SHUTDOWN_SEND);
    }

    /* notify the reader that we're done. */
    lockedVars_AddToCount(lv, -1);
    return (sent < bigBuf.len) ? SECFailure : SECSuccess;
}

Here is the call graph for this function:

static void errExit ( char *  funcString) [static]

Definition at line 220 of file strsclnt.c.

{
    errWarn(funcString);
    exit(1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void errWarn ( char *  funcString) [static]

Definition at line 210 of file strsclnt.c.

{
    PRErrorCode  perr      = PR_GetError();
    const char * errString = SECU_Strerror(perr);

    fprintf(stderr, "strsclnt: %s returned error %d:\n%s\n",
            funcString, perr, errString);
}

Here is the call graph for this function:

PRBool FindCertAndKey ( cert_and_key Cert_And_Key)

Definition at line 933 of file strsclnt.c.

{
    if ( (NULL == Cert_And_Key->nickname) || (0 == strcmp(Cert_And_Key->nickname,"none"))) {
        return PR_TRUE;
    }
    Cert_And_Key->cert = CERT_FindUserCertByUsage(CERT_GetDefaultCertDB(),
                            Cert_And_Key->nickname, certUsageSSLClient,
                            PR_FALSE, Cert_And_Key->password);
    if (Cert_And_Key->cert) {
        Cert_And_Key->key = PK11_FindKeyByAnyCert(Cert_And_Key->cert, Cert_And_Key->password);
    }
    if (Cert_And_Key->cert && Cert_And_Key->key) {
        return PR_TRUE;
    } else {
        return PR_FALSE;
    }
}

Here is the call graph for this function:

PRUint32 getIPAddress ( const char *  hostName)

Definition at line 903 of file strsclnt.c.

{
    const unsigned char *p;
    PRStatus           prStatus;
    PRUint32           rv;
    PRHostEnt          prHostEnt;
    char                 scratch[PR_NETDB_BUF_SIZE];

    prStatus = PR_GetHostByName(hostName, scratch, sizeof scratch, &prHostEnt);
    if (prStatus != PR_SUCCESS)
       errExit("PR_GetHostByName");

#undef  h_addr
#define h_addr  h_addr_list[0]   /* address, for backward compatibility */

    p = (const unsigned char *)(prHostEnt.h_addr); /* in Network Byte order */
    FPRINTF(stderr, "strsclnt: %s -> %d.%d.%d.%d\n", hostName, 
           p[0], p[1], p[2], p[3]);
    rv = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

SECStatus handle_connection ( PRFileDesc ssl_sock,
int  tid 
)

Definition at line 681 of file strsclnt.c.

{
    int           countRead = 0;
    PRInt32 rv;
    char    *buf;

    buf = PR_Malloc(RD_BUF_SIZE);
    if (!buf)
       return SECFailure;

    /* compose the http request here. */

    rv = PR_Send(ssl_sock, request, strlen(request), 0, maxInterval);
    if (rv <= 0) {
       errWarn("PR_Send");
       PR_Free(buf);
       buf = 0;
        failed_already = 1;
       return SECFailure;
    }
    printSecurityInfo(ssl_sock);

    /* read until EOF */
    while (1) {
       rv = PR_Recv(ssl_sock, buf, RD_BUF_SIZE, 0, maxInterval);
       if (rv == 0) {
           break;    /* EOF */
       }
       if (rv < 0) {
           errWarn("PR_Recv");
           failed_already = 1;
           break;
       }

       countRead += rv;
       FPRINTF(stderr,
                "strsclnt: connection on thread %d read %d bytes (%d total).\n",
              tid, rv, countRead );
    }
    PR_Free(buf);
    buf = 0;

    /* Caller closes the socket. */

    FPRINTF(stderr, 
    "strsclnt: connection on thread %d read %d bytes total. ---------\n", 
           tid, countRead);

    return SECSuccess;      /* success */
}

Here is the call graph for this function:

int handle_fdx_connection ( PRFileDesc ssl_sock,
int  connection 
)

Definition at line 621 of file strsclnt.c.

{
    SECStatus          result;
    int                firstTime = 1;
    int                countRead = 0;
    lockedVars         lv;
    char               *buf;


    lockedVars_Init(&lv);
    lockedVars_AddToCount(&lv, 1);

    /* Attempt to launch the writer thread. */
    result = launch_thread(do_writes, ssl_sock, &lv, connection);

    if (result != SECSuccess) 
       goto cleanup;

    buf = PR_Malloc(RD_BUF_SIZE);

    if (buf) {
       do {
           /* do reads here. */
           PRInt32 count;

           count = PR_Recv(ssl_sock, buf, RD_BUF_SIZE, 0, maxInterval);
           if (count < 0) {
              errWarn("PR_Recv");
              break;
           }
           countRead += count;
           FPRINTF(stderr, 
                  "strsclnt: connection %d read %d bytes (%d total).\n", 
                  connection, count, countRead );
           if (firstTime) {
              firstTime = 0;
              printSecurityInfo(ssl_sock);
           }
       } while (lockedVars_AddToCount(&lv, 0) > 0);
       PR_Free(buf);
       buf = 0;
    }

    /* Wait for writer to finish */
    lockedVars_WaitForDone(&lv);
    lockedVars_Destroy(&lv);

    FPRINTF(stderr, 
    "strsclnt: connection %d read %d bytes total. -----------------------\n", 
           connection, countRead);

cleanup:
    /* Caller closes the socket. */

    return SECSuccess;
}

Here is the call graph for this function:

Definition at line 516 of file strsclnt.c.

Here is the call graph for this function:

SECStatus launch_thread ( startFn startFunc,
void a,
void b,
int  tid 
)

Definition at line 447 of file strsclnt.c.

{
    PRUint32 i;
    perThread * slot;

    PR_Lock(threadLock);

    PORT_Assert(numUsed < MAX_THREADS);
    if (! (numUsed < MAX_THREADS)) {
        PR_Unlock(threadLock);
        return SECFailure;
    }

    i = numUsed++;
    slot = &threads[i];
    slot->a = a;
    slot->b = b;
    slot->tid = tid;

    slot->startFunc = startFunc;

    slot->prThread      = PR_CreateThread(PR_USER_THREAD,
                                      thread_wrapper, slot,
                                  PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
                                  PR_JOINABLE_THREAD, 0);
    if (slot->prThread == NULL) {
       PR_Unlock(threadLock);
       printf("strsclnt: Failed to launch thread!\n");
       return SECFailure;
    } 

    slot->inUse   = 1;
    PR_Unlock(threadLock);
    PRINTF("strsclnt: Launched thread in slot %d \n", i);

    return SECSuccess;
}

Here is the call graph for this function:

int lockedVars_AddToCount ( lockedVars *  lv,
int  addend 
)

Definition at line 575 of file strsclnt.c.

{
    int rv;

    PR_Lock(lv->lock);
    rv = lv->count += addend;
    if (rv <= 0) {
       PR_NotifyCondVar(lv->condVar);
    }
    PR_Unlock(lv->lock);
    return rv;
}

Here is the call graph for this function:

void lockedVars_Destroy ( lockedVars *  lv)

Definition at line 555 of file strsclnt.c.

{
    PR_DestroyCondVar(lv->condVar);
    lv->condVar = NULL;

    PR_DestroyLock(lv->lock);
    lv->lock = NULL;
}

Here is the call graph for this function:

void lockedVars_Init ( lockedVars *  lv)

Definition at line 546 of file strsclnt.c.

{
    lv->count   = 0;
    lv->waiters = 0;
    lv->lock    = PR_NewLock();
    lv->condVar = PR_NewCondVar(lv->lock);
}

Here is the call graph for this function:

void lockedVars_WaitForDone ( lockedVars *  lv)

Definition at line 565 of file strsclnt.c.

{
    PR_Lock(lv->lock);
    while (lv->count > 0) {
       PR_WaitCondVar(lv->condVar, PR_INTERVAL_NO_TIMEOUT);
    }
    PR_Unlock(lv->lock);
}

Here is the call graph for this function:

PRBool LoggedIn ( CERTCertificate *  cert,
SECKEYPrivateKey *  key 
)

Definition at line 951 of file strsclnt.c.

{
    if ( (cert->slot) && (key->pkcs11Slot) &&
         (PR_TRUE == PK11_IsLoggedIn(cert->slot, NULL)) &&
         (PR_TRUE == PK11_IsLoggedIn(key->pkcs11Slot, NULL)) ) {
        return PR_TRUE;
    }
 
    return PR_FALSE;
}

Here is the call graph for this function:

int main ( int  argc,
char **  argv 
)

The Xalan testcases app.

Definition at line 1322 of file strsclnt.c.

{
    const char *         dir         = ".";
    const char *         fileName    = NULL;
    char *               hostName    = NULL;
    char *               nickName    = NULL;
    char *               progName    = NULL;
    char *               tmp         = NULL;
    char *            passwd      = NULL;
    int                  connections = 1;
    int                  exitVal;
    int                  tmpInt;
    unsigned short       port        = 443;
    SECStatus            rv;
    PLOptState *         optstate;
    PLOptStatus          status;
    cert_and_key Cert_And_Key;

    /* Call the NSPR initialization routines */
    PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);

    tmp      = strrchr(argv[0], '/');
    tmp      = tmp ? tmp + 1 : argv[0];
    progName = strrchr(tmp, '\\');
    progName = progName ? progName + 1 : tmp;
 

    optstate = PL_CreateOptState(argc, argv, "23BC:DNP:TUc:d:f:in:op:qst:vw:");
    while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
       switch(optstate->option) {

       case '2': disableSSL2 = PR_TRUE; break;

       case '3': disableSSL3 = PR_TRUE; break;

       case 'B': bypassPKCS11 = PR_TRUE; break;

       case 'C': cipherString = optstate->value; break;

       case 'D': NoDelay = PR_TRUE; break;

       case 'N': NoReuse = 1; break;
        
       case 'P': fullhs = PORT_Atoi(optstate->value); break;

       case 'T': disableTLS = PR_TRUE; break;
            
       case 'U': ThrottleUp = PR_TRUE; break;

       case 'c': connections = PORT_Atoi(optstate->value); break;

       case 'd': dir = optstate->value; break;

       case 'f': fileName = optstate->value; break;

       case 'i': ignoreErrors = PR_TRUE; break;

        case 'n': nickName = PL_strdup(optstate->value); break;

       case 'o': MakeCertOK++; break;

       case 'p': port = PORT_Atoi(optstate->value); break;

       case 'q': QuitOnTimeout = PR_TRUE; break;

       case 's': disableLocking = PR_TRUE; break;

       case 't':
           tmpInt = PORT_Atoi(optstate->value);
           if (tmpInt > 0 && tmpInt < MAX_THREADS) 
               max_threads = active_threads = tmpInt;
           break;

        case 'v': verbose++; break;

       case 'w': passwd = PL_strdup(optstate->value); break;

       case 0:   /* positional parameter */
           if (hostName) {
              Usage(progName);
           }
           hostName = PL_strdup(optstate->value);
           break;

       default:
       case '?':
           Usage(progName);
           break;

       }
    }
    if (!hostName || status == PL_OPT_BAD)
       Usage(progName);

    if (fullhs!= NO_FULLHS_PERCENTAGE && (fullhs < 0 || fullhs>100 || NoReuse) )
        Usage(progName);

    if (port == 0)
       Usage(progName);

    if (fileName)
       readBigFile(fileName);

    /* set our password function */
    if ( passwd ) {
       PK11_SetPasswordFunc(ownPasswd);
    } else {
       PK11_SetPasswordFunc(SECU_GetModulePassword);
    }

    tmp = PR_GetEnv("NSS_DEBUG_TIMEOUT");
    if (tmp && tmp[0]) {
        int sec = PORT_Atoi(tmp);
       if (sec > 0) {
           maxInterval = PR_SecondsToInterval(sec);
       }
    }

    /* Call the libsec initialization routines */
    rv = NSS_Initialize(dir, "", "", SECMOD_DB, NSS_INIT_READONLY);
    if (rv != SECSuccess) {
       fputs("NSS_Init failed.\n", stderr);
       exit(1);
    }
    ssl3stats = SSL_GetStatistics();
    Cert_And_Key.lock = PR_NewLock();
    Cert_And_Key.nickname = nickName;
    Cert_And_Key.password = passwd;
    Cert_And_Key.cert = NULL;
    Cert_And_Key.key = NULL;

    if (PR_FALSE == FindCertAndKey(&Cert_And_Key)) {

       if (Cert_And_Key.cert == NULL) {
           fprintf(stderr, "strsclnt: Can't find certificate %s\n", Cert_And_Key.nickname);
           exit(1);
       }

       if (Cert_And_Key.key == NULL) {
           fprintf(stderr, "strsclnt: Can't find Private Key for cert %s\n", 
                  Cert_And_Key.nickname);
           exit(1);
       }

    }

    client_main(port, connections, &Cert_And_Key, hostName);

    /* clean up */
    if (Cert_And_Key.cert) {
       CERT_DestroyCertificate(Cert_And_Key.cert);
    }
    if (Cert_And_Key.key) {
       SECKEY_DestroyPrivateKey(Cert_And_Key.key);
    }
    PR_DestroyLock(Cert_And_Key.lock);

    /* some final stats. */
    if (ssl3stats->hsh_sid_cache_hits + ssl3stats->hsh_sid_cache_misses +
        ssl3stats->hsh_sid_cache_not_ok == 0) {
       /* presumably we were testing SSL2. */
       printf("strsclnt: SSL2 - %d server certificates tested.\n",
               certsTested);
    } else {
       printf(
       "strsclnt: %ld cache hits; %ld cache misses, %ld cache not reusable\n",
           ssl3stats->hsh_sid_cache_hits, 
           ssl3stats->hsh_sid_cache_misses,
           ssl3stats->hsh_sid_cache_not_ok);
    }

    if (!NoReuse)
       exitVal = (ssl3stats->hsh_sid_cache_misses > 1) ||
                (ssl3stats->hsh_sid_cache_not_ok != 0) ||
                (certsTested > 1);
    else {
       printf("strsclnt: NoReuse - %d server certificates tested.\n",
               certsTested);
        if (ssl3stats->hsh_sid_cache_hits + ssl3stats->hsh_sid_cache_misses +
            ssl3stats->hsh_sid_cache_not_ok > 0) {
            exitVal = (ssl3stats->hsh_sid_cache_misses != connections) ||
                (certsTested != connections);
        } else {                /* ssl2 connections */
            exitVal = (certsTested != connections);
        }
    }

    exitVal = ( exitVal || failed_already );
    SSL_ClearSessionCache();
    if (NSS_Shutdown() != SECSuccess) {
        printf("strsclnt: NSS_Shutdown() failed.\n");
        exit(1);
    }

    PR_Cleanup();
    return exitVal;
}

Here is the call graph for this function:

static SECStatus myBadCertHandler ( void arg,
PRFileDesc fd 
) [static]

Definition at line 289 of file strsclnt.c.

{
    int err = PR_GetError();
    if (!MakeCertOK)
       fprintf(stderr, 
           "strsclnt: -- SSL: Server Certificate Invalid, err %d.\n%s\n", 
            err, SECU_Strerror(err));
    return (MakeCertOK ? SECSuccess : SECFailure);
}

Here is the call graph for this function:

static SECStatus myGoodSSLAuthCertificate ( void arg,
PRFileDesc fd,
PRBool  checkSig,
PRBool  isServer 
) [static]

Definition at line 253 of file strsclnt.c.

{
    return SECSuccess;
}
SECStatus myHandshakeCallback ( PRFileDesc socket,
void arg 
)

Definition at line 739 of file strsclnt.c.

Here is the call graph for this function:

static SECStatus mySSLAuthCertificate ( void arg,
PRFileDesc fd,
PRBool  checkSig,
PRBool  isServer 
) [static]

Definition at line 263 of file strsclnt.c.

{
    SECStatus rv;
    CERTCertificate *    peerCert;

    if (MakeCertOK>=2) {
        return SECSuccess;
    }
    peerCert = SSL_PeerCertificate(fd);

    PRINTF("strsclnt: Subject: %s\nstrsclnt: Issuer : %s\n", 
           peerCert->subjectName, peerCert->issuerName); 
    /* invoke the "default" AuthCert handler. */
    rv = SSL_AuthCertificate(arg, fd, checkSig, isServer);

    PR_AtomicIncrement(&certsTested);
    if (rv == SECSuccess) {
       fputs("strsclnt: -- SSL: Server Certificate Validated.\n", stderr);
    }
    CERT_DestroyCertificate(peerCert);
    /* error, if any, will be displayed by the Bad Cert Handler. */
    return rv;  
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* ownPasswd ( PK11SlotInfo *  slot,
PRBool  retry,
void arg 
)

Definition at line 165 of file strsclnt.c.

{
        char *passwd = NULL;

        if ( (!retry) && arg ) {
                passwd = PL_strdup((char *)arg);
        }

        return passwd;
}

Definition at line 300 of file strsclnt.c.

{
    CERTCertificate * cert = NULL;
    SSL3Statistics * ssl3stats = SSL_GetStatistics();
    SECStatus result;
    SSLChannelInfo    channel;
    SSLCipherSuiteInfo suite;

    static int only_once;

    if (only_once && verbose < 2)
       return;
    only_once = 1;

    result = SSL_GetChannelInfo(fd, &channel, sizeof channel);
    if (result == SECSuccess && 
        channel.length == sizeof channel && 
       channel.cipherSuite) {
       result = SSL_GetCipherSuiteInfo(channel.cipherSuite, 
                                   &suite, sizeof suite);
       if (result == SECSuccess) {
           FPRINTF(stderr, 
           "strsclnt: SSL version %d.%d using %d-bit %s with %d-bit %s MAC\n",
              channel.protocolVersion >> 8, channel.protocolVersion & 0xff,
              suite.effectiveKeyBits, suite.symCipherName, 
              suite.macBits, suite.macAlgorithmName);
           FPRINTF(stderr, 
           "strsclnt: Server Auth: %d-bit %s, Key Exchange: %d-bit %s\n",
              channel.authKeyBits, suite.authAlgorithmName,
              channel.keaKeyBits,  suite.keaTypeName);
       }
    }

    cert = SSL_LocalCertificate(fd);
    if (!cert)
       cert = SSL_PeerCertificate(fd);

    if (verbose && cert) {
       char * ip = CERT_NameToAscii(&cert->issuer);
       char * sp = CERT_NameToAscii(&cert->subject);
        if (sp) {
           fprintf(stderr, "strsclnt: subject DN: %s\n", sp);
           PORT_Free(sp);
       }
        if (ip) {
           fprintf(stderr, "strsclnt: issuer  DN: %s\n", ip);
           PORT_Free(ip);
       }
    }
    if (cert) {
       CERT_DestroyCertificate(cert);
       cert = NULL;
    }
    fprintf(stderr,
       "strsclnt: %ld cache hits; %ld cache misses, %ld cache not reusable\n",
       ssl3stats->hsh_sid_cache_hits, 
       ssl3stats->hsh_sid_cache_misses,
       ssl3stats->hsh_sid_cache_not_ok);

}

Here is the call graph for this function:

SECStatus readBigFile ( const char *  fileName)

Definition at line 1283 of file strsclnt.c.

{
    PRFileInfo  info;
    PRStatus  status;
    SECStatus rv     = SECFailure;
    int              count;
    int              hdrLen;
    PRFileDesc *local_file_fd = NULL;

    status = PR_GetFileInfo(fileName, &info);

    if (status == PR_SUCCESS &&
       info.type == PR_FILE_FILE &&
       info.size > 0 &&
       NULL != (local_file_fd = PR_Open(fileName, PR_RDONLY, 0))) {

       hdrLen      = PORT_Strlen(outHeader);
       bigBuf.len  = hdrLen + info.size;
       bigBuf.data = PORT_Malloc(bigBuf.len + 4095);
       if (!bigBuf.data) {
           errWarn("PORT_Malloc");
           goto done;
       }

       PORT_Memcpy(bigBuf.data, outHeader, hdrLen);

       count = PR_Read(local_file_fd, bigBuf.data + hdrLen, info.size);
       if (count != info.size) {
           errWarn("PR_Read local file");
           goto done;
       }
       rv = SECSuccess;
done:
       PR_Close(local_file_fd);
    }
    return rv;
}

Here is the call graph for this function:

Definition at line 491 of file strsclnt.c.

{
    int         i;

    for (i = 0; i < MAX_THREADS; ++i) {
        if (threads[i].prThread) {
            PR_JoinThread(threads[i].prThread);
            threads[i].prThread = NULL;
        }
    }
    return 0;
}

Here is the call graph for this function:

SECStatus StressClient_GetClientAuthData ( void arg,
PRFileDesc socket,
struct CERTDistNamesStr caNames,
struct CERTCertificateStr **  pRetCert,
struct SECKEYPrivateKeyStr **  pRetKey 
)

Definition at line 963 of file strsclnt.c.

{
    cert_and_key* Cert_And_Key = (cert_and_key*) arg;

    if (!pRetCert || !pRetKey) {
        /* bad pointers, can't return a cert or key */
        return SECFailure;
    }

    *pRetCert = NULL;
    *pRetKey = NULL;

    if (Cert_And_Key && Cert_And_Key->nickname) {
        while (PR_TRUE) {
            if (Cert_And_Key && Cert_And_Key->lock) {
                int timeout = 0;
                PR_Lock(Cert_And_Key->lock);

                if (Cert_And_Key->cert) {
                    *pRetCert = CERT_DupCertificate(Cert_And_Key->cert);
                }

                if (Cert_And_Key->key) {
                    *pRetKey = SECKEY_CopyPrivateKey(Cert_And_Key->key);
                }
                PR_Unlock(Cert_And_Key->lock);
                if (!*pRetCert || !*pRetKey) {
                    /* one or both of them failed to copy. Either the source was NULL, or there was
                    ** an out of memory condition. Free any allocated copy and fail */
                    if (*pRetCert) {
                        CERT_DestroyCertificate(*pRetCert);
                        *pRetCert = NULL;
                    }
                    if (*pRetKey) {
                        SECKEY_DestroyPrivateKey(*pRetKey);
                        *pRetKey = NULL;
                    }
                    break;
                }
                /* now check if those objects are valid */
                if ( PR_FALSE == LoggedIn(*pRetCert, *pRetKey) ) {
                    /* token is no longer logged in, it was removed */

                    /* first, delete and clear our invalid local objects */
                    CERT_DestroyCertificate(*pRetCert);
                    SECKEY_DestroyPrivateKey(*pRetKey);
                    *pRetCert = NULL;
                    *pRetKey = NULL;

                    PR_Lock(Cert_And_Key->lock);
                    /* check if another thread already logged back in */
                    if (PR_TRUE == LoggedIn(Cert_And_Key->cert, Cert_And_Key->key)) {
                        /* yes : try again */
                        PR_Unlock(Cert_And_Key->lock);
                        continue;
                    }
                    /* this is the thread to retry */
                    CERT_DestroyCertificate(Cert_And_Key->cert);
                    SECKEY_DestroyPrivateKey(Cert_And_Key->key);
                    Cert_And_Key->cert = NULL;
                    Cert_And_Key->key = NULL;


                    /* now look up the cert and key again */
                    while (PR_FALSE == FindCertAndKey(Cert_And_Key) ) {
                        PR_Sleep(PR_SecondsToInterval(1));
                        timeout++;
                        if (timeout>=60) {
                            printf("\nToken pulled and not reinserted early enough : aborting.\n");
                            exit(1);
                        }
                    }
                    PR_Unlock(Cert_And_Key->lock);
                    continue;
                    /* try again to reduce code size */
                }
                return SECSuccess;
            }
        }
        *pRetCert = NULL;
        *pRetKey = NULL;
        return SECFailure;
    } else {
        /* no cert configured, automatically find the right cert. */
        CERTCertificate *  cert = NULL;
        SECKEYPrivateKey * privkey = NULL;
        CERTCertNicknames * names;
        int                 i;
        void *             proto_win = NULL;
        SECStatus          rv         = SECFailure;

        if (Cert_And_Key) {
            proto_win = Cert_And_Key->password;
        }

        names = CERT_GetCertNicknames(CERT_GetDefaultCertDB(),
                                      SEC_CERT_NICKNAMES_USER, proto_win);
        if (names != NULL) {
            for (i = 0; i < names->numnicknames; i++) {
                cert = CERT_FindUserCertByUsage(CERT_GetDefaultCertDB(),
                            names->nicknames[i], certUsageSSLClient,
                            PR_FALSE, proto_win);       
                if ( !cert )
                    continue;
                /* Only check unexpired certs */
                if (CERT_CheckCertValidTimes(cert, PR_Now(), PR_TRUE) != 
                                             secCertTimeValid ) {
                    CERT_DestroyCertificate(cert);
                    continue;
                }
                rv = NSS_CmpCertChainWCANames(cert, caNames);
                if ( rv == SECSuccess ) {
                    privkey = PK11_FindKeyByAnyCert(cert, proto_win);
                    if ( privkey )
                        break;
                }
                rv = SECFailure;
                CERT_DestroyCertificate(cert);
            }
            CERT_FreeNicknames(names);
        }
        if (rv == SECSuccess) {
            *pRetCert = cert;
            *pRetKey  = privkey;
        }
        return rv;
    }
}

Here is the call graph for this function:

void thread_wrapper ( void arg)

Definition at line 386 of file strsclnt.c.

{
    perThread * slot = (perThread *)arg;
    PRBool done = PR_FALSE;

    do {
        PRBool doop = PR_FALSE;
        PRBool dosleep = PR_FALSE;
        PRTime now = PR_Now();

        PR_Lock(threadLock);
        if (! (slot->tid < active_threads)) {
            /* this thread isn't supposed to be running */
            if (!ThrottleUp) {
                /* we'll never need this thread again, so abort it */
                done = PR_TRUE;
            } else if (remaining_connections > 0) {
                /* we may still need this thread, so just sleep for 1s */
                dosleep = PR_TRUE;
                /* the conditions to trigger a throttle up are :
                ** 1. last PR_Connect failure must have happened more than
                **    10s ago
                ** 2. last throttling up must have happened more than 0.5s ago
                ** 3. there must be a more recent PR_Connect success than
                **    failure
                */
                if ( (now - lastConnectFailure > 10 * PR_USEC_PER_SEC) &&
                    ( (!lastThrottleUp) || ( (now - lastThrottleUp) >=
                                             (PR_USEC_PER_SEC/2)) ) &&
                    (lastConnectSuccess > lastConnectFailure) ) {
                    /* try throttling up by one thread */
                    active_threads = PR_MIN(max_threads, active_threads+1);
                    fprintf(stderr,"active_threads set up to %d\n",
                            active_threads);
                    lastThrottleUp = PR_MAX(now, lastThrottleUp);
                }
            } else {
                /* no more connections left, we are done */
                done = PR_TRUE;
            }
        } else {
            /* this thread should run */
            if (--remaining_connections >= 0) { /* protected by threadLock */
                doop = PR_TRUE;
            } else {
                done = PR_TRUE;
            }
        }
        PR_Unlock(threadLock);
        if (doop) {
            slot->rv = (* slot->startFunc)(slot->a, slot->b, slot->tid);
            PRINTF("strsclnt: Thread in slot %d returned %d\n", 
                   slot->tid, slot->rv);
        }
        if (dosleep) {
            PR_Sleep(PR_SecondsToInterval(1));
        }
    } while (!done && (!failed_already || ignoreErrors));
}

Here is the call graph for this function:

static void Usage ( const char *  progName) [static]

Definition at line 184 of file strsclnt.c.

{
    fprintf(stderr, 
       "Usage: %s [-n nickname] [-p port] [-d dbdir] [-c connections]\n"
       "          [-23BDNTovqs] [-f filename] [-N | -P percentage]\n"
       "          [-w dbpasswd] [-C cipher(s)] [-t threads] hostname\n"
       " where -v means verbose\n"
        "       -o flag is interpreted as follows:\n"
        "          1 -o   means override the result of server certificate validation.\n"
        "          2 -o's mean skip server certificate validation altogether.\n"
       "       -D means no TCP delays\n"
       "       -q means quit when server gone (timeout rather than retry forever)\n"
       "       -s means disable SSL socket locking\n"
       "       -N means no session reuse\n"
       "       -P means do a specified percentage of full handshakes (0-100)\n"
        "       -2 means disable SSL2\n"
        "       -3 means disable SSL3\n"
        "       -T means disable TLS\n"
        "       -U means enable throttling up threads\n"
       "       -B bypasses the PKCS11 layer for SSL encryption and MACing\n",
       progName);
    exit(1);
}

Here is the call graph for this function:


Variable Documentation

int active_threads = 8 [static]

Definition at line 148 of file strsclnt.c.

SECItem bigBuf

Definition at line 178 of file strsclnt.c.

Definition at line 159 of file strsclnt.c.

PRInt32 certsTested [static]

Definition at line 129 of file strsclnt.c.

const char* cipherString [static]

Definition at line 127 of file strsclnt.c.

Definition at line 160 of file strsclnt.c.

Definition at line 156 of file strsclnt.c.

Definition at line 157 of file strsclnt.c.

Definition at line 158 of file strsclnt.c.

int failed_already = 0 [static]

Definition at line 155 of file strsclnt.c.

Definition at line 132 of file strsclnt.c.

PRInt32 globalconid = 0 [static]

Definition at line 134 of file strsclnt.c.

Definition at line 161 of file strsclnt.c.

Definition at line 144 of file strsclnt.c.

Definition at line 145 of file strsclnt.c.

Definition at line 736 of file strsclnt.c.

Definition at line 146 of file strsclnt.c.

int MakeCertOK [static]

Definition at line 130 of file strsclnt.c.

int max_threads [static]

Definition at line 371 of file strsclnt.c.

Definition at line 163 of file strsclnt.c.

PRBool NoDelay [static]

Definition at line 139 of file strsclnt.c.

int NoReuse [static]

Definition at line 131 of file strsclnt.c.

Definition at line 370 of file strsclnt.c.

PRInt32 numUsed [static]

Definition at line 150 of file strsclnt.c.

const char outHeader[] [static]
Initial value:
 {
    "HTTP/1.0 200 OK\r\n"
    "Server: Netscape-Enterprise/2.0a\r\n"
    "Date: Tue, 26 Aug 1997 22:10:05 GMT\r\n"
    "Content-type: text/plain\r\n"
    "\r\n"
}

Definition at line 528 of file strsclnt.c.

Definition at line 140 of file strsclnt.c.

Definition at line 147 of file strsclnt.c.

const char request[] = {"GET /abc HTTP/1.0\r\n\r\n" }

Definition at line 678 of file strsclnt.c.

Definition at line 153 of file strsclnt.c.

const char stopCmd[] = { "GET /stop " } [static]

Definition at line 527 of file strsclnt.c.

Definition at line 176 of file strsclnt.c.

PRLock* threadLock [static]

Definition at line 143 of file strsclnt.c.

Definition at line 383 of file strsclnt.c.

Definition at line 141 of file strsclnt.c.

Definition at line 135 of file strsclnt.c.

Definition at line 137 of file strsclnt.c.

Definition at line 136 of file strsclnt.c.

Definition at line 525 of file strsclnt.c.

Definition at line 177 of file strsclnt.c.