CVS update: php3/functions
| From: | steinm | Date: | Mon, 24 Aug 1998 12:51:05 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-545@lists.php.net to get a copy of this message | ||
Date: Monday August 24, 1998 @ 8:51
Author: steinm
Update of /repository/php3/functions
In directory asf:/tmp/cvs-serv23069/functions
Modified Files:
hg_comm.c
Log Message:
replaced C++ style comments with ANSI style comments
Index: php3/functions/hg_comm.c
diff -c php3/functions/hg_comm.c:1.3 php3/functions/hg_comm.c:1.4
*** php3/functions/hg_comm.c:1.3 Fri Aug 21 10:03:54 1998
--- php3/functions/hg_comm.c Mon Aug 24 08:51:01 1998
***************
*** 23,29 ****
+----------------------------------------------------------------------+
*/
! /* $Id: hg_comm.c,v 1.3 1998/08/21 14:03:54 rasmus Exp $ */
/* #define HW_DEBUG */
--- 23,29 ----
+----------------------------------------------------------------------+
*/
! /* $Id: hg_comm.c,v 1.4 1998/08/24 12:51:01 steinm Exp $ */
/* #define HW_DEBUG */
***************
*** 488,495 ****
break;
case HW_INTAG_LINK:
sprintf(istr, " %s='%s' start=%d", cur_ptr->tagattr,
cur_ptr->link, cur_ptr->start);
! offset -= 4; // because there is no closing tag </A>
! // laststart = cur_ptr->start;
break;
case HW_APPLET_LINK:
if(cur_ptr->codebase)
--- 488,495 ----
break;
case HW_INTAG_LINK:
sprintf(istr, " %s='%s' start=%d", cur_ptr->tagattr,
cur_ptr->link, cur_ptr->start);
! offset -= 4; /* because there is no closing tag </A> */
! /* laststart = cur_ptr->start; */
break;
case HW_APPLET_LINK:
if(cur_ptr->codebase)
***************
*** 511,526 ****
break;
case HW_INTAG_LINK:
if(cur_ptr->fragment)
! // sprintf(istr, " %s='%s/%s#%s'", cur_ptr->tagattr, scriptname ==
NULL ? "schade" : scriptname, cur_ptr->destdocname, cur_ptr->fragment);
sprintf(istr, " %s='#%s'", cur_ptr->tagattr, cur_ptr->fragment);
else
sprintf(istr, " %s='%s/%s'", cur_ptr->tagattr, scriptname == NULL ?
"schade" : scriptname, cur_ptr->destdocname);
! offset -= 4; // because there is no closing tag </A>
! // laststart = cur_ptr->start;
break;
case HW_APPLET_LINK:
if(cur_ptr->codebase)
! //sprintf(istr, " CODEBASE='%s%s' CODE='%s'", scriptname ==
NULL ? "" : scriptname, cur_ptr->codebase, cur_ptr->code);
sprintf(istr, " CODEBASE='%s' CODE='%s'",
cur_ptr->codebase, cur_ptr->code);
else
sprintf(istr, " CODEBASE='/' CODE='%s'", cur_ptr->code);
--- 511,526 ----
break;
case HW_INTAG_LINK:
if(cur_ptr->fragment)
! /* sprintf(istr, " %s='%s/%s#%s'", cur_ptr->tagattr, scriptname ==
NULL ? "schade" : scriptname, cur_ptr->destdocname, cur_ptr->fragment);*/
sprintf(istr, " %s='#%s'", cur_ptr->tagattr, cur_ptr->fragment);
else
sprintf(istr, " %s='%s/%s'", cur_ptr->tagattr, scriptname == NULL ?
"schade" : scriptname, cur_ptr->destdocname);
! offset -= 4; /* because there is no closing tag </A> */
! /* laststart = cur_ptr->start; */
break;
case HW_APPLET_LINK:
if(cur_ptr->codebase)
! /* sprintf(istr, " CODEBASE='%s%s' CODE='%s'", scriptname ==
NULL ? "" : scriptname, cur_ptr->codebase, cur_ptr->code); */
sprintf(istr, " CODEBASE='%s' CODE='%s'",
cur_ptr->codebase, cur_ptr->code);
else
sprintf(istr, " CODEBASE='/' CODE='%s'", cur_ptr->code);
***************
*** 624,631 ****
(str[-1] != '\n')) {
return(-2);
}
! str += strlen(attrname); // skip the attribute name
! str++; // skip the equal sign
/* Search for end of attribute value */
str1 = str;
--- 624,631 ----
(str[-1] != '\n')) {
return(-2);
}
! str += strlen(attrname); /* skip the attribute name */
! str++; /* skip the equal sign */
/* Search for end of attribute value */
str1 = str;
***************
*** 899,905 ****
struct sockaddr_in server_addr;
struct hostent *hp;
if ( (hp = gethostbyname(server_name)) == NULL ) {
! // php3_error(E_WARNING, "gethostbyname failed for %s", server_name);
return(-1);
}
--- 899,905 ----
struct sockaddr_in server_addr;
struct hostent *hp;
if ( (hp = gethostbyname(server_name)) == NULL ) {
! /* php3_error(E_WARNING, "gethostbyname failed for %s", server_name); */
return(-1);
}
***************
*** 912,918 ****
bcopy(hp->h_addr, (char *) &server_addr.sin_addr, hp->h_length);
if ( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0 ) {
! // php3_error(E_WARNING, "socket");
return(-1);
}
--- 912,918 ----
bcopy(hp->h_addr, (char *) &server_addr.sin_addr, hp->h_length);
if ( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0 ) {
! /* php3_error(E_WARNING, "socket"); */
return(-1);
}
***************
*** 923,935 ****
#endif SUN
if (connect(sockfd, (struct sockaddr *) &server_addr, sizeof(server_addr)) < 0) {
! // php3_error(E_WARNING, "connect");
close(sockfd);
return(-1);
}
if ( (sock_flags = fcntl(sockfd, F_GETFL, 0)) == -1 )
! // php3_error(E_WARNING, "open_hg_connection: F_GETFL");
if ( set_nonblocking(sockfd) == -1 ) {
return(-1);
--- 923,935 ----
#endif SUN
if (connect(sockfd, (struct sockaddr *) &server_addr, sizeof(server_addr)) < 0) {
! /* php3_error(E_WARNING, "connect"); */
close(sockfd);
return(-1);
}
if ( (sock_flags = fcntl(sockfd, F_GETFL, 0)) == -1 )
! /* php3_error(E_WARNING, "open_hg_connection: F_GETFL"); */
if ( set_nonblocking(sockfd) == -1 ) {
return(-1);
***************
*** 954,983 ****
*do_swap = 0;
buf = 'T';
if ( hg_write(sockfd, &buf, 1) == -1 ) {
! // php3_error(E_WARNING, "initialize_hg_connection: hg_write (1) returned -1\n");
return(-1);
}
if ( hg_read_exact(sockfd, &buf, 1) == -1 ) {
! // php3_error(E_WARNING, "initialize_hg_connection: hg_read (1) returned -1\n");
return(-1);
}
if ( buf == 'F' ) {
! // php3_error(E_WARNING, "initialize_hg_connection: got >>F<< from
server\n");
return(-1);
}
if ( buf != 'T' ) {
! // php3_error(E_WARNING, "initialize_hg_connection: neither >>F<< nor
>>T<< from server\n");
return(-1);
}
buf = c = ( *(char *)&i ) ? 'l' : 'B';
if ( hg_write(sockfd, &buf, 1) == -1 ) {
! // php3_error(E_WARNING, "initialize_hg_connection: hg_write (2) returned -1\n");
return(-1);
}
if ( hg_read_exact(sockfd, &buf, 1) == -1 ) {
! // php3_error(E_WARNING, "initialize_hg_connection: hg_read (2) returned -1\n");
return(-1);
}
if ( c != buf ) {
--- 954,983 ----
*do_swap = 0;
buf = 'T';
if ( hg_write(sockfd, &buf, 1) == -1 ) {
! /* php3_error(E_WARNING, "initialize_hg_connection: hg_write (1) returned -1\n"); */
return(-1);
}
if ( hg_read_exact(sockfd, &buf, 1) == -1 ) {
! /* php3_error(E_WARNING, "initialize_hg_connection: hg_read (1) returned -1\n"); */
return(-1);
}
if ( buf == 'F' ) {
! /* php3_error(E_WARNING, "initialize_hg_connection: got >>F<< from
server\n"); */
return(-1);
}
if ( buf != 'T' ) {
! /* php3_error(E_WARNING, "initialize_hg_connection: neither >>F<< nor
>>T<< from server\n"); */
return(-1);
}
buf = c = ( *(char *)&i ) ? 'l' : 'B';
if ( hg_write(sockfd, &buf, 1) == -1 ) {
! /* php3_error(E_WARNING, "initialize_hg_connection: hg_write (2) returned -1\n"); */
return(-1);
}
if ( hg_read_exact(sockfd, &buf, 1) == -1 ) {
! /* php3_error(E_WARNING, "initialize_hg_connection: hg_read (2) returned -1\n"); */
return(-1);
}
if ( c != buf ) {
***************
*** 989,1001 ****
}
if ( send_ready(sockfd) == -1) {
! // php3_error(E_WARNING, "send ready msg returned -1");
return(-1);
}
/* Receive return from Ready message */
if ( (ready_msg = recv_ready(sockfd)) == NULL ) {
! // php3_error(E_WARNING, "initialize_hg_connection: recv_ready returned NULL\n");
return(-1);
}
--- 989,1001 ----
}
if ( send_ready(sockfd) == -1) {
! /* php3_error(E_WARNING, "send ready msg returned -1"); */
return(-1);
}
/* Receive return from Ready message */
if ( (ready_msg = recv_ready(sockfd)) == NULL ) {
! /* php3_error(E_WARNING, "initialize_hg_connection: recv_ready returned NULL\n"); */
return(-1);
}
***************
*** 1126,1163 ****
hg_msg *msg;
if ( (msg = (hg_msg *)emalloc(sizeof(hg_msg))) == NULL ) {
! // php3_printf("recv_hg_msg");
lowerror = LE_MALLOC;
return(NULL);
}
if ( hg_read_exact(sockfd, (char *)&(msg->length), 4) == -1 ) {
! // php3_printf("recv_hg_msg: hg_read (1) returned -1\n");
efree(msg);
return(NULL);
}
if ( hg_read_exact(sockfd, (char *)&(msg->version_msgid), 4) == -1 ) {
! // php3_printf("recv_hg_msg: hg_read (2) returned -1\n");
efree(msg);
return(NULL);
}
if ( hg_read_exact(sockfd, (char *)&(msg->msg_type), 4) == -1 ) {
! // php3_printf("recv_hg_msg: hg_read (3) returned -1\n");
efree(msg);
return(NULL);
}
if ( msg->length > HEADER_LENGTH ) {
if ( (msg->buf = (char *) emalloc(msg->length-HEADER_LENGTH)) == NULL ) {
! // php3_printf("recv_hg_msg");
lowerror = LE_MALLOC;
efree(msg);
return(NULL);
}
if ( hg_read_exact(sockfd, msg->buf, msg->length-HEADER_LENGTH) == -1 ) {
! // php3_printf("recv_hg_msg: hg_read (4) returned -1\n");
efree(msg->buf);
efree(msg);
return(NULL);
--- 1126,1163 ----
hg_msg *msg;
if ( (msg = (hg_msg *)emalloc(sizeof(hg_msg))) == NULL ) {
! /* php3_printf("recv_hg_msg"); */
lowerror = LE_MALLOC;
return(NULL);
}
if ( hg_read_exact(sockfd, (char *)&(msg->length), 4) == -1 ) {
! /* php3_printf("recv_hg_msg: hg_read (1) returned -1\n"); */
efree(msg);
return(NULL);
}
if ( hg_read_exact(sockfd, (char *)&(msg->version_msgid), 4) == -1 ) {
! /* php3_printf("recv_hg_msg: hg_read (2) returned -1\n"); */
efree(msg);
return(NULL);
}
if ( hg_read_exact(sockfd, (char *)&(msg->msg_type), 4) == -1 ) {
! /* php3_printf("recv_hg_msg: hg_read (3) returned -1\n"); */
efree(msg);
return(NULL);
}
if ( msg->length > HEADER_LENGTH ) {
if ( (msg->buf = (char *) emalloc(msg->length-HEADER_LENGTH)) == NULL ) {
! /* php3_printf("recv_hg_msg"); */
lowerror = LE_MALLOC;
efree(msg);
return(NULL);
}
if ( hg_read_exact(sockfd, msg->buf, msg->length-HEADER_LENGTH) == -1 ) {
! /* php3_printf("recv_hg_msg: hg_read (4) returned -1\n"); */
efree(msg->buf);
efree(msg);
return(NULL);
***************
*** 1178,1188 ****
hg_msg *ready_msg;
if ( (ready_msg = recv_hg_msg(sockfd)) == NULL ) {
! // php3_printf("recv_ready: recv_hg_msg returned NULL\n");
return(NULL);
}
if ( ready_msg->msg_type != READY_MESSAGE ) {
! // php3_printf("recv_ready: recv_hg_msg returned wrong message: %d, %d \n",
ready_msg->length, ready_msg->msg_type);
efree(ready_msg);
return(NULL);
}
--- 1178,1188 ----
hg_msg *ready_msg;
if ( (ready_msg = recv_hg_msg(sockfd)) == NULL ) {
! /* php3_printf("recv_ready: recv_hg_msg returned NULL\n"); */
return(NULL);
}
if ( ready_msg->msg_type != READY_MESSAGE ) {
! /* php3_printf("recv_ready: recv_hg_msg returned wrong message: %d, %d \n",
ready_msg->length, ready_msg->msg_type); */
efree(ready_msg);
return(NULL);
}
***************
*** 1196,1206 ****
hg_msg *comm_msg;
if ( (comm_msg = recv_hg_msg(sockfd)) == NULL ) {
! // fprintf(stderr, "recv_command: recv_hg_msg returned NULL\n");
return(NULL);
}
if ( comm_msg->msg_type != COMMAND_MESSAGE ) {
! // fprintf(stderr, "recv_command: recv_hg_msg returned wrong message\n");
return(NULL);
}
--- 1196,1206 ----
hg_msg *comm_msg;
if ( (comm_msg = recv_hg_msg(sockfd)) == NULL ) {
! /* fprintf(stderr, "recv_command: recv_hg_msg returned NULL\n"); */
return(NULL);
}
if ( comm_msg->msg_type != COMMAND_MESSAGE ) {
! /* fprintf(stderr, "recv_command: recv_hg_msg returned wrong message\n"); */
return(NULL);
}
***************
*** 1218,1224 ****
build_msg_header(&msg, length, msgid++, msgid);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 1218,1224 ----
build_msg_header(&msg, length, msgid++, msgid);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 1262,1268 ****
build_msg_header(&msg, length, msgid++, DELETEOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 1262,1268 ----
build_msg_header(&msg, length, msgid++, DELETEOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 1314,1320 ****
build_msg_header(&msg, length, msgid++, CHANGEOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 1314,1320 ----
build_msg_header(&msg, length, msgid++, CHANGEOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 1361,1367 ****
build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 1361,1367 ----
build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 1420,1426 ****
build_msg_header(&msg, length, msgid++, GETANDLOCK_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 1420,1426 ----
build_msg_header(&msg, length, msgid++, GETANDLOCK_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 1462,1475 ****
build_msg_header(&msg, length, msgid++, INSERTOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
tmp = build_msg_str(msg.buf, objrec);
tmp = build_msg_str(tmp, parms);
! //fprintf(stderr,"objrec = %s, parms = %s\n", objrec, parms);
if ( send_hg_msg(sockfd, &msg, length) == -1 ) {
efree(msg.buf);
--- 1462,1475 ----
build_msg_header(&msg, length, msgid++, INSERTOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
tmp = build_msg_str(msg.buf, objrec);
tmp = build_msg_str(tmp, parms);
! /*fprintf(stderr,"objrec = %s, parms = %s\n", objrec, parms); */
if ( send_hg_msg(sockfd, &msg, length) == -1 ) {
efree(msg.buf);
***************
*** 1506,1512 ****
build_msg_header(&msg, length, msgid++, UNLOCK_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 1506,1512 ----
build_msg_header(&msg, length, msgid++, UNLOCK_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 1700,1706 ****
build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 1700,1706 ----
build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 1736,1742 ****
build_msg_header(&msg, length, msgid++, GETTEXT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 1736,1742 ----
build_msg_header(&msg, length, msgid++, GETTEXT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 1765,1771 ****
*count = retmsg->length-HEADER_LENGTH-sizeof(int);
if(NULL != (*text = malloc(*count + 1))) {
memcpy(*text, retmsg->buf+sizeof(int), *count);
! // *text[*count] = 0;
} else {
efree(retmsg);
efree(retmsg->buf);
--- 1765,1771 ----
*count = retmsg->length-HEADER_LENGTH-sizeof(int);
if(NULL != (*text = malloc(*count + 1))) {
memcpy(*text, retmsg->buf+sizeof(int), *count);
! /* *text[*count] = 0; */
} else {
efree(retmsg);
efree(retmsg->buf);
***************
*** 1876,1882 ****
build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 1876,1882 ----
build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 1912,1918 ****
build_msg_header(&msg, length, msgid++, GETCGI_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 1912,1918 ----
build_msg_header(&msg, length, msgid++, GETCGI_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 1953,1959 ****
return(-1);
}
} else {
! error = *ptr + 1024; // move errors to >2024
efree(retmsg);
efree(retmsg->buf);
*text = NULL;
--- 1953,1959 ----
return(-1);
}
} else {
! error = *ptr + 1024; /* move errors to >2024 */
efree(retmsg);
efree(retmsg->buf);
*text = NULL;
***************
*** 1976,1982 ****
build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 1976,1982 ----
build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2012,2018 ****
build_msg_header(&msg, length, msgid++, GETREMOTE_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2012,2018 ----
build_msg_header(&msg, length, msgid++, GETREMOTE_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2040,2046 ****
*count = retmsg->length-HEADER_LENGTH-sizeof(int)-sizeof(int);
if(NULL != (*text = malloc(*count + 1))) {
memcpy(*text, ptr+2, *count);
! // *text[*count] = 0;
} else {
efree(retmsg);
efree(retmsg->buf);
--- 2040,2046 ----
*count = retmsg->length-HEADER_LENGTH-sizeof(int)-sizeof(int);
if(NULL != (*text = malloc(*count + 1))) {
memcpy(*text, ptr+2, *count);
! /* *text[*count] = 0; */
} else {
efree(retmsg);
efree(retmsg->buf);
***************
*** 2048,2054 ****
return(-1);
}
} else {
! error = *ptr + 1024; // move errors to >2024
efree(retmsg);
efree(retmsg->buf);
*text = NULL;
--- 2048,2054 ----
return(-1);
}
} else {
! error = *ptr + 1024; /* move errors to >2024 */
efree(retmsg);
efree(retmsg->buf);
*text = NULL;
***************
*** 2071,2077 ****
build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
- // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2071,2076 ----
***************
*** 2107,2113 ****
build_msg_header(&msg, length, msgid++, GETREMOTECHILDREN_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2106,2112 ----
build_msg_header(&msg, length, msgid++, GETREMOTECHILDREN_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2115,2121 ****
tmp = build_msg_str(msg.buf, attributes);
tmp = build_msg_int(tmp, 0);
! // efree(attributes);
if ( send_hg_msg(sockfd, &msg, length) == -1 ) {
efree(msg.buf);
--- 2114,2120 ----
tmp = build_msg_str(msg.buf, attributes);
tmp = build_msg_int(tmp, 0);
! /* efree(attributes); */
if ( send_hg_msg(sockfd, &msg, length) == -1 ) {
efree(msg.buf);
***************
*** 2148,2156 ****
}
remlen = retmsg->length - HEADER_LENGTH - *count * sizeof(int) - 2 * sizeof(int);
! //ptr1[i-1] = remlen;
! //ptr1[i-2] = sum;
! //ptr1[i-3] = *count;
if(NULL != (*text = emalloc(remlen + 1))) {
memcpy(*text, ptr, remlen);
} else {
--- 2147,2155 ----
}
remlen = retmsg->length - HEADER_LENGTH - *count * sizeof(int) - 2 * sizeof(int);
! /*ptr1[i-1] = remlen; */
! /*ptr1[i-2] = sum; */
! /*ptr1[i-3] = *count; */
if(NULL != (*text = emalloc(remlen + 1))) {
memcpy(*text, ptr, remlen);
} else {
***************
*** 2195,2201 ****
}
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2194,2200 ----
}
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2236,2242 ****
build_msg_header(&msg, length, msgid++, GETDOCBYANCHOR_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2235,2241 ----
build_msg_header(&msg, length, msgid++, GETDOCBYANCHOR_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2278,2284 ****
build_msg_header(&msg, length, msgid++, GETDOCBYANCHOR_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2277,2283 ----
build_msg_header(&msg, length, msgid++, GETDOCBYANCHOR_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2323,2329 ****
build_msg_header(&msg, length, msgid++, CHILDREN_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2322,2328 ----
build_msg_header(&msg, length, msgid++, CHILDREN_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2383,2389 ****
build_msg_header(&msg, length, msgid++, CHILDREN_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2382,2388 ----
build_msg_header(&msg, length, msgid++, CHILDREN_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2425,2431 ****
return error;
}
! // Now get for each child collection the object record
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
--- 2424,2430 ----
return error;
}
! /* Now get for each child collection the object record */
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
***************
*** 2450,2456 ****
efree(childIDs);
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! // if emalloc fails, get at least all remaining messages from server
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
--- 2449,2455 ----
efree(childIDs);
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! /* if emalloc fails, get at least all remaining messages from server */
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
***************
*** 2495,2501 ****
build_msg_header(&msg, length, msgid++, GETCHILDCOLL_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2494,2500 ----
build_msg_header(&msg, length, msgid++, GETCHILDCOLL_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2555,2561 ****
build_msg_header(&msg, length, msgid++, GETCHILDCOLL_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2554,2560 ----
build_msg_header(&msg, length, msgid++, GETCHILDCOLL_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2597,2603 ****
return error;
}
! // Now get for each child collection the object record
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
--- 2596,2602 ----
return error;
}
! /* Now get for each child collection the object record */
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
***************
*** 2622,2628 ****
efree(childIDs);
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! // if emalloc fails, get at least all remaining messages from server
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
--- 2621,2627 ----
efree(childIDs);
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! /* if emalloc fails, get at least all remaining messages from server */
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
***************
*** 2666,2672 ****
build_msg_header(&msg, length, msgid++, GETCHILDDOCCOLL_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2665,2671 ----
build_msg_header(&msg, length, msgid++, GETCHILDDOCCOLL_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2726,2732 ****
build_msg_header(&msg, length, msgid++, GETCHILDDOCCOLL_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2725,2731 ----
build_msg_header(&msg, length, msgid++, GETCHILDDOCCOLL_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2768,2780 ****
}
}
! // Now get for each child collection the object record
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2767,2779 ----
}
}
! /* Now get for each child collection the object record */
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2790,2796 ****
}
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! // if emalloc fails, get at least all remaining messages from server
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
--- 2789,2795 ----
}
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! /* if emalloc fails, get at least all remaining messages from server */
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
***************
*** 2835,2841 ****
build_msg_header(&msg, length, msgid++, GETANCHORS_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2834,2840 ----
build_msg_header(&msg, length, msgid++, GETANCHORS_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2893,2899 ****
build_msg_header(&msg, length, 50, GETANCHORS_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2892,2898 ----
build_msg_header(&msg, length, 50, GETANCHORS_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2934,2947 ****
return error;
}
! // Now get for each anchor the object record
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
build_msg_header(&msg, length, anchorIDs[i], GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 2933,2946 ----
return error;
}
! /* Now get for each anchor the object record */
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
build_msg_header(&msg, length, anchorIDs[i], GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 2958,2964 ****
if(anchorIDs) efree(anchorIDs);
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! // if emalloc fails, get at least all remaining messages from server
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
--- 2957,2963 ----
if(anchorIDs) efree(anchorIDs);
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! /* if emalloc fails, get at least all remaining messages from server */
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
***************
*** 3003,3009 ****
return -1;
}
! // Now get for each anchor the object record of its destination
for(i=0; i<count; i++) {
/* if you retrieve the anchors you sometimes get more than actually accessible.
This happens for the object 0x29a9c. */
--- 3002,3008 ----
return -1;
}
! /* Now get for each anchor the object record of its destination */
for(i=0; i<count; i++) {
/* if you retrieve the anchors you sometimes get more than actually accessible.
This happens for the object 0x29a9c. */
***************
*** 3044,3050 ****
return -1;
}
! // Now get for each anchor the object record of its destination
for(i=0; i<count; i++) {
/* if you retrieve the anchors you sometimes get more than actually accessible.
This happens for the object 0x29a9c. */
--- 3043,3049 ----
return -1;
}
! /* Now get for each anchor the object record of its destination */
for(i=0; i<count; i++) {
/* if you retrieve the anchors you sometimes get more than actually accessible.
This happens for the object 0x29a9c. */
***************
*** 3165,3171 ****
pid = id;
pcount = 1;
while((u >= 0) && (pcount != 0) && (parentIDs != NULL) && (pid != 0))
{
! //fprintf(stderr, "Get parents for %d\n", pid);
if(0 != send_getparents(sockfd, pid, &parentIDs, &pcount)) {
efree(pathIDs);
return -1;
--- 3164,3170 ----
pid = id;
pcount = 1;
while((u >= 0) && (pcount != 0) && (parentIDs != NULL) && (pid != 0))
{
! /*fprintf(stderr, "Get parents for %d\n", pid); */
if(0 != send_getparents(sockfd, pid, &parentIDs, &pcount)) {
efree(pathIDs);
return -1;
***************
*** 3183,3194 ****
fprintf(stderr, "parent not found in list\n");
if(parentIDs) efree(parentIDs);
}
! //fprintf(stderr, "sorted path: ");
for(i=0; i<count; i++) {
retIDs[i] = pathIDs[i];
! //fprintf(stderr, "%d, ", retIDs[i]);
}
! //fprintf(stderr, "\n");
efree(pathIDs);
return 0;
}
--- 3182,3193 ----
fprintf(stderr, "parent not found in list\n");
if(parentIDs) efree(parentIDs);
}
! /*fprintf(stderr, "sorted path: "); */
for(i=0; i<count; i++) {
retIDs[i] = pathIDs[i];
! /*fprintf(stderr, "%d, ", retIDs[i]); */
}
! /*fprintf(stderr, "\n"); */
efree(pathIDs);
return 0;
}
***************
*** 3310,3318 ****
strcat(anchorstr, destdocname);
efree(str);
} else {
! // strcat(anchorstr, "index.html");
}
! //fprintf(stderr, "%s\n", anchorstr);
efree(retthisIDs);
efree(retdestIDs);
*reldeststr = estrdup(anchorstr);
--- 3309,3317 ----
strcat(anchorstr, destdocname);
efree(str);
} else {
! /* strcat(anchorstr, "index.html"); */
}
! /*fprintf(stderr, "%s\n", anchorstr); */
efree(retthisIDs);
efree(retdestIDs);
*reldeststr = estrdup(anchorstr);
***************
*** 3329,3335 ****
build_msg_header(&msg, length, msgid++, IDENTIFY_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 3328,3334 ----
build_msg_header(&msg, length, msgid++, IDENTIFY_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 3366,3372 ****
build_msg_header(&msg, length, msgid++, GETOBJBYQUERY_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 3365,3371 ----
build_msg_header(&msg, length, msgid++, GETOBJBYQUERY_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 3425,3431 ****
build_msg_header(&msg, length, msgid++, GETOBJBYQUERY_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 3424,3430 ----
build_msg_header(&msg, length, msgid++, GETOBJBYQUERY_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 3469,3481 ****
return error;
}
! // Now get for each child collection the object record
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
efree(childIDs);
lowerror = LE_MALLOC;
return(-1);
--- 3468,3480 ----
return error;
}
! /* Now get for each child collection the object record */
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
efree(childIDs);
lowerror = LE_MALLOC;
return(-1);
***************
*** 3494,3500 ****
efree(childIDs);
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! // if emalloc fails, get at least all remaining messages from server
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
--- 3493,3499 ----
efree(childIDs);
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! /* if emalloc fails, get at least all remaining messages from server */
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
***************
*** 3539,3545 ****
build_msg_header(&msg, length, msgid++, GETOBJBYQUERYCOLL_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 3538,3544 ----
build_msg_header(&msg, length, msgid++, GETOBJBYQUERYCOLL_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 3601,3607 ****
build_msg_header(&msg, length, msgid++, GETOBJBYQUERYCOLL_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 3600,3606 ----
build_msg_header(&msg, length, msgid++, GETOBJBYQUERYCOLL_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 3647,3659 ****
return error;
}
! // Now get for each child collection the object record
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
efree(childIDs);
lowerror = LE_MALLOC;
return(-1);
--- 3646,3658 ----
return error;
}
! /* Now get for each child collection the object record */
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
efree(childIDs);
lowerror = LE_MALLOC;
return(-1);
***************
*** 3672,3678 ****
efree(childIDs);
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! // if emalloc fails, get at least all remaining messages from server
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
--- 3671,3677 ----
efree(childIDs);
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! /* if emalloc fails, get at least all remaining messages from server */
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
***************
*** 3717,3723 ****
build_msg_header(&msg, length, msgid++, GETPARENT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 3716,3722 ----
build_msg_header(&msg, length, msgid++, GETPARENT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 3778,3784 ****
build_msg_header(&msg, length, msgid++, GETPARENT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 3777,3783 ----
build_msg_header(&msg, length, msgid++, GETPARENT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 3821,3833 ****
return error;
}
! // Now get for each parent the object record
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 3820,3832 ----
return error;
}
! /* Now get for each parent the object record */
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 3844,3850 ****
efree(childIDs);
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! // if emalloc fails, get at least all remaining messages from server
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
--- 3843,3849 ----
efree(childIDs);
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! /* if emalloc fails, get at least all remaining messages from server */
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
***************
*** 3982,3988 ****
*/
len = sizeof(serv_addr);
if((newfd = accept(fd, (struct sockaddr *) &serv_addr, &len)) < 0) {
! // php3_printf("client: can't open data connection to server\n");
if(attributes) efree(attributes);
close(fd);
return(-1);
--- 3981,3987 ----
*/
len = sizeof(serv_addr);
if((newfd = accept(fd, (struct sockaddr *) &serv_addr, &len)) < 0) {
! /* php3_printf("client: can't open data connection to server\n"); */
if(attributes) efree(attributes);
close(fd);
return(-1);
***************
*** 4096,4102 ****
hostip = inet_ntoa(*ptr1);
break;
default:
! // php3_printf(stderr, "unknown address type\n");
break;
}
--- 4095,4101 ----
hostip = inet_ntoa(*ptr1);
break;
default:
! /* php3_printf(stderr, "unknown address type\n"); */
break;
}
***************
*** 4219,4225 ****
build_msg_header(&msg, length, msgid++, INSERTOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 4218,4224 ----
build_msg_header(&msg, length, msgid++, INSERTOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 4274,4280 ****
hostip = inet_ntoa(*ptr1);
break;
default:
! // fprintf(stderr, "unknown address type\n");
break;
}
--- 4273,4279 ----
hostip = inet_ntoa(*ptr1);
break;
default:
! /* fprintf(stderr, "unknown address type\n"); */
break;
}
***************
*** 4419,4431 ****
return error;
}
! // Now get for each source the object record
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 4418,4430 ----
return error;
}
! /* Now get for each source the object record */
for(i=0; i<*count; i++) {
length = HEADER_LENGTH + sizeof(hw_objectID);
build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE);
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 4441,4447 ****
}
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! // if emalloc fails, get at least all remaining messages from server
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
--- 4440,4446 ----
}
if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) {
! /* if emalloc fails, get at least all remaining messages from server */
for(i=0; i<*count; i++) {
retmsg = recv_hg_msg(sockfd);
efree(retmsg->buf);
***************
*** 4498,4509 ****
php3_printf("<B>Sending msg: </B>type = %d -- id = %d<BR>\n",
msg->msg_type, msg->version_msgid);
#endif
if ( length < HEADER_LENGTH ) {
! // fprintf(stderr, "send_hg_msg: bad msg\n");
return(-1);
}
if ( (tmp = buf = (char *)emalloc(length)) == NULL ) {
! // perror("send_hg_msg");
lowerror = LE_MALLOC;
return(-1);
}
--- 4497,4508 ----
php3_printf("<B>Sending msg: </B>type = %d -- id = %d<BR>\n",
msg->msg_type, msg->version_msgid);
#endif
if ( length < HEADER_LENGTH ) {
! /* fprintf(stderr, "send_hg_msg: bad msg\n"); */
return(-1);
}
if ( (tmp = buf = (char *)emalloc(length)) == NULL ) {
! /* perror("send_hg_msg"); */
lowerror = LE_MALLOC;
return(-1);
}
***************
*** 4559,4565 ****
build_msg_header(&comm_msg, length, msgid++, COMMAND_MESSAGE);
if ( (comm_msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! // perror("send_command");
lowerror = LE_MALLOC;
return(-1);
}
--- 4558,4564 ----
build_msg_header(&comm_msg, length, msgid++, COMMAND_MESSAGE);
if ( (comm_msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
! /* perror("send_command"); */
lowerror = LE_MALLOC;
return(-1);
}
--
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