From 0fb4075a62caed7e0ef91f61931afe3a92128d46 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 8 Mar 2002 00:25:08 +0000 Subject: [PATCH] fixed bug where the db_put_field in the local event callback stub was supplied with a destination that was the database field. In situations where the dbAccess db_access field types were different the database was damaged. --- src/ca/access.c | 82 +++++++++++++++++++++++-------------------------- 1 file changed, 39 insertions(+), 43 deletions(-) diff --git a/src/ca/access.c b/src/ca/access.c index ad86e6635..2adc517d8 100644 --- a/src/ca/access.c +++ b/src/ca/access.c @@ -99,6 +99,9 @@ /************************************************************************/ /* * $Log$ + * Revision 1.107.2.7 2001/09/18 12:17:48 mrk + * increased stack size for cac_recv_task from 4096 to 8192 + * * Revision 1.107.2.6 2000/11/30 22:07:50 jhill * changes from Ken Evans * @@ -2402,53 +2405,46 @@ db_field_log *pfl count = monix->count; } - if(monix->type == paddr->dbr_field_type){ - pval = paddr->pfield; - status = OK; - } - else{ - size = dbr_size_n(monix->type,count); + size = dbr_size_n(monix->type,count); - if( size <= sizeof(valbuf) ){ - pval = (void *) &valbuf; - } - else{ - - /* - * find a preallocated block which fits - * (stored with largest block first) - */ - LOCK; - pbuf = (struct tmp_buff *) - lcl_buff_list.node.next; - if(pbuf && pbuf->size >= size){ - ellDelete( - &lcl_buff_list, - &pbuf->node); - }else - pbuf = NULL; - UNLOCK; - - /* - * test again so malloc is not inside LOCKED - * section - */ - if(!pbuf){ - pbuf = (struct tmp_buff *) - malloc(sizeof(*pbuf)+size); - if(!pbuf){ - ca_printf("%s: No Mem, Event Discarded\n", - __FILE__); - return; - } - pbuf->size = size; - } - pval = (void *) (pbuf+1); - } + if( size <= sizeof(valbuf) ){ + pval = (void *) &valbuf; } + else{ + /* + * find a preallocated block which fits + * (stored with largest block first) + */ + LOCK; + pbuf = (struct tmp_buff *) + lcl_buff_list.node.next; + if(pbuf && pbuf->size >= size){ + ellDelete( + &lcl_buff_list, + &pbuf->node); + }else + pbuf = NULL; + UNLOCK; - status = db_get_field( paddr, + /* + * test again so malloc is not inside LOCKED + * section + */ + if(!pbuf){ + pbuf = (struct tmp_buff *) + malloc(sizeof(*pbuf)+size); + if(!pbuf){ + ca_printf("%s: No Mem, Event Discarded\n", + __FILE__); + return; + } + pbuf->size = size; + } + pval = (void *) (pbuf+1); + } + + status = db_get_field( paddr, monix->type, pval, count,