diff options
author | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2008-06-16 21:23:17 +0000 |
---|---|---|
committer | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2008-06-16 21:23:17 +0000 |
commit | cf6b59335412538ea32b89fce6f982a10674b8e3 (patch) | |
tree | af0850ea6db688779eaee1d7ffd213153397084a | |
parent | 93959eaddeb90ecfef9c35076f74a8f142da9062 (diff) | |
download | ATCD-cf6b59335412538ea32b89fce6f982a10674b8e3.tar.gz |
Mon Jun 16 21:22:03 UTC 2008 Abdullah Sowayan <abdullah.sowayan@lmco.com>
-rw-r--r-- | ACE/ChangeLog | 17 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/Caching/Local_Locator.cpp | 2 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/bench.c | 16 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/errexit.c | 16 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/genrand.c | 16 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/get.c | 40 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/gettimeofday.c | 4 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/parse_file_list.c | 361 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/rexec.c | 416 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/statistics.c | 24 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/sysdep.c | 22 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/timefunc.c | 34 | ||||
-rw-r--r-- | ACE/apps/drwho/Hash_Table.cpp | 2 |
13 files changed, 496 insertions, 474 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 411ad007d53..26d988f109f 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,20 @@ +Mon Jun 16 21:22:03 UTC 2008 Abdullah Sowayan <abdullah.sowayan@lmco.com> + + * apps/JAWS/clients/Caching/Local_Locator.cpp: + * apps/JAWS/clients/WebSTONE/src/bench.c: + * apps/JAWS/clients/WebSTONE/src/errexit.c: + * apps/JAWS/clients/WebSTONE/src/genrand.c: + * apps/JAWS/clients/WebSTONE/src/get.c: + * apps/JAWS/clients/WebSTONE/src/gettimeofday.c: + * apps/JAWS/clients/WebSTONE/src/parse_file_list.c: + * apps/JAWS/clients/WebSTONE/src/rexec.c: + * apps/JAWS/clients/WebSTONE/src/statistics.c: + * apps/JAWS/clients/WebSTONE/src/sysdep.c: + * apps/JAWS/clients/WebSTONE/src/timefunc.c: + * apps/drwho/Hash_Table.cpp: + + Untabify. + Mon Jun 16 20:24:45 UTC 2008 Abdullah Sowayan <abdullah.sowayan@lmco.com> * apps/Gateway/Gateway/Connection_Handler.cpp: diff --git a/ACE/apps/JAWS/clients/Caching/Local_Locator.cpp b/ACE/apps/JAWS/clients/Caching/Local_Locator.cpp index 1c9df290fbe..f341014257d 100644 --- a/ACE/apps/JAWS/clients/Caching/Local_Locator.cpp +++ b/ACE/apps/JAWS/clients/Caching/Local_Locator.cpp @@ -163,7 +163,7 @@ ACE_URL_Local_Locator::modify_offer (const ACE_WString &offer_id, target = item; } - if (target != 0) // Aha, we found a target to work on + if (target != 0) // Aha, we found a target to work on { if (del != 0 && modify != 0) { diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/bench.c b/ACE/apps/JAWS/clients/WebSTONE/src/bench.c index 7139bcf040d..3c3d84a34f6 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/bench.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/bench.c @@ -1,13 +1,13 @@ /* $Id$ */ /************************************************************************** - * * - * Copyright (C) 1995 Silicon Graphics, Inc. * - * * - * These coded instructions, statements, and computer programs were * - * developed by SGI for public use. If any changes are made to this code* - * please try to get the changes back to the author. Feel free to make * - * modifications and changes to the code and release it. * - * * + * + * Copyright (C) 1995 Silicon Graphics, Inc. + * + * These coded instructions, statements, and computer programs were + * developed by SGI for public use. If any changes are made to this code + * please try to get the changes back to the author. Feel free to make + * modifications and changes to the code and release it. + * **************************************************************************/ /* FUZZ: disable check_for_math_include */ diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/errexit.c b/ACE/apps/JAWS/clients/WebSTONE/src/errexit.c index a9bc024d4b6..8f2fcba176c 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/errexit.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/errexit.c @@ -1,13 +1,13 @@ /* $Id$ */ /************************************************************************** - * * - * Copyright (C) 1995 Silicon Graphics, Inc. * - * * - * These coded instructions, statements, and computer programs were * - * developed by SGI for public use. If any changes are made to this code* - * please try to get the changes back to the author. Feel free to make * - * modifications and changes to the code and release it. * - * * + * + * Copyright (C) 1995 Silicon Graphics, Inc. + * + * These coded instructions, statements, and computer programs were + * developed by SGI for public use. If any changes are made to this code + * please try to get the changes back to the author. Feel free to make + * modifications and changes to the code and release it. + * **************************************************************************/ /* errexit call for general error handling */ diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/genrand.c b/ACE/apps/JAWS/clients/WebSTONE/src/genrand.c index 4c2c9598fd0..400e88a55b1 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/genrand.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/genrand.c @@ -1,13 +1,13 @@ /* $Id$ */ /************************************************************************** - * * - * Copyright (C) 1995 Silicon Graphics, Inc. * - * * - * These coded instructions, statements, and computer programs were * - * developed by SGI for public use. If any changes are made to this code* - * please try to get the changes back to the author. Feel free to make * - * modifications and changes to the code and release it. * - * * + * + * Copyright (C) 1995 Silicon Graphics, Inc. + * + * These coded instructions, statements, and computer programs were + * developed by SGI for public use. If any changes are made to this code + * please try to get the changes back to the author. Feel free to make + * modifications and changes to the code and release it. + * **************************************************************************/ /* FUZZ: disable check_for_math_include */ diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/get.c b/ACE/apps/JAWS/clients/WebSTONE/src/get.c index 1fd5a31942c..007997e22c5 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/get.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/get.c @@ -43,9 +43,9 @@ #include "bench.h" #define ACCEPT_COMMAND "Accept: */* HTTP/1.0\r\n\r\n" -#define ACCEPT_COMMAND_LEN ((int)strlen(ACCEPT_COMMAND)) -#define MAXCOMMANDLEN 256 -#define HEADERBUFSIZ (8*1024) +#define ACCEPT_COMMAND_LEN ((int)strlen(ACCEPT_COMMAND)) +#define MAXCOMMANDLEN 256 +#define HEADERBUFSIZ (8*1024) #define UPPER(c) (((c) >= 'a' && (c) <= 'z') ? (c) + 'A' - 'a' : (c)) @@ -65,21 +65,21 @@ int mystrincmp(const char *str1, const char *str2, int len) { int get(char *loc, NETPORT port, char *url, rqst_timer_t *timer) { - SOCKET sock = BADSOCKET_VALUE; - int writelen; - int bytesread; - int totalbytesread; - int headerlen; - int bodylength; - int contentlength = 0; - int outputfile = -1; - int status; - char getcommand[MAXCOMMANDLEN]; - char headerbuffer[HEADERBUFSIZ+1]; - char *offset; - char outputfilename[MAXPATHLEN]; - char version[100]; - int count; + SOCKET sock = BADSOCKET_VALUE; + int writelen; + int bytesread; + int totalbytesread; + int headerlen; + int bodylength; + int contentlength = 0; + int outputfile = -1; + int status; + char getcommand[MAXCOMMANDLEN]; + char headerbuffer[HEADERBUFSIZ+1]; + char *offset; + char outputfilename[MAXPATHLEN]; + char version[100]; + int count; /*#define ABORTIVE_CLOSE 1*/ #ifdef ABORTIVE_CLOSE @@ -227,7 +227,7 @@ get(char *loc, NETPORT port, char *url, rqst_timer_t *timer) returnerr("Error saving file: %s\n", strerror(errno)); goto error; } - lseek(outputfile,1,SEEK_END); /* this is odd... JEF */ + lseek(outputfile,1,SEEK_END); /* this is odd... JEF */ /* if we have part of the file already, save that part */ if(totalbytesread > headerlen) @@ -298,7 +298,7 @@ get(char *loc, NETPORT port, char *url, rqst_timer_t *timer) timer->totalbytes, timer->bodybytes, timer->valid ); D_PRINTF("get returning start %d, end %d\n", - timer->entertime.tv_sec, timer->exittime.tv_sec ); + timer->entertime.tv_sec, timer->exittime.tv_sec ); D_PRINTF("get returning connect %d, request %d, header %d, body %d\n", timer->afterconnect.tv_sec, timer->beforeheader.tv_sec, diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/gettimeofday.c b/ACE/apps/JAWS/clients/WebSTONE/src/gettimeofday.c index dbe4e1d0d63..1537d7654bd 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/gettimeofday.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/gettimeofday.c @@ -16,8 +16,8 @@ #include <windows.h> #include <errno.h> -#include <winsock.h> /* For definition of "timeval" structure */ -#include <sys/timeb.h> /* For prototype of "_ftime()" */ +#include <winsock.h> /* For definition of "timeval" structure */ +#include <sys/timeb.h> /* For prototype of "_ftime()" */ /* diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/parse_file_list.c b/ACE/apps/JAWS/clients/WebSTONE/src/parse_file_list.c index dd433adf79c..c11f5f37733 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/parse_file_list.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/parse_file_list.c @@ -1,13 +1,13 @@ /* $Id$ */ /************************************************************************** - * * - * Copyright (C) 1995 Silicon Graphics, Inc. * - * * - * These coded instructions, statements, and computer programs were * - * developed by SGI for public use. If any changes are made to this code* - * please try to get the changes back to the author. Feel free to make * - * modifications and changes to the code and release it. * - * * + * + * Copyright (C) 1995 Silicon Graphics, Inc. + * + * These coded instructions, statements, and computer programs were + * developed by SGI for public use. If any changes are made to this code + * please try to get the changes back to the author. Feel free to make + * modifications and changes to the code and release it. + * **************************************************************************/ #include <stdio.h> #include <errno.h> @@ -42,231 +42,228 @@ #include "bench.h" -/* +/* * count_file_list() * given a filename, return a guess at the number of pages */ int count_file_list(const char *url_list_file) { - FILE *fp; + FILE *fp; long int num_of_pages; - char a_line[BUFSIZ]; - char *textvalue; - int returnval; + char a_line[BUFSIZ]; + char *textvalue; + int returnval; fp = fopen(url_list_file, "r"); - + if (fp == 0) { - D_PRINTF( "Error %d opening filelist %s: %s\n", - errno, url_list_file, strerror(errno) );; - return(returnerr("Error %d opening filelist %s: %s\n", - errno, url_list_file, strerror(errno))); + D_PRINTF("Error %d opening filelist %s: %s\n", + errno, url_list_file, strerror(errno) );; + return(returnerr("Error %d opening filelist %s: %s\n", + errno, url_list_file, strerror(errno))); } else { num_of_pages = 0; D_PRINTF( "Opened file, about to count\n" ); /* - * parse through the file line-by-line + * parse through the file line-by-line * strip out comments, but don't check for URL consistency */ while (fgets(a_line, BUFSIZ, fp) != 0) - { - textvalue = a_line; - /* check for comments */ - if (strchr(textvalue, '#') != 0) - { - /* throw out anything after any '#' */ - D_PRINTF( "Stripping comment from line: %s\n", textvalue ); - returnval = strcspn(textvalue, "#"); - D_PRINTF( "Found first # at %d\n", returnval ); - if (returnval == 0) - { - textvalue = 0; - } - } - /* is there more? */ - if (textvalue != 0) - { - num_of_pages++; - D_PRINTF( "Found %ld pages\n", num_of_pages ); - } - } + { + textvalue = a_line; + /* check for comments */ + if (strchr(textvalue, '#') != 0) + { + /* throw out anything after any '#' */ + D_PRINTF( "Stripping comment from line: %s\n", textvalue ); + returnval = strcspn(textvalue, "#"); + D_PRINTF( "Found first # at %d\n", returnval ); + if (returnval == 0) + { + textvalue = 0; + } + } + /* is there more? */ + if (textvalue != 0) + { + num_of_pages++; + D_PRINTF( "Found %ld pages\n", num_of_pages ); + } + } return(num_of_pages); } fclose(fp); } /* end count_file_list() */ -/* +/* * parse_file_list() * given a filename, a pointer to a page list, and pointers to integers * for the number of pages and the number of files, parse its contents. */ void -parse_file_list (const char *url_list_file, page_list_t *page_list, - long int *num_of_pages, long int *num_of_files) +parse_file_list (const char *url_list_file, page_list_t *page_list, + long int *num_of_pages, long int *num_of_files) { - FILE *fp; + FILE *fp; int filenum; int returnval; int loadnum; - char a_line[BUFSIZ]; + char a_line[BUFSIZ]; char tempbuf[BUFSIZ]; char *textvalue; - int numfiles = 1, numpages = 0; - int maxpages = *num_of_pages; - page_list_t *pp; + int numfiles = 1, numpages = 0; + int maxpages = *num_of_pages; + page_list_t *pp; extern int haveproxyserver; fp = fopen(url_list_file, "r"); - + if (fp == 0) { errexit("Error %d opening filelist: %s\n", errno, strerror(errno)); } else { - /* - * GRAB A LINE. FORMAT IS: URL WEIGHTINGFACTOR + /* + * GRAB A LINE. FORMAT IS: URL WEIGHTINGFACTOR * EXAMPLE: http://www/file.html 1 */ D_PRINTF( "File is open.\n" ); while(fgets(a_line, BUFSIZ, fp) != 0) - { - textvalue = a_line; - /* check for comments */ - if (strchr(textvalue, '#') != 0) - { - /* throw out anything after a '#' */ - D_PRINTF( "Stripping comment from line: %s\n", textvalue ); - returnval = strcspn(textvalue, "#"); - D_PRINTF( "Found first # at %d\n", returnval ); - if (returnval == 0) - continue; - } - - if (numpages >= *num_of_pages) - errexit("Out of space in parse_file_list()\n"); - - pp = &page_list[numpages]; - - D_PRINTF( "Processing page %ld\n", numpages ); - loadnum = 0; - - if (textvalue != 0) { /* is there more? */ - /* check for weighting factor */ - D_PRINTF( "Setting page values from: %s\n", textvalue ); - returnval = sscanf(textvalue, "%s%d", tempbuf, &loadnum); - D_PRINTF( "Scan for weighting returns %d, %d\n", - returnval, loadnum ); - if (returnval == EOF || loadnum <= 0) - { - pp->load_num = 1; - } - else - { - pp->load_num = loadnum; - } - D_PRINTF( "Setting load=%d for line: %s\n", - pp->load_num, textvalue ); - - /* placeholder for grouping multiple files onto one page */ - pp->num_of_files = 1; - filenum = 0; - - textvalue = tempbuf; - D_PRINTF( "Line is now: %s\n", textvalue ); - - /* - * if we've got a proxy server, we'll assume that the - * remaining text is a valid URL, and stuff it into - * page_list[numpages].filename[filenum] - * Otherwise, we'll have to parse it out. - */ - - if (haveproxyserver) - { - pp->servername[filenum] = 0; - pp->port_number[filenum] = 0; - strcpy(pp->filename[filenum], textvalue); - } - else /* no proxy server, so we have to parse it out... */ - { - /* try http://server(:port)/file */ - D_PRINTF( "Trying http://server(:port)/filename\n" ); - returnval = sscanf(textvalue, "http://%[^/]%s", - tempbuf, - a_line); - /* check server string for :port */ - if (returnval != 0 && returnval != EOF) - { - D_PRINTF( "Setting filename %s\n", a_line ); - strcpy(pp->filename[filenum], - a_line); - - D_PRINTF( "Checking %s for :portnumber\n", tempbuf ); - returnval = sscanf(tempbuf, "%[^:]:%d", - a_line, - &pp->port_number[filenum]); - - if (returnval < 2) - { - pp->port_number[filenum] = 80; - } - if (returnval == EOF) - { - pp->servername[filenum] = 0; - } - else - { - D_PRINTF( "Port number %d, setting server %s\n", - pp->port_number[filenum], - a_line ); - - strcpy(pp->servername[filenum], a_line); - } - - D_PRINTF( "Server %s, port number %d\n", - pp->servername[filenum], - pp->port_number[filenum] ); - } - else /* no good - try straight filename */ - { - pp->port_number[filenum] = 80; - D_PRINTF( "Trying filename, returnval=%d\n", - returnval ); - pp->servername[filenum] = 0; - D_PRINTF( "Server %s, port number %d\n", - pp->servername[filenum], - pp->port_number[filenum] ); - returnval = sscanf(textvalue, "%s", a_line); - D_PRINTF( "Scan returned filename %s\n", a_line ); - - strcpy(pp->filename[filenum], a_line); - } /* end of parsing */ - } /* end if haveproxyserver */ - - D_PRINTF( "Done parsing line\n" ); - D_PRINTF( "Got server %s, port %d, file %s, returnval %d\n", - pp->servername[filenum], - pp->port_number[filenum], - pp->filename[filenum], - returnval ); - } /* end if textvalue not NULL */ - - numpages++; - } /* end while not EOF */ + { + textvalue = a_line; + /* check for comments */ + if (strchr(textvalue, '#') != 0) + { + /* throw out anything after a '#' */ + D_PRINTF( "Stripping comment from line: %s\n", textvalue ); + returnval = strcspn(textvalue, "#"); + D_PRINTF( "Found first # at %d\n", returnval ); + if (returnval == 0) + continue; + } + + if (numpages >= *num_of_pages) + errexit("Out of space in parse_file_list()\n"); + + pp = &page_list[numpages]; + + D_PRINTF( "Processing page %ld\n", numpages ); + loadnum = 0; + + if (textvalue != 0) + { + /* is there more? */ + /* check for weighting factor */ + D_PRINTF( "Setting page values from: %s\n", textvalue ); + returnval = sscanf(textvalue, "%s%d", tempbuf, &loadnum); + D_PRINTF("Scan for weighting returns %d, %d\n", + returnval, loadnum); + if (returnval == EOF || loadnum <= 0) + { + pp->load_num = 1; + } + else + { + pp->load_num = loadnum; + } + D_PRINTF("Setting load=%d for line: %s\n", + pp->load_num, textvalue); + + /* placeholder for grouping multiple files onto one page */ + pp->num_of_files = 1; + filenum = 0; + + textvalue = tempbuf; + D_PRINTF( "Line is now: %s\n", textvalue ); + + /* + * if we've got a proxy server, we'll assume that the + * remaining text is a valid URL, and stuff it into + * page_list[numpages].filename[filenum] + * Otherwise, we'll have to parse it out. + */ + + if (haveproxyserver) + { + pp->servername[filenum] = 0; + pp->port_number[filenum] = 0; + strcpy(pp->filename[filenum], textvalue); + } + else /* no proxy server, so we have to parse it out... */ + { + /* try http://server(:port)/file */ + D_PRINTF( "Trying http://server(:port)/filename\n" ); + returnval = sscanf(textvalue, "http://%[^/]%s", + tempbuf, + a_line); + /* check server string for :port */ + if (returnval != 0 && returnval != EOF) + { + D_PRINTF( "Setting filename %s\n", a_line ); + strcpy(pp->filename[filenum], a_line); + + D_PRINTF( "Checking %s for :portnumber\n", tempbuf ); + returnval = sscanf(tempbuf, "%[^:]:%d", a_line, + &pp->port_number[filenum]); + + if (returnval < 2) + { + pp->port_number[filenum] = 80; + } + if (returnval == EOF) + { + pp->servername[filenum] = 0; + } + else + { + D_PRINTF("Port number %d, setting server %s\n", + pp->port_number[filenum], a_line); + + strcpy(pp->servername[filenum], a_line); + } + + D_PRINTF("Server %s, port number %d\n", + pp->servername[filenum], + pp->port_number[filenum]); + } + else /* no good - try straight filename */ + { + pp->port_number[filenum] = 80; + D_PRINTF( "Trying filename, returnval=%d\n", returnval ); + pp->servername[filenum] = 0; + D_PRINTF("Server %s, port number %d\n", + pp->servername[filenum], pp->port_number[filenum]); + returnval = sscanf(textvalue, "%s", a_line); + D_PRINTF( "Scan returned filename %s\n", a_line ); + + strcpy(pp->filename[filenum], a_line); + } /* end of parsing */ + } /* end if haveproxyserver */ + + D_PRINTF("Done parsing line\n"); + D_PRINTF("Got server %s, port %d, file %s, returnval %d\n", + pp->servername[filenum], + pp->port_number[filenum], + pp->filename[filenum], + returnval); + } /* end if textvalue not NULL */ + + numpages++; + } /* end while not EOF */ if (numpages < 1) - { - returnerr("No files are specified by filelist\n"); - } + { + returnerr("No files are specified by filelist\n"); + } } /* end if file ok */ fclose(fp); - D_PRINTF( "Returning %ld pages and %ld files\n", - numpages, numfiles ); + D_PRINTF("Returning %ld pages and %ld files\n", + numpages, numfiles ); *num_of_pages = numpages; *num_of_files = numfiles; @@ -280,10 +277,10 @@ load_percent(page_list_t *page_list, long int number_of_pages) long int index_number = 0; for (i = 0; i < number_of_pages; i++) - { + { index_number += page_list[i].load_num; } - + D_PRINTF( "load_percent returning %d\n", (index_number) ); return(index_number); } diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/rexec.c b/ACE/apps/JAWS/clients/WebSTONE/src/rexec.c index acbf2253bf1..7ec95e51e8b 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/rexec.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/rexec.c @@ -12,7 +12,7 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by Ataman Software, Inc. + * This product includes software developed by Ataman Software, Inc. * 4. The name of Ataman Software, Inc. may not may be used to endorse or * promote products derived from this software without specific prior * written permission. @@ -32,7 +32,7 @@ static char copyright[] = - "Copyright (c) 1994-1995 Ataman Software, Inc. All rights reserved."; + "Copyright (c) 1994-1995 Ataman Software, Inc. All rights reserved."; #pragma warning(disable: 4699) @@ -100,274 +100,282 @@ IDENT idIn = 0; IDENT idOut, idErr; SOCKET rexec(const char **hostname, NETPORT port, char *username, char *password, - char *command, SOCKET *sockerr) + char *command, SOCKET *sockerr) { - MyOpenService(*hostname); + MyOpenService(*hostname); - SendZString(username); - SendZString(password); - SendZString(command); + SendZString(username); + SendZString(password); + SendZString(command); - if (!GetErrString(command, sizeof command)) { - errexit("Rexec: Remote aborted connection without initiating protocol: %s.\n", - neterrstr()); - } + if (!GetErrString(command, sizeof command)) { + errexit("Rexec: Remote aborted connection without initiating protocol: %s.\n", + neterrstr()); + } - if (*command != '\0') { - char *p = command; - if (*p == '\001') { - p++; - } - errexit("Rexec: Remote aborted connection: %s\n", p); - } + if (*command != '\0') { + char *p = command; + if (*p == '\001') { + p++; + } + errexit("Rexec: Remote aborted connection: %s\n", p); + } - hStdIn = GetStdHandle(STD_INPUT_HANDLE); - hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); - hStdErr = GetStdHandle(STD_ERROR_HANDLE); + hStdIn = GetStdHandle(STD_INPUT_HANDLE); + hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); + hStdErr = GetStdHandle(STD_ERROR_HANDLE); - *sockerr = sErr; - return sIO; + *sockerr = sErr; + return sIO; } static void MyOpenService(const char *remote_host) { - struct sockaddr_in server_addr, my_err_addr, junk_addr; - struct servent *sv; - static char portbuf[30]; - SOCKET sTmp; - int addr_len; - - if (remote_host[0] >= '0' && remote_host[0] <= '9') { - unsigned long addr; - - addr = inet_addr(remote_host); - if (addr == INADDR_NONE) { - returnerr("Invalid IP address %s\n", remote_host); - return; - } - server_addr.sin_addr.S_un.S_addr = addr; - } else { - struct hostent *hent; - - hent = gethostbyname(remote_host); - if (hent == 0) - { - D_PRINTF( "Can't get %s host entry\n", remote_host ); - D_PRINTF( "Gethostbyname failed: %d", WSAGetLastError() ); - errexit("Rexec: gethostbyname(%s) failed: %s\n", - remote_host, neterrstr()); - } - memcpy((char *)&server_addr.sin_addr, hent->h_addr, hent->h_length); + struct sockaddr_in server_addr, my_err_addr, junk_addr; + struct servent *sv; + static char portbuf[30]; + SOCKET sTmp; + int addr_len; + + if (remote_host[0] >= '0' && remote_host[0] <= '9') { + unsigned long addr; + + addr = inet_addr(remote_host); + if (addr == INADDR_NONE) { + returnerr("Invalid IP address %s\n", remote_host); + return; + } + + server_addr.sin_addr.S_un.S_addr = addr; + } + else { + struct hostent *hent; + + hent = gethostbyname(remote_host); + if (hent == 0) + { + D_PRINTF( "Can't get %s host entry\n", remote_host ); + D_PRINTF( "Gethostbyname failed: %d", WSAGetLastError() ); + errexit("Rexec: gethostbyname(%s) failed: %s\n", + remote_host, neterrstr()); + } + memcpy((char *)&server_addr.sin_addr, hent->h_addr, hent->h_length); } #ifdef OMIT - hent = gethostbyname(remote_host); - if(!hent) { - errexit("Rexec: Lookup of server hostname failed: %s.\n", - neterrstr()); - } + hent = gethostbyname(remote_host); + if(!hent) { + errexit("Rexec: Lookup of server hostname failed: %s.\n", + neterrstr()); + } #endif /* OMIT */ - sv=getservbyname("exec", "tcp"); - if (!sv) { - errexit("Rexec: Lookup of port number for rexec service failed: %s.\n", - neterrstr()); - } - - server_addr.sin_family = PF_INET; - server_addr.sin_port = htons(sv->s_port); - - if((sIO=socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { - errexit("Rexec: I/O socket creation failed: %s.\n", - neterrstr()); - } - - if(connect(sIO, (struct sockaddr *)&server_addr, sizeof server_addr) == SOCKET_ERROR) { - errexit("Rexec: I/O socket connection failed: %s.\n", - neterrstr()); - } - - memset(&my_err_addr, '\0', sizeof my_err_addr); - my_err_addr.sin_addr.s_addr = htonl(INADDR_ANY); - my_err_addr.sin_family = AF_INET; - my_err_addr.sin_port = 0; - - if ((sTmp=socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { - errexit("Rexec: Error socket creation failed: error=%s.\n", - neterrstr()); - } - - if (bind(sTmp, (struct sockaddr *)&my_err_addr, sizeof my_err_addr) == SOCKET_ERROR) { - errexit("Rexec: Error socket bind failed: %s.\n", - neterrstr()); - (void) closesocket(sTmp); - } - - if (listen(sTmp, 1) == SOCKET_ERROR) { - errexit("Rexec: Error socket listen failed: %s.\n", - neterrstr()); - (void) closesocket(sTmp); - } - - addr_len = sizeof my_err_addr; - if (getsockname(sTmp, (struct sockaddr *)&my_err_addr, &addr_len) == SOCKET_ERROR) { - errexit("Rexec: Error socket bind failed: %s.\n", - neterrstr()); - (void) closesocket(sTmp); - } - - sprintf(portbuf, "%hu", ntohs(my_err_addr.sin_port)); - SendZString(portbuf); - - addr_len = sizeof junk_addr; - if ((sErr = accept(sTmp, (struct sockaddr *)&junk_addr, &addr_len)) - == INVALID_SOCKET) { - errexit("Rexec: Error socket accept failed: %s.\n", - neterrstr()); - (void) closesocket(sTmp); - } - - (void) closesocket(sTmp); + sv=getservbyname("exec", "tcp"); + if (!sv) { + errexit("Rexec: Lookup of port number for rexec service failed: %s.\n", + neterrstr()); + } + + server_addr.sin_family = PF_INET; + server_addr.sin_port = htons(sv->s_port); + + if((sIO=socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { + errexit("Rexec: I/O socket creation failed: %s.\n", + neterrstr()); + } + + if(connect(sIO, + (struct sockaddr *)&server_addr, sizeof server_addr) == SOCKET_ERROR) { + errexit("Rexec: I/O socket connection failed: %s.\n", + neterrstr()); + } + + memset(&my_err_addr, '\0', sizeof my_err_addr); + my_err_addr.sin_addr.s_addr = htonl(INADDR_ANY); + my_err_addr.sin_family = AF_INET; + my_err_addr.sin_port = 0; + + if ((sTmp=socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { + errexit("Rexec: Error socket creation failed: error=%s.\n", + neterrstr()); + } + + if (bind(sTmp, + (struct sockaddr *)&my_err_addr, sizeof my_err_addr) == SOCKET_ERROR) { + errexit("Rexec: Error socket bind failed: %s.\n", + neterrstr()); + (void) closesocket(sTmp); + } + + if (listen(sTmp, 1) == SOCKET_ERROR) { + errexit("Rexec: Error socket listen failed: %s.\n", + neterrstr()); + (void) closesocket(sTmp); + } + + addr_len = sizeof my_err_addr; + if (getsockname(sTmp, + (struct sockaddr *)&my_err_addr, &addr_len) == SOCKET_ERROR) { + errexit("Rexec: Error socket bind failed: %s.\n", + neterrstr()); + (void) closesocket(sTmp); + } + + sprintf(portbuf, "%hu", ntohs(my_err_addr.sin_port)); + SendZString(portbuf); + + addr_len = sizeof junk_addr; + if ((sErr = accept(sTmp, (struct sockaddr *)&junk_addr, &addr_len)) == INVALID_SOCKET) { + errexit("Rexec: Error socket accept failed: %s.\n", + neterrstr()); + (void) closesocket(sTmp); + } + + (void) closesocket(sTmp); } - - static BOOL Send(SOCKET s, const char *buf, size_t nbuf) { - int cnt; - size_t sent = 0; - - while (sent < nbuf) { - cnt = send(s, &buf[sent], nbuf-sent, 0); - if (cnt == -1) { - return FALSE; - } - sent += cnt; - } - return TRUE; + int cnt; + size_t sent = 0; + + while (sent < nbuf) { + cnt = send(s, &buf[sent], nbuf-sent, 0); + if (cnt == -1) { + return FALSE; + } + sent += cnt; + } + return TRUE; } static BOOL SendZString(const char *str) { - return Send(sIO, str, strlen(str)+1); + return Send(sIO, str, strlen(str)+1); } static BOOL GetErrString(char *str, size_t len) { - size_t pos = 0; - - while (pos < len) { - char ch; - if (recv(sIO, &ch, 1, 0) != 1) { - return FALSE; - } - str[pos++] = ch; - if (ch == '\0') { - return TRUE; - } - if (ch == '\n') { - return TRUE; - } - } - return FALSE; + size_t pos = 0; + + while (pos < len) { + char ch; + if (recv(sIO, &ch, 1, 0) != 1) { + return FALSE; + } + str[pos++] = ch; + if (ch == '\0') { + return TRUE; + } + if (ch == '\n') { + return TRUE; + } + } + return FALSE; } static IDENT PassOutput() { - IDENT id; - id = (IDENT)_beginthread(PassOutputThread, 4096, (void *)sIO); - if ((long)id == -1) { - errexit("Rexec: Could not start output passing thread: error = %lu\n", GetLastError()); - } - return id; + IDENT id; + id = (IDENT)_beginthread(PassOutputThread, 4096, (void *)sIO); + if ((long)id == -1) { + errexit("Rexec: Could not start output passing thread: error = %lu\n", + GetLastError()); + } + return id; } static void PassOutputThread(SOCKET sIO) { - RETVAL retval = 0; - int count; - char buf[4096]; - - while ((count=recv(sIO, buf, sizeof buf, 0)) > 0) { - if (!Write(STDOUTPUT, buf, count)) { - fprintf(stderr, "Error writing to standard output: error = %lu.\n", GetLastError()); - retval = 1; - break; - } - } - - _endthread(); + RETVAL retval = 0; + int count; + char buf[4096]; + + while ((count=recv(sIO, buf, sizeof buf, 0)) > 0) { + if (!Write(STDOUTPUT, buf, count)) { + fprintf(stderr, + "Error writing to standard output: error = %lu.\n", + GetLastError()); + retval = 1; + break; + } + } + + _endthread(); } static IDENT PassError() { - IDENT id; - id = (IDENT)_beginthread(PassErrorThread, 4096, (void *)sErr); - if ((long)id == -1) { - errexit("Rexec: Could not start error passing thread: error = %lu\n", GetLastError()); - } - return id; + IDENT id; + id = (IDENT)_beginthread(PassErrorThread, 4096, (void *)sErr); + if ((long)id == -1) { + errexit("Rexec: Could not start error passing thread: error = %lu\n", + GetLastError()); + } + return id; } static void PassErrorThread(SOCKET sErr) { - RETVAL retval = 0; - int count; - char buf[4096]; - - while ((count=recv(sErr, buf, sizeof buf, 0)) > 0) { - if (!Write(STDERROR, buf, count)) { - fprintf(stderr, "Error writing to standard error: error = %lu.\n", GetLastError()); - retval = 1; - break; - } - } - _endthread(); + RETVAL retval = 0; + int count; + char buf[4096]; + + while ((count=recv(sErr, buf, sizeof buf, 0)) > 0) { + if (!Write(STDERROR, buf, count)) { + fprintf(stderr, + "Error writing to standard error: error = %lu.\n", + GetLastError()); + retval = 1; + break; + } + } + _endthread(); } static BOOL Close(FILECOOKIE fc) { - return CloseHandle(fc); + return CloseHandle(fc); } static int Read(FILECOOKIE fc, char *buf, size_t nbuf) { - DWORD cbRead; - if (!ReadFile(fc, buf, nbuf, &cbRead, 0)) { - return -1; - } - return (int)cbRead; + DWORD cbRead; + if (!ReadFile(fc, buf, nbuf, &cbRead, 0)) { + return -1; + } + return (int)cbRead; } static BOOL Write(FILECOOKIE fc, const char *buf, size_t nbuf) { - DWORD cbWritten; - - if (!WriteFile(fc, buf, nbuf, &cbWritten, 0)) { - return FALSE; - } - if (cbWritten != nbuf) { - return FALSE; - } - return TRUE; + DWORD cbWritten; + + if (!WriteFile(fc, buf, nbuf, &cbWritten, 0)) { + return FALSE; + } + if (cbWritten != nbuf) { + return FALSE; + } + return TRUE; } static void Wait(IDENT id, RETVAL *prv) { - if (!WaitForSingleObject(id, INFINITE)) { - *prv = 2; - } else { - if (!GetExitCodeThread(id, prv)) { - *prv = 4; - } - } + if (!WaitForSingleObject(id, INFINITE)) { + *prv = 2; + } else { + if (!GetExitCodeThread(id, prv)) { + *prv = 4; + } + } } diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/statistics.c b/ACE/apps/JAWS/clients/WebSTONE/src/statistics.c index efc82c96e9a..ad20b0598b3 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/statistics.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/statistics.c @@ -1,13 +1,13 @@ /* $Id$ */ /************************************************************************** - * * - * Copyright (C) 1995 Silicon Graphics, Inc. * - * * - * These coded instructions, statements, and computer programs were * - * developed by SGI for public use. If any changes are made to this code* - * please try to get the changes back to the author. Feel free to make * - * modifications and changes to the code and release it. * - * * + * + * Copyright (C) 1995 Silicon Graphics, Inc. + * + * These coded instructions, statements, and computer programs were + * developed by SGI for public use. If any changes are made to this code + * please try to get the changes back to the author. Feel free to make + * modifications and changes to the code and release it. + * **************************************************************************/ /* FUZZ: disable check_for_math_include */ @@ -34,16 +34,16 @@ mean(const double sum, const int n) double variance(const double sum, const double sumofsquares, const int n) { - double meanofsum; + double meanofsum; - meanofsum = mean(sum, n); + meanofsum = mean(sum, n); - return (mean(sumofsquares,n) - (meanofsum * meanofsum)); + return (mean(sumofsquares,n) - (meanofsum * meanofsum)); } double stddev(const double sum, const double sumofsquares, const int n) { - return(sqrt(fabs(variance(sum, sumofsquares, n)))); + return(sqrt(fabs(variance(sum, sumofsquares, n)))); } diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/sysdep.c b/ACE/apps/JAWS/clients/WebSTONE/src/sysdep.c index 0976cf1df66..7302cc47a70 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/sysdep.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/sysdep.c @@ -1,13 +1,13 @@ /* $Id$ */ /************************************************************************** - * * - * Copyright (C) 1995 Silicon Graphics, Inc. * - * * - * These coded instructions, statements, and computer programs were * - * developed by SGI for public use. If any changes are made to this code* - * please try to get the changes back to the author. Feel free to make * - * modifications and changes to the code and release it. * - * * + * + * Copyright (C) 1995 Silicon Graphics, Inc. + * + * These coded instructions, statements, and computer programs were + * developed by SGI for public use. If any changes are made to this code + * please try to get the changes back to the author. Feel free to make + * modifications and changes to the code and release it. + * **************************************************************************/ #include "sysdep.h" @@ -19,11 +19,11 @@ extern char *sys_errlist[]; extern int errno; char *strerror(int errnum) -{ +{ if (errnum<sys_nerr) { - return(sys_errlist[errnum]); + return(sys_errlist[errnum]); } return(0); @@ -32,7 +32,7 @@ char *strerror(int errnum) #endif /* strerror() */ -/* stub routines for NT */ +/* stub routines for NT */ #ifdef WIN32 #include <winsock.h> diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/timefunc.c b/ACE/apps/JAWS/clients/WebSTONE/src/timefunc.c index fe38d821eac..38def53033a 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/timefunc.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/timefunc.c @@ -1,13 +1,13 @@ /* $Id$ */ /************************************************************************** - * * - * Copyright (C) 1995 Silicon Graphics, Inc. * - * * - * These coded instructions, statements, and computer programs were * - * developed by SGI for public use. If any changes are made to this code* - * please try to get the changes back to the author. Feel free to make * - * modifications and changes to the code and release it. * - * * + * + * Copyright (C) 1995 Silicon Graphics, Inc. + * + * These coded instructions, statements, and computer programs were + * developed by SGI for public use. If any changes are made to this code + * please try to get the changes back to the author. Feel free to make + * modifications and changes to the code and release it. + * **************************************************************************/ /* FUZZ: disable check_for_math_include */ @@ -35,7 +35,7 @@ timevaldouble(struct timeval *tin) void doubletimeval(const double tin, struct timeval *tout) { - tout->tv_sec = (long)floor(tin); + tout->tv_sec = (long)floor(tin); tout->tv_usec = (long)((tin - tout->tv_sec) * USECINSEC ); } @@ -114,7 +114,7 @@ maxtime(struct timeval *CurrMaxTime, struct timeval *CheckMaxTime) void avgtime(struct timeval *TotalTime, int NumTimes, struct timeval *AvgTime) { - double meantime; + double meantime; meantime = mean(timevaldouble(TotalTime), NumTimes); @@ -125,7 +125,7 @@ avgtime(struct timeval *TotalTime, int NumTimes, struct timeval *AvgTime) void sqtime(struct timeval *Time, struct timeval *SqTime) { - double sec; + double sec; sec = timevaldouble(Time); sec *= sec; /* square */ @@ -137,7 +137,7 @@ sqtime(struct timeval *Time, struct timeval *SqTime) void variancetime(struct timeval *SumTime, double SumSquareTime, int NumTimes, struct timeval *VarianceTime) { - double result; + double result; result = variance(timevaldouble(SumTime), SumSquareTime, NumTimes); @@ -147,9 +147,9 @@ variancetime(struct timeval *SumTime, double SumSquareTime, int NumTimes, struct void stddevtime(struct timeval *SumTime, double SumSquareTime, - int NumTimes, struct timeval *StdDevTime) + int NumTimes, struct timeval *StdDevTime) { - double result; + double result; result = stddev(timevaldouble(SumTime), SumSquareTime, NumTimes); @@ -160,12 +160,12 @@ double thruputpersec(const double n, struct timeval *t) { double tv; - + tv = timevaldouble(t); if (tv != 0) - return n / timevaldouble(t); + return n / timevaldouble(t); else - return 0; + return 0; } diff --git a/ACE/apps/drwho/Hash_Table.cpp b/ACE/apps/drwho/Hash_Table.cpp index c8d24860bc9..eb319caa29b 100644 --- a/ACE/apps/drwho/Hash_Table.cpp +++ b/ACE/apps/drwho/Hash_Table.cpp @@ -44,7 +44,7 @@ Hash_Table::get_next_entry (void) else { Protocol_Record *prp = this->current_ptr; - this->current_ptr = this->current_ptr->next_; + this->current_ptr = this->current_ptr->next_; return prp; } } |