From owner-p4-projects@FreeBSD.ORG Sun Aug 5 18:47:10 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 87E1C16A41A; Sun, 5 Aug 2007 18:47:10 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CECD16A417 for ; Sun, 5 Aug 2007 18:47:10 +0000 (UTC) (envelope-from fli@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 40C8813C483 for ; Sun, 5 Aug 2007 18:47:10 +0000 (UTC) (envelope-from fli@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l75IlAq2041533 for ; Sun, 5 Aug 2007 18:47:10 GMT (envelope-from fli@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l75IlAwp041530 for perforce@freebsd.org; Sun, 5 Aug 2007 18:47:10 GMT (envelope-from fli@FreeBSD.org) Date: Sun, 5 Aug 2007 18:47:10 GMT Message-Id: <200708051847.l75IlAwp041530@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to fli@FreeBSD.org using -f From: Fredrik Lindberg To: Perforce Change Reviews Cc: Subject: PERFORCE change 124746 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2007 18:47:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=124746 Change 124746 by fli@fli_nexus on 2007/08/05 18:47:07 Follow the changes done to the record database. Affected files ... .. //depot/projects/soc2007/fli-mdns_sd/mdnsd/parse.y#3 edit Differences ... ==== //depot/projects/soc2007/fli-mdns_sd/mdnsd/parse.y#3 (text+ko) ==== @@ -223,9 +223,8 @@ struct cfg_name *cn; struct cfg_res *cs; struct cfg_resdata *csd; - int i, ttl; - struct dbr_rec *dr; - wchar_t **names, *wp; + int ttl; + wchar_t *nam, *wp; size_t len; if (!cfg_ifvalid && cfg_ifpassed) @@ -241,21 +240,15 @@ cfg_rrset.cr_ident, (cfg_rrset.cr_shared ? " (shared)" : ""), cfg_rrset.cr_namcount); - /* Do not free names, its in use by dbr_add() */ - names = malloc(sizeof(wchar_t *) * (cfg_rrset.cr_namcount + 1)); - i = 0; + dbr_ident_add(dbr, cfg_rrset.cr_ident); TAILQ_FOREACH(cn, &cfg_rrset.cr_names, cn_next) { dprintf(DEBUG_CFGPARSE, " %s", cn->cn_name); len = strlen(cn->cn_name) + 1; - names[i] = malloc(len * sizeof(wchar_t)); - mbstowcs(names[i], cn->cn_name, len); - i++; + nam = malloc(len * sizeof(wchar_t)); + mbstowcs(nam, cn->cn_name, len); + dbr_name_add(dbr, cfg_rrset.cr_ident, nam); + free(nam); } - names[i] = NULL; - - dr = dbr_add(dbr, cfg_rrset.cr_ident, names, - cfg_rrset.cr_shared); - assert(dr != NULL); dprintf(DEBUG_CFGPARSE, "rrset resources"); TAILQ_FOREACH(cs, &cfg_rrset.cr_res, cs_next) { @@ -268,14 +261,16 @@ csd->csd_data, ttl); if (csd->csd_auto) { - dbr_res_add(dr, cs->cs_type, ttl, + dbr_res_add(dbr, cfg_rrset.cr_ident, + mdns_c_in, cs->cs_type, ttl, csd->csd_data, 1); } else { len = strlen(csd->csd_data) + 1; wp = malloc(len * sizeof(wchar_t)); mbstowcs(wp, csd->csd_data, len); - dbr_res_add(dr, cs->cs_type, ttl, + dbr_res_add(dbr, cfg_rrset.cr_ident, + mdns_c_in, cs->cs_type, ttl, wp, 0); } }