CVS update: php3/functions

From: Date: Thu, 10 Sep 1998 20:22:35 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-916@lists.php.net to get a copy of this message
Date: Thursday September 10, 1998 @ 16:22 Author: zeev Update of /repository/php3/functions In directory asf:/u2/tmp/cvs-serv27979/functions Modified Files: hw.c Log Message: Fix for #735 Index: php3/functions/hw.c diff -c php3/functions/hw.c:1.7 php3/functions/hw.c:1.8 *** php3/functions/hw.c:1.7 Thu Sep 3 11:50:16 1998 --- php3/functions/hw.c Thu Sep 10 16:22:35 1998 *************** *** 23,29 **** +----------------------------------------------------------------------+ */ ! /* $Id: hw.c,v 1.7 1998/09/03 15:50:16 steinm Exp $ */ #if COMPILE_DL #include "dl/phpdl.h" #endif --- 23,29 ---- +----------------------------------------------------------------------+ */ ! /* $Id: hw.c,v 1.8 1998/09/10 20:22:35 zeev Exp $ */ #if COMPILE_DL #include "dl/phpdl.h" #endif *************** *** 163,171 **** free(doc); } ! // creates an array in return value and frees all memory ! // Also adds as an assoc. array at the end of the return array with ! // statistics. int make_return_objrec(YYSTYPE **return_value, char **objrecs, int count) { YYSTYPE stat_arr; --- 163,172 ---- free(doc); } ! /* creates an array in return value and frees all memory ! * Also adds as an assoc. array at the end of the return array with ! * statistics. ! */ int make_return_objrec(YYSTYPE **return_value, char **objrecs, int count) { YYSTYPE stat_arr; *************** *** 174,180 **** int collheadnr, fullcollheadnr; if (array_init(*return_value) == FAILURE) { ! // Ups, failed! Let's at least free the memory for(i=0; i<count; i++) efree(objrecs[i]); efree(objrecs); --- 175,181 ---- int collheadnr, fullcollheadnr; if (array_init(*return_value) == FAILURE) { ! /* Ups, failed! Let's at least free the memory */ for(i=0; i<count; i++) efree(objrecs[i]); efree(objrecs); *************** *** 184,191 **** hidden = collhead = fullcollhead = total = 0; collheadnr = fullcollheadnr = -1; for(i=0; i<count; i++) { ! // Fill the array with entries. No need to free objrecs[i], since ! // it is not duplicated in add_next_index_string(). if(NULL != objrecs[i]) { if(0 == fnAttributeCompare(objrecs[i], "PresentationHints", "Hidden")) hidden++; --- 185,193 ---- hidden = collhead = fullcollhead = total = 0; collheadnr = fullcollheadnr = -1; for(i=0; i<count; i++) { ! /* Fill the array with entries. No need to free objrecs[i], since ! * it is not duplicated in add_next_index_string(). ! */ if(NULL != objrecs[i]) { if(0 == fnAttributeCompare(objrecs[i], "PresentationHints", "Hidden")) hidden++; *************** *** 240,259 **** } /* Array for titles. Only if we have at least one title */ ! // if(0 == strncmp(objrec, "Title=", 6)) { if (array_init(&title_arr) == FAILURE) { return -1; } hasTitle = 1; ! // } /* Array for Descriptions. Only if we have at least one description */ ! // if(0 == strncmp(objrec, "Description=", 12)) { if (array_init(&desc_arr) == FAILURE) { return -1; } hasDescription = 1; ! // } /* Fill Array of titles and descriptions */ temp = estrdup(objrec); --- 242,261 ---- } /* Array for titles. Only if we have at least one title */ ! /* if(0 == strncmp(objrec, "Title=", 6)) { */ if (array_init(&title_arr) == FAILURE) { return -1; } hasTitle = 1; ! /* } */ /* Array for Descriptions. Only if we have at least one description */ ! /* if(0 == strncmp(objrec, "Description=", 12)) { */ if (array_init(&desc_arr) == FAILURE) { return -1; } hasDescription = 1; ! /* } */ /* Fill Array of titles and descriptions */ temp = estrdup(objrec); *************** *** 511,517 **** RETURN_FALSE; } if (php3_hw_module.max_persistent!=-1 && php3_hw_module.num_persistent>=php3_hw_module.max_persistent) { ! // php3_error(E_WARNING,"Hyperwave: Too many open persistent links (%d)",php3_hw_module.num_persistent); if(host) efree(host); if(username) efree(username); if(password) efree(password); --- 513,519 ---- RETURN_FALSE; } if (php3_hw_module.max_persistent!=-1 && php3_hw_module.num_persistent>=php3_hw_module.max_persistent) { ! /* php3_error(E_WARNING,"Hyperwave: Too many open persistent links (%d)",php3_hw_module.num_persistent); */ if(host) efree(host); if(username) efree(username); if(password) efree(password); *************** *** 520,526 **** } if ( (sockfd = open_hg_connection(host, port)) < 0 ) { ! // php3_error(E_WARNING, "open_hg_connection to %s (%d)returned -1", host, port); if(host) efree(host); if(username) efree(username); if(password) efree(password); --- 522,528 ---- } if ( (sockfd = open_hg_connection(host, port)) < 0 ) { ! /* php3_error(E_WARNING, "open_hg_connection to %s (%d)returned -1", host, port); */ if(host) efree(host); if(username) efree(username); if(password) efree(password); *************** *** 537,543 **** } if(0 != (ptr->lasterror = initialize_hg_connection(sockfd, &do_swap, &version, &userdata, &server_string, username, password))) { ! // php3_error(E_WARNING, "initalize hg connection returned -1"); if(host) efree(host); if(username) efree(username); if(password) efree(password); --- 539,545 ---- } if(0 != (ptr->lasterror = initialize_hg_connection(sockfd, &do_swap, &version, &userdata, &server_string, username, password))) { ! /* php3_error(E_WARNING, "initalize hg connection returned -1"); */ if(host) efree(host); if(username) efree(username); if(password) efree(password); *************** *** 573,579 **** php3_hw_module.num_links++; php3_hw_module.num_persistent++; } else { ! //php3_printf("Found already open connection\n"); if (le->type != php3_hw_module.le_psocketp) { RETURN_FALSE; } --- 575,581 ---- php3_hw_module.num_links++; php3_hw_module.num_persistent++; } else { ! /*php3_printf("Found already open connection\n"); */ if (le->type != php3_hw_module.le_psocketp) { RETURN_FALSE; } *************** *** 614,620 **** } if ( (sockfd = open_hg_connection(host, port)) < 0 ) { ! // php3_error(E_WARNING, "open_hg_connection returned -1"); if(host) efree(host); if(username) efree(username); if(password) efree(password); --- 616,622 ---- } if ( (sockfd = open_hg_connection(host, port)) < 0 ) { ! /* php3_error(E_WARNING, "open_hg_connection returned -1");*/ if(host) efree(host); if(username) efree(username); if(password) efree(password); *************** *** 631,637 **** } if(0 != (ptr->lasterror = initialize_hg_connection(sockfd, &do_swap, &version, &userdata, &server_string, username, password))) { ! // php3_error(E_WARNING, "initalize hg connection returned -1"); if(host) efree(host); if(username) efree(username); if(password) efree(password); --- 633,639 ---- } if(0 != (ptr->lasterror = initialize_hg_connection(sockfd, &do_swap, &version, &userdata, &server_string, username, password))) { ! /* php3_error(E_WARNING, "initalize hg connection returned -1"); */ if(host) efree(host); if(username) efree(username); if(password) efree(password); *************** *** 734,741 **** RETURN_FALSE; } if(NULL != (str = get_hw_info(ptr))) { ! // php3_printf("%s\n", str); ! // efree(str); return_value->value.str.len = strlen(str); return_value->value.str.val = str; return_value->type = IS_STRING; --- 736,745 ---- RETURN_FALSE; } if(NULL != (str = get_hw_info(ptr))) { ! /* ! php3_printf("%s\n", str); ! efree(str); ! */ return_value->value.str.len = strlen(str); return_value->value.str.val = str; return_value->type = IS_STRING; *************** *** 1064,1071 **** RETURN_FALSE; RETURN_STRING(object, 0); ! // make_return_array_from_objrec(&return_value, object); ! // efree(object); } } --- 1068,1077 ---- RETURN_FALSE; RETURN_STRING(object, 0); ! /* ! make_return_array_from_objrec(&return_value, object); ! efree(object); ! */ } } *************** *** 1586,1592 **** if(strncmp(remainder, "ObjectID=0 ", 10)) { hw_document *doc; remainder[offsets[0]-18] = '\0'; ! //php3_printf("offset = %d, remainder = %s---", offsets[0], remainder); doc = malloc(sizeof(hw_document)); doc->data = strdup(remainder); doc->attributes = strdup(objrec); --- 1592,1598 ---- if(strncmp(remainder, "ObjectID=0 ", 10)) { hw_document *doc; remainder[offsets[0]-18] = '\0'; ! /*php3_printf("offset = %d, remainder = %s---", offsets[0], remainder);*/ doc = malloc(sizeof(hw_document)); doc->data = strdup(remainder); doc->attributes = strdup(objrec); *************** *** 1965,1971 **** } RETURN_STRING(ptr->attributes, 1); ! // make_return_array_from_objrec(&return_value, ptr->attributes); } void php3_hw_getparentsobj(INTERNAL_FUNCTION_PARAMETERS) { --- 1971,1977 ---- } RETURN_STRING(ptr->attributes, 1); ! /* make_return_array_from_objrec(&return_value, ptr->attributes); */ } void php3_hw_getparentsobj(INTERNAL_FUNCTION_PARAMETERS) { *************** *** 1996,2002 **** RETURN_FALSE; } ! // create return value and free all memory if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; } --- 2002,2008 ---- RETURN_FALSE; } ! /* create return value and free all memory */ if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; } *************** *** 2115,2121 **** RETURN_FALSE; } ! // create return value and free all memory if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; } --- 2121,2127 ---- RETURN_FALSE; } ! /* create return value and free all memory */ if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; } *************** *** 2191,2197 **** RETURN_FALSE; } ! // create return value and free all memory if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; } --- 2197,2203 ---- RETURN_FALSE; } ! /* create return value and free all memory */ if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; } *************** *** 2327,2333 **** RETURN_FALSE; } ! // create return value and free all memory if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; } --- 2333,2339 ---- RETURN_FALSE; } ! /* create return value and free all memory */ if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; } *************** *** 2408,2414 **** RETURN_FALSE; } ! // create return value and free all memory if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; } --- 2414,2420 ---- RETURN_FALSE; } ! /* create return value and free all memory */ if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; } *************** *** 2477,2483 **** RETURN_FALSE; } ! // create return value and free all memory if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; --- 2483,2489 ---- RETURN_FALSE; } ! /* create return value and free all memory */ if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; *************** *** 2547,2553 **** RETURN_FALSE; } ! // create return value and free all memory if( 0 > make_return_objrec(&return_value, anchorObjRecs, count)) RETURN_FALSE; } --- 2553,2559 ---- RETURN_FALSE; } ! /* create return value and free all memory */ if( 0 > make_return_objrec(&return_value, anchorObjRecs, count)) RETURN_FALSE; } *************** *** 2813,2819 **** RETURN_FALSE; } ! // create return value and free all memory if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; } --- 2819,2825 ---- RETURN_FALSE; } ! /* create return value and free all memory */ if( 0 > make_return_objrec(&return_value, childObjRecs, count)) RETURN_FALSE; } -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#916) next »