refdb-cvs Mailing List for RefDB (Page 35)
Status: Beta
Brought to you by:
mhoenicka
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(88) |
Feb
(50) |
Mar
(36) |
Apr
(9) |
May
(30) |
Jun
(30) |
Jul
(22) |
Aug
(16) |
Sep
(42) |
Oct
(18) |
Nov
(29) |
Dec
(23) |
2005 |
Jan
(18) |
Feb
(28) |
Mar
(21) |
Apr
(35) |
May
(62) |
Jun
(22) |
Jul
(5) |
Aug
(40) |
Sep
(98) |
Oct
(81) |
Nov
(51) |
Dec
(62) |
2006 |
Jan
(46) |
Feb
(36) |
Mar
(8) |
Apr
(16) |
May
(14) |
Jun
(16) |
Jul
(47) |
Aug
(60) |
Sep
(34) |
Oct
(16) |
Nov
(46) |
Dec
(11) |
2007 |
Jan
(16) |
Feb
(13) |
Mar
(58) |
Apr
(32) |
May
(4) |
Jun
(8) |
Jul
(31) |
Aug
(46) |
Sep
(22) |
Oct
(30) |
Nov
(58) |
Dec
(15) |
2008 |
Jan
(8) |
Feb
(8) |
Mar
(2) |
Apr
(6) |
May
(3) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(6) |
Nov
(3) |
Dec
(5) |
2009 |
Jan
(1) |
Feb
(20) |
Mar
(8) |
Apr
(5) |
May
(8) |
Jun
(3) |
Jul
(6) |
Aug
(4) |
Sep
(7) |
Oct
(8) |
Nov
(2) |
Dec
(1) |
2010 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
(5) |
Feb
(5) |
Mar
(13) |
Apr
(3) |
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
|
Dec
(3) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(13) |
2014 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
(6) |
Sep
(3) |
Oct
|
Nov
(2) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
(9) |
Feb
(16) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Markus H. <mho...@us...> - 2006-02-22 20:51:50
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27457 Modified Files: Tag: Release_0_9_5_stable backend.c backend.h Log Message: added REFCITATIONLISTX Index: backend.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend.c,v retrieving revision 1.27.2.15 retrieving revision 1.27.2.16 diff -u -U2 -r1.27.2.15 -r1.27.2.16 --- backend.c 11 Feb 2006 00:46:34 -0000 1.27.2.15 +++ backend.c 22 Feb 2006 20:51:47 -0000 1.27.2.16 @@ -111,4 +111,8 @@ snprintf(header, header_len, "<?xml version=\"1.0\" encoding=\"%s\"?>\n%s", ptr_rendinfo->ptr_biblio_info->encoding, XNOTE_PUBID); break; + case REFCITATIONLISTX: + /* citationlistx output */ + snprintf(header, header_len, "<?xml version=\"1.0\" encoding=\"%s\"?>\n%s", ptr_rendinfo->ptr_biblio_info->encoding, CITATIONLISTX_PUBID); + break; /* default: */ /* empty string */ Index: backend.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend.h,v retrieving revision 1.23.2.8 retrieving revision 1.23.2.9 diff -u -U2 -r1.23.2.8 -r1.23.2.9 --- backend.h 2 Oct 2005 23:38:16 -0000 1.23.2.8 +++ backend.h 22 Feb 2006 20:51:47 -0000 1.23.2.9 @@ -73,16 +73,17 @@ /* output formats for getref/getnote */ -#define REFSCREEN 0 -#define REFRIS 1 -#define REFDOCBK 2 -#define REFBIBTEX 3 -#define REFHTML 4 -#define REFCGIHTML 6 -#define REFCGIRIS 7 -#define REFDOCBKX 8 -#define REFTEIX 9 -#define RISX 10 -#define REFXHTML 11 -#define XNOTE 12 +#define REFSCREEN 0 +#define REFRIS 1 +#define REFDOCBK 2 +#define REFBIBTEX 3 +#define REFHTML 4 +#define REFCGIHTML 6 +#define REFCGIRIS 7 +#define REFDOCBKX 8 +#define REFTEIX 9 +#define RISX 10 +#define REFXHTML 11 +#define XNOTE 12 +#define REFCITATIONLISTX 13 /* note types */ |
From: Markus H. <mho...@us...> - 2006-02-22 20:50:22
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27103 Added Files: Tag: Release_0_9_5_stable backend-citationlistx.c backend-citationlistx.h Log Message: initial version --- NEW FILE --- /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ backend-citationlistx.c defines the citationlistx output backend of refdbd ma...@mh... 2006-02-19 $Id: backend-citationlistx.c,v 1.1.2.1 2006/02/22 20:50:14 mhoenicka Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ #include <string.h> #include <syslog.h> /* for definitions of log message priorities */ #include <stdio.h> #include <dbi/dbi.h> #include "refdb.h" #include "linklist.h" #include "backend.h" #include "backend-citationlistx.h" #include "strfncs.h" #include "refdbd.h" #include "cgi.h" #include "dbfncs.h" #include "connect.h" extern char refdblib[]; /* location of shareable files */ extern int n_log_level; /* numeric version of log_level */ /* forward declaration of local functions */ static char* print_citation(const char* item, struct renderinfo* ptr_rendinfo); /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ prepare_render_citationlistx(): writes a header for the citationlistx output of a query int prepare_render_citationlistx returns 0 if successful, > 0 if failed struct renderinfo* ptr_rendinfo ptr to a structure with the info how the reference should be rendered ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int prepare_render_citationlistx(struct renderinfo* ptr_rendinfo) { char* new_ref; char* header; if ((header = assemble_header(ptr_rendinfo)) == NULL) { return 801; } new_ref = mstrcpy(*(ptr_rendinfo->ptr_ref), header, ptr_rendinfo->ptr_ref_len); free(header); if (new_ref == NULL) { LOG_PRINT(LOG_CRIT, get_status_msg(801)); return 801; } else { *(ptr_rendinfo->ptr_ref) = new_ref; } new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "<CITATIONLIST>\n", ptr_rendinfo->ptr_ref_len, 0); if (new_ref == NULL) { LOG_PRINT(LOG_CRIT, get_status_msg(801)); return 801; } *(ptr_rendinfo->ptr_ref) = new_ref; return 0; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ finish_render_citationlistx(): writes a footer for the citationlistx output of a query int finish_render_citationlistx returns 0 if successful, > 0 if failed struct renderinfo* ptr_rendinfo ptr to a structure with the info how the reference should be rendered ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int finish_render_citationlistx(struct renderinfo* ptr_rendinfo) { char* new_ref; new_ref = mstrcpy(*(ptr_rendinfo->ptr_ref), "\n</CITATIONLIST>\n", ptr_rendinfo->ptr_ref_len); if (new_ref == NULL) { LOG_PRINT(LOG_CRIT, get_status_msg(801)); return 801; } *(ptr_rendinfo->ptr_ref) = new_ref; return 0; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ render_citationlistx() renders a RIS dataset for citationlistx export int render_citationlistx returns 0 if successful,> 0 if failed struct renderinfo* ptr_rendinfo ptr to a structure with the info how the reference should be rendered ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int render_citationlistx(struct renderinfo* ptr_rendinfo) { int i; int errcode; /* receives error code for periodical requests */ char have_author = 0; char have_pubyear = 0; const char* item; char id[32] = ""; char* new_ref; char date_buffer[256]; struct REPRINT reprint; dbi_result dbires; dbi_conn conn; conn = dbi_result_get_conn(ptr_rendinfo->dbires); if (get_refdb_id(ptr_rendinfo->dbires, id) == NULL) { LOG_PRINT(LOG_WARNING, get_status_msg(234)); return 234; } item = get_refdb_citekey(ptr_rendinfo->dbires); if (item && *item) { if (print_citation(item, ptr_rendinfo) == NULL) { return 801; } } return 0; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ print_citation(): writes citationlistx CITATION element char* print_citation returns a ptr to the modified string. Due to reallocation this may be different from the ptr passed to this function in the ptr_rendinfo structure which is also updated accordingly const char* item ptr to the citation key to write struct renderinfo* ptr_rendinfo ptr to a structure with the info how the reference should be rendered ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ static char* print_citation(const char* item, struct renderinfo* ptr_rendinfo) { char* new_ref; if (item != NULL) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "<CITATION><XREF>ID", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_CRIT, get_status_msg(801)); return NULL; } else { *(ptr_rendinfo->ptr_ref) = new_ref; } if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_CRIT, get_status_msg(801)); return NULL; } else { *(ptr_rendinfo->ptr_ref) = new_ref; } if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</XREF></CITATION>\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_CRIT, get_status_msg(801)); return NULL; } else { *(ptr_rendinfo->ptr_ref) = new_ref; } } return *(ptr_rendinfo->ptr_ref); } --- NEW FILE --- /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ backend-citationlistx.h header file for backend-citationlistx.c ma...@mh... 6-21-00 $Id: backend-citationlistx.h,v 1.1.2.1 2006/02/22 20:50:14 mhoenicka Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int prepare_render_citationlistx(struct renderinfo* ptr_rendinfo); int finish_render_citationlistx(struct renderinfo* ptr_rendinfo); int render_citationlistx(struct renderinfo* ptr_rendinfo); |
From: Markus H. <mho...@us...> - 2006-02-22 20:48:14
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25930 Modified Files: Tag: Release_0_9_5_stable Makefile.am Log Message: added backend-citationlistx.c backend-citationlistx.h Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/src/Makefile.am,v retrieving revision 1.21.2.6 retrieving revision 1.21.2.7 diff -u -U2 -r1.21.2.6 -r1.21.2.7 --- Makefile.am 11 Feb 2006 00:45:06 -0000 1.21.2.6 +++ Makefile.am 22 Feb 2006 20:48:09 -0000 1.21.2.7 @@ -19,5 +19,5 @@ refdbc_SOURCES = refdbc.c pref.c strfncs.c readln.c page.c refdb-client.c client-commands.c readris.c connect.c tokenize.c getopt.c linklist.c enigma.c cgi.c atoll.c refdb.h refdbc.h pref.h strfncs.h readln.h page.h refdb-client.h client-commands.h readris.h connect.h tokenize.h getopt.h linklist.h enigma.h cgi.h -refdbd_SOURCES = refdbd.c refdbdref.c refdbda.c refdbdbib.c pref.c strfncs.c tokenize.c connect.c risdb.c writeris.c getopt.c readris.c backend.c backend-scrn.c backend-ris.c backend-risx.c backend-db31.c backend-teix.c backend-bibtex.c backend-html.c backend-dbib.c backend-dbiba.c linklist.c xmlhandler.c enigma.c cgi.c atoll.c dbfncs.c xmlout.c risxhandler.c authorinfo.c risdata.c noteshandler.c refdbdnote.c writenote.c backendn-scrn.c backendn-notex.c backendn-html.c xmlhelper.c mset.c refdb.h refdbd.h pref.h strfncs.h tokenize.h connect.h risdb.h writeris.h getopt.h readris.h backend.h backend-scrn.h backend-ris.h backend-risx.h backend-db31.h backend-teix.h backend-bibtex.h backend-html.h backend-dbib.h linklist.h xmlhandler.h enigma.h cgi.h dbfncs.h xmlout.h risxhandler.h authorinfo.h risdata.h noteshandler.h writenote.h backendn-scrn.h backendn-notex.h xmlhelper.h backendn-html.h mset.h +refdbd_SOURCES = refdbd.c refdbdref.c refdbda.c refdbdbib.c pref.c strfncs.c tokenize.c connect.c risdb.c writeris.c getopt.c readris.c backend.c backend-scrn.c backend-ris.c backend-risx.c backend-db31.c backend-teix.c backend-bibtex.c backend-html.c backend-dbib.c backend-dbiba.c backend-citationlistx.c linklist.c xmlhandler.c enigma.c cgi.c atoll.c dbfncs.c xmlout.c risxhandler.c authorinfo.c risdata.c noteshandler.c refdbdnote.c writenote.c backendn-scrn.c backendn-notex.c backendn-html.c xmlhelper.c mset.c refdb.h refdbd.h pref.h strfncs.h tokenize.h connect.h risdb.h writeris.h getopt.h readris.h backend.h backend-scrn.h backend-ris.h backend-risx.h backend-db31.h backend-teix.h backend-bibtex.h backend-html.h backend-dbib.h backend-citationlistx.h linklist.h xmlhandler.h enigma.h cgi.h dbfncs.h xmlout.h risxhandler.h authorinfo.h risdata.h noteshandler.h writenote.h backendn-scrn.h backendn-notex.h xmlhelper.h backendn-html.h mset.h refdbxp_SOURCES = refdbxp.c getopt.c strfncs.c getopt.h strfncs.h |
From: Markus H. <mho...@us...> - 2006-02-13 21:34:09
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2983 Modified Files: Tag: Release_0_9_5_stable refdbib.c Log Message: make_dbib(): close socket when bailing out; removed leftover send_status() call; send send_xml_data() output to stderr Index: refdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbib.c,v retrieving revision 1.41.2.10 retrieving revision 1.41.2.11 diff -u -U2 -r1.41.2.10 -r1.41.2.11 --- refdbib.c 8 Feb 2006 20:45:25 -0000 1.41.2.10 +++ refdbib.c 13 Feb 2006 21:33:54 -0000 1.41.2.11 @@ -671,4 +671,5 @@ free(slvals.outbuffer); close_outfile(specfilefp); + close(slvals.n_sockfd); n_broken_pipe = 0; return 1; @@ -724,5 +725,5 @@ close_outfile(specfilefp); - send_status(slvals.n_sockfd, 0, TERM_NO); +/* send_status(slvals.n_sockfd, 0, TERM_NO); */ cs_status = read_status(slvals.n_sockfd); @@ -738,7 +739,8 @@ } /* end if (n_send_stylespec) */ + byte_written = 0; /* run phases 1 through 4 of client/server protocol */ - n_result = send_xml_data(fp_infile, pagerfp, stderr, slvals.n_sockfd, &byte_written); + n_result = send_xml_data(fp_infile, /*pagerfp*/stderr, stderr, slvals.n_sockfd, &byte_written); if (n_result) { @@ -777,5 +779,5 @@ we do not want to write the terminating \0 */ if (!n_broken_pipe) { - fwrite(inbuffer, sizeof(char), numbyte-num_trailz, pagerfp); + fwrite(inbuffer, sizeof(char), numbyte-num_trailz, /*pagerfp*/stderr); } /* printf("%s", inbuffer); */ |
From: Markus H. <mho...@us...> - 2006-02-13 21:31:56
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2095 Modified Files: Tag: Release_0_9_5_stable configure.in Log Message: bumped up version number Index: configure.in =================================================================== RCS file: /cvsroot/refdb/refdb/configure.in,v retrieving revision 1.49.2.30 retrieving revision 1.49.2.31 diff -u -U2 -r1.49.2.30 -r1.49.2.31 --- configure.in 11 Feb 2006 00:36:33 -0000 1.49.2.30 +++ configure.in 13 Feb 2006 21:31:48 -0000 1.49.2.31 @@ -10,5 +10,5 @@ dnl Use automake -AM_INIT_AUTOMAKE(refdb, 0.9.7-pre3) +AM_INIT_AUTOMAKE(refdb, 0.9.7-pre4) dnl switch on GNU extensions |
From: Markus H. <mho...@us...> - 2006-02-13 21:30:45
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1358 Modified Files: Tag: Release_0_9_5_stable refdbdbib.c Log Message: add column info to output to better localize XML parsing errors Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.36.2.34 retrieving revision 1.36.2.35 diff -u -U2 -r1.36.2.34 -r1.36.2.35 --- refdbdbib.c 8 Feb 2006 20:39:44 -0000 1.36.2.34 +++ refdbdbib.c 13 Feb 2006 21:30:36 -0000 1.36.2.35 @@ -2272,5 +2272,5 @@ /* read dataset */ numbyte = iread(fd, style_set, n_requested_bufsize); -/* printf("requested: %d\nread: %d\n", n_requested_bufsize, numbyte); */ +/* printf("requested: %d\nread: %d\n%c%c%c%c%c\n", n_requested_bufsize, numbyte, style_set[0], style_set[1], style_set[2], style_set[3], style_set[4]); */ if (numbyte == -1) { LOG_PRINT(LOG_WARNING, get_status_msg(109)); @@ -2287,5 +2287,5 @@ send_status(fd, 400, TERM_NO); LOG_PRINT(LOG_WARNING, "XML parse error"); - sprintf(return_msg, "Parse error at line %d:\n%s\n", XML_GetCurrentLineNumber(p), XML_ErrorString(XML_GetErrorCode(p))); + sprintf(return_msg, "Parse error at line %d column %d:\n%s\n", XML_GetCurrentLineNumber(p), XML_GetCurrentColumnNumber(p), XML_ErrorString(XML_GetErrorCode(p))); tiwrite(fd, return_msg, TERM_YES); ptr_addresult->failure++; |
From: Markus H. <mho...@us...> - 2006-02-13 21:28:21
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv375 Modified Files: Tag: Release_0_9_5_stable refdb-client.c Log Message: read_terminated_string(): initialize numbyte properly Index: refdb-client.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdb-client.c,v retrieving revision 1.31.2.4 retrieving revision 1.31.2.5 diff -u -U2 -r1.31.2.4 -r1.31.2.5 --- refdb-client.c 8 Feb 2006 20:34:42 -0000 1.31.2.4 +++ refdb-client.c 13 Feb 2006 21:28:12 -0000 1.31.2.5 @@ -635,4 +635,5 @@ numbyte = tiwrite(n_sockfd, thebytes, TERM_YES); /* is 10 on the safe side? */ /* printf("%s\n", thebytes); */ +/* printf("%s\n", buffer); */ if (numbyte == -1) { @@ -881,5 +882,5 @@ int n_last_trailing_z = 0; size_t byte_written = 0; - size_t numbyte; + size_t numbyte = 0; *ptr_error = 0; @@ -944,5 +945,6 @@ } /* printf("n_read_done is %d<<n_done is %d<<\n", n_read_done, n_done); */ -/* printf("inbuffer went to:%s<<\nn_read_done is %d<<n_done is %d<<\n", ptr_slvals->inbuffer, n_read_done, n_done); */ +/* printf("inbuffer went to:%s<<\nn_read_done is %d<<\n", ptr_slvals->inbuffer, n_read_done); */ + fflush(stdout); if (!n_read_done) { n_last_trailing_z = n_curr_trailing_z; |
From: Markus H. <mho...@us...> - 2006-02-11 00:46:44
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2421/src Modified Files: Tag: Release_0_9_5_stable backend.c Log Message: fixed buffer overflow in retrieving extended notes data Index: backend.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend.c,v retrieving revision 1.27.2.14 retrieving revision 1.27.2.15 diff -u -U2 -r1.27.2.14 -r1.27.2.15 --- backend.c 8 Nov 2005 21:39:50 -0000 1.27.2.14 +++ backend.c 11 Feb 2006 00:46:34 -0000 1.27.2.15 @@ -358,5 +358,5 @@ drivername = dbi_driver_get_name(driver); - sql_command = malloc(2048); + sql_command = malloc(4096); if (sql_command == NULL) { |
From: Markus H. <mho...@us...> - 2006-02-11 00:46:03
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2212/src Modified Files: Tag: Release_0_9_5_stable backend-db31.c Log Message: entitize publisher in docbook output Index: backend-db31.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-db31.c,v retrieving revision 1.16.2.6 retrieving revision 1.16.2.7 diff -u -U2 -r1.16.2.6 -r1.16.2.7 --- backend-db31.c 3 Nov 2005 20:40:19 -0000 1.16.2.6 +++ backend-db31.c 11 Feb 2006 00:45:54 -0000 1.16.2.7 @@ -689,5 +689,14 @@ } - if ((new_ref = mstrcat(*ptr_chunk_buf, (char*)item, ptr_chunk_buf_len, 0)) == NULL) { /* publisher */ + if ((entitize_buf = mstrdup((char*)item)) == NULL) { + return NULL; + } + + if (sgml_entitize(&entitize_buf, NULL) == NULL) { + free(entitize_buf); + return NULL; + } + + if ((new_ref = mstrcat(*ptr_chunk_buf, entitize_buf, ptr_chunk_buf_len, 0)) == NULL) { /* publisher */ LOG_PRINT(LOG_CRIT, get_status_msg(801)); return NULL; @@ -697,4 +706,6 @@ } + free(entitize_buf); + if ((new_ref = mstrcat(*ptr_chunk_buf, "</publishername>", ptr_chunk_buf_len, 0)) == NULL) { LOG_PRINT(LOG_CRIT, get_status_msg(801)); |
From: Markus H. <mho...@us...> - 2006-02-11 00:45:16
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1957/src Modified Files: Tag: Release_0_9_5_stable Makefile.am Log Message: some fixes towards building outside of the source directory Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/src/Makefile.am,v retrieving revision 1.21.2.5 retrieving revision 1.21.2.6 diff -u -U2 -r1.21.2.5 -r1.21.2.6 --- Makefile.am 17 Dec 2005 01:01:36 -0000 1.21.2.5 +++ Makefile.am 11 Feb 2006 00:45:06 -0000 1.21.2.6 @@ -38,5 +38,5 @@ refdbd.h: refdbd.h.in - sed 's%<risxversion>%$(RISXVERSION)%g' < refdbd.h.in | \ + sed 's%<risxversion>%$(RISXVERSION)%g' < $(top_srcdir)/src/refdbd.h.in | \ sed 's%<xnoteversion>%$(XNOTEVERSION)%g' | \ sed 's%<citestylexversion>%$(CITESTYLEXVERSION)%g' | \ |
From: Markus H. <mho...@us...> - 2006-02-11 00:44:34
|
Update of /cvsroot/refdb/refdb/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1710/doc Modified Files: Tag: Release_0_9_5_stable Makefile.am Log Message: some fixes towards building outside of the source directory Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/doc/Attic/Makefile.am,v retrieving revision 1.1.2.13 retrieving revision 1.1.2.14 diff -u -U2 -r1.1.2.13 -r1.1.2.14 --- Makefile.am 12 Jan 2006 23:46:04 -0000 1.1.2.13 +++ Makefile.am 11 Feb 2006 00:44:24 -0000 1.1.2.14 @@ -12,5 +12,5 @@ citestylexdtdelem_DATA = citestylex/dtdelem/* citestylexeledescdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/citestylex/ele-desc -citestylexeledesc_DATA = citestylex/ele-desc/* +citestylexeledesc_DATA = $(top_srcdir)/doc/citestylex/ele-desc/* citestylexelementsdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/citestylex/elements citestylexelements_DATA = citestylex/elements/* @@ -21,5 +21,5 @@ risxdtdelem_DATA = risx/dtdelem/* risxeledescdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/risx/ele-desc -risxeledesc_DATA = risx/ele-desc/* +risxeledesc_DATA = $(top_srcdir)/doc/risx/ele-desc/* risxelementsdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/risx/elements risxelements_DATA = risx/elements/* @@ -30,5 +30,5 @@ citationlistxdtdelem_DATA = citationlistx/dtdelem/* citationlistxeledescdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/citationlistx/ele-desc -citationlistxeledesc_DATA = citationlistx/ele-desc/* +citationlistxeledesc_DATA = $(top_srcdir)/doc/citationlistx/ele-desc/* citationlistxelementsdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/citationlistx/elements citationlistxelements_DATA = citationlistx/elements/* @@ -39,5 +39,5 @@ xnotedtdelem_DATA = xnote/dtdelem/* xnoteeledescdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/xnote/ele-desc -xnoteeledesc_DATA = xnote/ele-desc/* +xnoteeledesc_DATA = $(top_srcdir)/doc/xnote/ele-desc/* xnoteelementsdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/xnote/elements xnoteelements_DATA = xnote/elements/* @@ -52,7 +52,7 @@ svg_images = refdbmanualfig1.svg refdbmanualfig2.svg refdbmanualfig3.svg refdbmanualfig4.svg -png_images = refdbmanualfig1.png refdbmanualfig2.png refdbmanualfig3.png refdbmanualfig4.png +png_images = $(top_srcdir)/doc/refdbmanualfig1.png $(top_srcdir)/doc/refdbmanualfig2.png $(top_srcdir)/doc/refdbmanualfig3.png $(top_srcdir)/doc/refdbmanualfig4.png -html_extra_files = manual.css $(png_images) +html_extra_files = $(top_srcdir)/doc/manual.css $(png_images) manual_include_files = include/fotitlepage.templates.xml include/fotitlepages.xsl include/manual-fo.xsl include/manual-man.xsl include/manual-xhtml.xsl @@ -88,5 +88,5 @@ refdb-manual.pdf: $(manual_sources) $(manpage_sources) $(svg_images) refdb-manual-statustable.xml include/fotitlepages.xsl @echo "Creating PDF manual..."; - xsltproc -o refdb-manual.fo --nonet --xinclude $(top_srcdir)/doc/include/manual-fo.xsl refdb-manual.xml + xsltproc -o refdb-manual.fo --nonet --xinclude $(top_srcdir)/doc/include/manual-fo.xsl $(top_srcdir)/doc/refdb-manual.xml # we have to give Java a little extra memory lest fop will die a horrible death JAVA_OPTS=-Xmx256M fop -fo refdb-manual.fo -pdf refdb-manual.pdf @@ -95,5 +95,5 @@ @echo "Creating HTML manual..."; rm -rf refdb-manual/* - mkdir -p refdb-manual && cp $(html_extra_files) refdb-manual/ && xsltproc -o refdb-manual/ --nonet --xinclude $(top_srcdir)/doc/include/manual-xhtml.xsl refdb-manual.xml + mkdir -p refdb-manual && cp $(html_extra_files) refdb-manual/ && xsltproc -o refdb-manual/ --nonet --xinclude $(top_srcdir)/doc/include/manual-xhtml.xsl $(top_srcdir)/doc/refdb-manual.xml @@ -106,5 +106,5 @@ SGML_CATALOG_FILES="" dtdparse --title "citestyle XML DTD" --output citestylex.xml --declaration $(top_srcdir)/declarations/xml.dcl --system-id "http://refdb.sourceforge.net/dtd/citestylex.dtd" $(top_srcdir)/dtd/citestylex.dtd -citestylex/elements.html: citestylex.xml citestylex/ele-desc/* +citestylex/elements.html: citestylex.xml $(top_srcdir)/doc/citestylex/ele-desc/* dtdformat --html citestylex.xml $(top_srcdir)/scripts/dtdparseweave citestylex @@ -112,9 +112,10 @@ citestylex/dtdelem/*: citestylex/elements.html citestylex/elements/*: citestylex/elements.html +citestylex/*: citestylex/elements.html risx.xml: $(top_srcdir)/dtd/risx.dtd SGML_CATALOG_FILES="" dtdparse --title "risx XML DTD" --output risx.xml --declaration $(top_srcdir)/declarations/xml.dcl --system-id "http://refdb.sourceforge.net/dtd/risx.dtd" $(top_srcdir)/dtd/risx.dtd -risx/elements.html: risx.xml risx/ele-desc/* +risx/elements.html: risx.xml $(top_srcdir)/doc/risx/ele-desc/* dtdformat --html risx.xml $(top_srcdir)/scripts/dtdparseweave risx @@ -122,9 +123,10 @@ risx/dtdelem/*: risx/elements.html risx/elements/*: risx/elements.html +risx/*: risx/elements.html citationlistx.xml: $(top_srcdir)/dtd/citationlistx.dtd SGML_CATALOG_FILES="" dtdparse --title "citationlistx XML DTD" --output citationlistx.xml --declaration $(top_srcdir)/declarations/xml.dcl --system-id "http://refdb.sourceforge.net/dtd/citationlistx.dtd" $(top_srcdir)/dtd/citationlistx.dtd -citationlistx/elements.html: citationlistx.xml citationlistx/ele-desc/* +citationlistx/elements.html: citationlistx.xml $(top_srcdir)/doc/citationlistx/ele-desc/* dtdformat --html citationlistx.xml $(top_srcdir)/scripts/dtdparseweave citationlistx @@ -132,9 +134,10 @@ citationlistx/dtdelem/*: citationlistx/elements.html citationlistx/elements/*: citationlistx/elements.html +citationlistx/*: citationlistx/elements.html xnote.xml: $(top_srcdir)/dtd/xnote.dtd SGML_CATALOG_FILES="" dtdparse --title "xnote XML DTD" --output xnote.xml --declaration $(top_srcdir)/declarations/xml.dcl --system-id "http://refdb.sourceforge.net/dtd/xnote.dtd" $(top_srcdir)/dtd/xnote.dtd -xnote/elements.html: xnote.xml xnote/ele-desc/* +xnote/elements.html: xnote.xml $(top_srcdir)/doc/xnote/ele-desc/* dtdformat --html xnote.xml $(top_srcdir)/scripts/dtdparseweave xnote @@ -142,4 +145,5 @@ xnote/dtdelem/*: xnote/elements.html xnote/elements/*: xnote/elements.html +xnote/*: xnote/elements.html maintainer-clean: clean |
From: Markus H. <mho...@us...> - 2006-02-11 00:36:50
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31631 Modified Files: Tag: Release_0_9_5_stable configure.in Log Message: bumped up version number Index: configure.in =================================================================== RCS file: /cvsroot/refdb/refdb/configure.in,v retrieving revision 1.49.2.29 retrieving revision 1.49.2.30 diff -u -U2 -r1.49.2.29 -r1.49.2.30 --- configure.in 11 Jan 2006 00:08:24 -0000 1.49.2.29 +++ configure.in 11 Feb 2006 00:36:33 -0000 1.49.2.30 @@ -10,5 +10,5 @@ dnl Use automake -AM_INIT_AUTOMAKE(refdb, 0.9.7-pre2) +AM_INIT_AUTOMAKE(refdb, 0.9.7-pre3) dnl switch on GNU extensions |
From: Tom B. <tba...@us...> - 2006-02-10 16:45:53
|
Update of /cvsroot/refdb/refdb/phpweb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13673/phpweb Modified Files: Tag: Release_0_9_5_stable include.php refdbsearch.php.in Log Message: returned include.php to original state now that the getref terms have been encased in quotes. Index: include.php =================================================================== RCS file: /cvsroot/refdb/refdb/phpweb/include.php,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -U2 -r1.1.2.3 -r1.1.2.4 --- include.php 10 Feb 2006 15:27:44 -0000 1.1.2.3 +++ include.php 10 Feb 2006 16:45:44 -0000 1.1.2.4 @@ -21,5 +21,5 @@ $equals = array("exact"=>"=", - "like"=>"\~"); + "like"=>"~"); //This array contains the more fields to be included in the display of Index: refdbsearch.php.in =================================================================== RCS file: /cvsroot/refdb/refdb/phpweb/Attic/refdbsearch.php.in,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -U2 -r1.1.2.2 -r1.1.2.3 --- refdbsearch.php.in 10 Feb 2006 15:27:44 -0000 1.1.2.2 +++ refdbsearch.php.in 10 Feb 2006 16:45:44 -0000 1.1.2.3 @@ -79,5 +79,5 @@ } -$terms = "'"; +$terms = "\""; //The following if sets the query for the Simple Query @@ -143,5 +143,5 @@ else if( $sendQuery == "Send Advanced query" ) { - $terms = $advquery; + $terms = $terms.$advquery; } //Query terms if you've returned from a search @@ -151,5 +151,5 @@ } -$cmd = $cmd.$terms."'"; +$cmd = $cmd.$terms."\""; exec($cmd, $lines); |
From: Tom B. <tba...@us...> - 2006-02-10 15:27:56
|
Update of /cvsroot/refdb/refdb/phpweb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11320/phpweb Modified Files: Tag: Release_0_9_5_stable include.php refdbsearch.php.in Log Message: added the escape of the ~ to the "is LIKE" search corrected problem of searches like :ID:>1 redirectign output Index: include.php =================================================================== RCS file: /cvsroot/refdb/refdb/phpweb/include.php,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -U2 -r1.1.2.2 -r1.1.2.3 --- include.php 7 Sep 2005 21:31:45 -0000 1.1.2.2 +++ include.php 10 Feb 2006 15:27:44 -0000 1.1.2.3 @@ -21,5 +21,5 @@ $equals = array("exact"=>"=", - "like"=>"~"); + "like"=>"\~"); //This array contains the more fields to be included in the display of Index: refdbsearch.php.in =================================================================== RCS file: /cvsroot/refdb/refdb/phpweb/Attic/refdbsearch.php.in,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -U2 -r1.1.2.1 -r1.1.2.2 --- refdbsearch.php.in 17 Sep 2005 20:58:27 -0000 1.1.2.1 +++ refdbsearch.php.in 10 Feb 2006 15:27:44 -0000 1.1.2.2 @@ -17,5 +17,5 @@ if( $searchFields == "" ) { - $searchFields = "ALL"; + $searchFields = "all"; } return $searchFields; @@ -76,8 +76,8 @@ if($scope == "prl") { - $cmd = $cmd."-p "; + $cmd = $cmd."-P "; } -$terms = ""; +$terms = "'"; //The following if sets the query for the Simple Query @@ -151,5 +151,5 @@ } -$cmd = $cmd.$terms; +$cmd = $cmd.$terms."'"; exec($cmd, $lines); |
From: Markus H. <mho...@us...> - 2006-02-08 20:47:02
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6534 Modified Files: Tag: Release_0_9_5_stable xmlhandler.c Log Message: initialize a couple of values Index: xmlhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/xmlhandler.c,v retrieving revision 1.22.2.23 retrieving revision 1.22.2.24 diff -u -U2 -r1.22.2.23 -r1.22.2.24 --- xmlhandler.c 26 Dec 2005 22:10:36 -0000 1.22.2.23 +++ xmlhandler.c 8 Feb 2006 20:46:54 -0000 1.22.2.24 @@ -1340,8 +1340,8 @@ int errcode; /* receives error code for periodical requests */ char buffer[32]; - char* database; + char* database = ""; char* id_string; char* multi_id_string; - char* multi_database; + char* multi_database = ""; char* sql_command; char* new_sql_command; @@ -1360,6 +1360,6 @@ int use_qtitle = 0; int use_ztitle = 0; - unsigned long long temp_id; - unsigned long long real_orig_id; + unsigned long long temp_id = 0; + unsigned long long real_orig_id = 0; dbi_conn conn_source = NULL; dbi_result dbires; |
From: Markus H. <mho...@us...> - 2006-02-08 20:45:34
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5919 Modified Files: Tag: Release_0_9_5_stable refdbib.c Log Message: use read_terminated_string() in one more location Index: refdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbib.c,v retrieving revision 1.41.2.9 retrieving revision 1.41.2.10 diff -u -U2 -r1.41.2.9 -r1.41.2.10 --- refdbib.c 5 Feb 2006 01:39:41 -0000 1.41.2.9 +++ refdbib.c 8 Feb 2006 20:45:25 -0000 1.41.2.10 @@ -530,4 +530,5 @@ int n_result; int i; + int n_error; int n_xmlfile_done = 0; int n_chunk_count = 0; @@ -640,6 +641,4 @@ if (cs_status == 402) { - int n_error; - if (stylespec_dir && *stylespec_dir) { strcpy(specfile, stylespec_dir); @@ -670,4 +669,7 @@ if (n_error) { + free(slvals.outbuffer); + close_outfile(specfilefp); + n_broken_pipe = 0; return 1; } @@ -802,5 +804,4 @@ do { /* read in loop over all chunks of data the server is going to send */ - int n_error; if ((cs_status = read_status(slvals.n_sockfd)) == 402) { @@ -821,4 +822,6 @@ if (n_error) { + closepager(pagerfp); + n_broken_pipe = 0; return 1; } @@ -891,52 +894,62 @@ } - /* read summary in loop */ - n_read_done = 0; + byte_written += read_terminated_string(&slvals, stderr, &n_error); - do { /* loop until we've got a complete dataset */ - numbyte = tread(slvals.n_sockfd, inbuffer, COMMAND_INBUF_LEN); - /* printf("numbyte:%d\n", numbyte); */ - if (numbyte == -1) { - fprintf(stderr, get_status_msg(109)); - fprintf(stderr, "\n"); - LOG_PRINT(LOG_WARNING, get_status_msg(109)); - free(slvals.outbuffer); - close(slvals.n_sockfd); - closepager(pagerfp); - n_broken_pipe = 0; - return 1; - } + if (n_error) { + free(slvals.outbuffer); + close(slvals.n_sockfd); + closepager(pagerfp); + n_broken_pipe = 0; + return 1; + } - n_curr_trailing_z = get_trailz(inbuffer, numbyte); - - if (numbyte >= TERM_LEN) { - if (n_curr_trailing_z >= TERM_LEN) { - n_read_done++; - } - } - else if (n_curr_trailing_z == numbyte - && n_curr_trailing_z + n_last_trailing_z >= TERM_LEN) { - n_read_done++; - } - else if (n_curr_trailing_z == numbyte) { - /* terminator is still incomplete */ - n_last_trailing_z += n_curr_trailing_z; - continue; - } +/* /\* read summary in loop *\/ */ +/* n_read_done = 0; */ - /* write numbyte chars to output, unless this is the last chunk: we do not - want to write the terminating \0 */ - if (!n_broken_pipe) { - if (n_last_trailing_z) { - byte_written += fwrite(cs_term, sizeof(char), n_last_trailing_z, stderr); - } - byte_written += fwrite(inbuffer, sizeof(char), numbyte-n_curr_trailing_z, stderr); - } +/* do { /\* loop until we've got a complete dataset *\/ */ +/* numbyte = tread(slvals.n_sockfd, inbuffer, COMMAND_INBUF_LEN); */ +/* /\* printf("numbyte:%d\n", numbyte); *\/ */ +/* if (numbyte == -1) { */ +/* fprintf(stderr, get_status_msg(109)); */ +/* fprintf(stderr, "\n"); */ +/* LOG_PRINT(LOG_WARNING, get_status_msg(109)); */ +/* free(slvals.outbuffer); */ +/* close(slvals.n_sockfd); */ +/* closepager(pagerfp); */ +/* n_broken_pipe = 0; */ +/* return 1; */ +/* } */ - if (!n_read_done) { - n_last_trailing_z = n_curr_trailing_z; - } +/* n_curr_trailing_z = get_trailz(inbuffer, numbyte); */ + +/* if (numbyte >= TERM_LEN) { */ +/* if (n_curr_trailing_z >= TERM_LEN) { */ +/* n_read_done++; */ +/* } */ +/* } */ +/* else if (n_curr_trailing_z == numbyte */ +/* && n_curr_trailing_z + n_last_trailing_z >= TERM_LEN) { */ +/* n_read_done++; */ +/* } */ +/* else if (n_curr_trailing_z == numbyte) { */ +/* /\* terminator is still incomplete *\/ */ +/* n_last_trailing_z += n_curr_trailing_z; */ +/* continue; */ +/* } */ + +/* /\* write numbyte chars to output, unless this is the last chunk: we do not */ +/* want to write the terminating \0 *\/ */ +/* if (!n_broken_pipe) { */ +/* if (n_last_trailing_z) { */ +/* byte_written += fwrite(cs_term, sizeof(char), n_last_trailing_z, stderr); */ +/* } */ +/* byte_written += fwrite(inbuffer, sizeof(char), numbyte-n_curr_trailing_z, stderr); */ +/* } */ + +/* if (!n_read_done) { */ +/* n_last_trailing_z = n_curr_trailing_z; */ +/* } */ - } while (!n_read_done); +/* } while (!n_read_done); */ /* send back confirmation to the server */ |
From: Markus H. <mho...@us...> - 2006-02-08 20:43:18
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4702 Modified Files: Tag: Release_0_9_5_stable refdbdref.c Log Message: real_run_keyword_scan(): do nothing if no keywords are available Index: refdbdref.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdref.c,v retrieving revision 1.65.2.23 retrieving revision 1.65.2.24 diff -u -U2 -r1.65.2.23 -r1.65.2.24 --- refdbdref.c 3 Nov 2005 20:40:19 -0000 1.65.2.23 +++ refdbdref.c 8 Feb 2006 20:43:11 -0000 1.65.2.24 @@ -912,4 +912,11 @@ } + if (dbi_result_get_numrows(dbires_kwlist) < 1) { + /* nothing to do */ + free(sql_command); + dbi_conn_close(conn); + return 0; + } + if (ptr_sentinel) { /* we have a list of IDs to scan */ if (!mode) { |
From: Markus H. <mho...@us...> - 2006-02-08 20:39:51
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3421 Modified Files: Tag: Release_0_9_5_stable refdbdbib.c Log Message: initialize curr_multi_id Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.36.2.33 retrieving revision 1.36.2.34 diff -u -U2 -r1.36.2.33 -r1.36.2.34 --- refdbdbib.c 5 Feb 2006 01:39:14 -0000 1.36.2.33 +++ refdbdbib.c 8 Feb 2006 20:39:44 -0000 1.36.2.34 @@ -203,4 +203,5 @@ return 1; } + *curr_multi_id = '\0'; inbuffer_len = (size_t)COMMAND_INBUF_LEN; |
From: Markus H. <mho...@us...> - 2006-02-08 20:37:33
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2361 Modified Files: Tag: Release_0_9_5_stable refdbc.c Log Message: close file descriptors if read_terminated_strings() returns an error Index: refdbc.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbc.c,v retrieving revision 1.72.2.15 retrieving revision 1.72.2.16 diff -u -U2 -r1.72.2.15 -r1.72.2.16 --- refdbc.c 5 Feb 2006 01:33:21 -0000 1.72.2.15 +++ refdbc.c 8 Feb 2006 20:37:20 -0000 1.72.2.16 @@ -2192,4 +2192,11 @@ if (n_error) { delete_all_lilimem(&sentinel); + if (slvals.n_file_open || slvals.n_file_append) { + close_outfile(pagerfp); + } + else { + closepager(pagerfp); + } + n_broken_pipe = 0; return 1; } @@ -4819,4 +4826,11 @@ if (n_error) { delete_all_lilimem(&sentinel); + if (slvals.n_file_open || slvals.n_file_append) { + close_outfile(pagerfp); + } + else { + closepager(pagerfp); + } + n_broken_pipe = 0; return 1; } |
From: Markus H. <mho...@us...> - 2006-02-08 20:34:51
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1581 Modified Files: Tag: Release_0_9_5_stable refdb-client.c Log Message: read_terminated_string(): do not close file descriptors Index: refdb-client.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdb-client.c,v retrieving revision 1.31.2.3 retrieving revision 1.31.2.4 diff -u -U2 -r1.31.2.3 -r1.31.2.4 --- refdb-client.c 5 Feb 2006 01:31:02 -0000 1.31.2.3 +++ refdb-client.c 8 Feb 2006 20:34:42 -0000 1.31.2.4 @@ -897,12 +897,4 @@ fprintf(stderr, get_status_msg(109)); fprintf(stderr, "\n"); - if (ptr_slvals->n_file_open || ptr_slvals->n_file_append) { - close_outfile(pagerfp); - } - else { - closepager(pagerfp); - } - n_broken_pipe = 0; -/* delete_all_lilimem(&sentinel); */ *ptr_error = 1; return 0; |
From: Markus H. <mho...@us...> - 2006-02-05 21:37:26
|
Update of /cvsroot/refdb/homepage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4647 Modified Files: index.html Log Message: added bug note Index: index.html =================================================================== RCS file: /cvsroot/refdb/homepage/index.html,v retrieving revision 1.17 retrieving revision 1.18 diff -u -U2 -r1.17 -r1.18 --- index.html 4 Jan 2006 21:58:33 -0000 1.17 +++ index.html 5 Feb 2006 21:37:19 -0000 1.18 @@ -137,4 +137,8 @@ <h2>News</h2> <div class="news"> + <h3>February 5, 2006</h3> + <p>A bug was discovered in the client/server dialog of RefDB 0.9.6-pre2 and later, 0.9.6 (release), and 0.9.7-pre1. This bug may cause data loss when retrieving references of a particular size (between 4096 and 4100 byte) by means of the refdbc:getref command. The getnote command and the getbib tool are also affected in a similar way. It is strongly recommended to upgrade to the latest prerelease (<a href="pre/refdb-0.9.7-pre2.tar.gz">refdb-0.9.7-pre2</a>) which fixes this and a few more minor bugs.</p> + </div> + <div class="news"> <h3>December 22, 2005</h3> <p>A new version of the refdb-elisp package is available. Please download it from the <a href="http://www.sourceforge.net/projects/refdb">Project page</a>. The two Emacs modes contained in the package turn Emacs into a full-fledged frontend for RefDB, allows direct editing and updating of reference, note, and style data, and allows a convenient "cite-while-you-write" kind of authoring of your next book or publication.</p> |
From: Markus H. <mho...@us...> - 2006-02-05 01:39:51
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21448 Modified Files: Tag: Release_0_9_5_stable refdbib.c Log Message: use proper file pointer for specfile Index: refdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbib.c,v retrieving revision 1.41.2.8 retrieving revision 1.41.2.9 diff -u -U2 -r1.41.2.8 -r1.41.2.9 --- refdbib.c 5 Feb 2006 01:33:23 -0000 1.41.2.8 +++ refdbib.c 5 Feb 2006 01:39:41 -0000 1.41.2.9 @@ -667,5 +667,5 @@ /* printf("specfile: %s<<\n", specfile); */ - byte_written += read_terminated_string(&slvals, pagerfp, &n_error); + byte_written += read_terminated_string(&slvals, specfilefp, &n_error); if (n_error) { |
From: Markus H. <mho...@us...> - 2006-02-05 01:39:23
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21221 Modified Files: Tag: Release_0_9_5_stable refdbdbib.c Log Message: real_run_keyword_scan(): bail out if no keywords are available Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.36.2.32 retrieving revision 1.36.2.33 diff -u -U2 -r1.36.2.32 -r1.36.2.33 --- refdbdbib.c 2 Jan 2006 22:16:29 -0000 1.36.2.32 +++ refdbdbib.c 5 Feb 2006 01:39:14 -0000 1.36.2.33 @@ -768,4 +768,5 @@ item = dbi_result_get_string(dbires, "dbname"); n_id = my_dbi_result_get_idval(dbires, "orig_id"); +/* printf("about to format %qu<<\n", n_id); */ if (!strcmp(my_dbi_conn_get_cap(bibconns.conn, "multiple_db"), "t")) { |
From: Markus H. <mho...@us...> - 2006-02-05 01:33:31
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19353 Modified Files: Tag: Release_0_9_5_stable refdbc.c refdbib.c Log Message: use new function read_terminated_string() to replace a loop in the client/server dialog Index: refdbc.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbc.c,v retrieving revision 1.72.2.14 retrieving revision 1.72.2.15 diff -u -U2 -r1.72.2.14 -r1.72.2.15 --- refdbc.c 3 Nov 2005 20:49:22 -0000 1.72.2.14 +++ refdbc.c 5 Feb 2006 01:33:21 -0000 1.72.2.15 @@ -1717,7 +1717,7 @@ size_t byte_written = 0; size_t outbuf_len; - FILE *infilefp; + FILE* infilefp; FILE* errstream; - FILE *pagerfp; /* ptr to file */ + FILE* pagerfp; /* ptr to file */ struct lilimem sentinel; struct liliform* ptr_current; @@ -1731,4 +1731,5 @@ if (slvals.outbuffer == NULL || insert_lilimem(&sentinel, (void**)&(slvals.outbuffer), NULL)) { + free(slvals.outbuffer); return 1; } @@ -2163,4 +2164,6 @@ do { /* loop until we have all requested datasets */ + int n_error; + cs_status = read_status(slvals.n_sockfd); @@ -2177,4 +2180,5 @@ } n_broken_pipe = 0; + delete_all_lilimem(&sentinel); return 1; } @@ -2184,59 +2188,14 @@ } - n_read_done = 0; + byte_written += read_terminated_string(&slvals, pagerfp, &n_error); - do { /* loop until a terminated string is complete */ - numbyte = tread(slvals.n_sockfd, slvals.inbuffer, OUTBUF_LEN); - if (numbyte == -1) { - fprintf(stderr, get_status_msg(109)); - fprintf(stderr, "\n"); - if (slvals.n_file_open || slvals.n_file_append) { - close_outfile(pagerfp); - } - else { - closepager(pagerfp); - } - n_broken_pipe = 0; - return 1; - } - - n_curr_trailing_z = get_trailz(slvals.inbuffer, numbyte); - - if (numbyte >= TERM_LEN) { - if (n_curr_trailing_z >= TERM_LEN) { - /* terminator is complete */ - n_read_done++; - /* send back confirmation to the server */ - send_status(slvals.n_sockfd, 0, TERM_NO); - } - } - else if (n_curr_trailing_z == numbyte - && n_curr_trailing_z + n_last_trailing_z >= TERM_LEN) { - /* terminator is complete including the previous cycle */ - n_read_done++; - /* send back confirmation to the server */ - send_status(slvals.n_sockfd, 0, TERM_NO); - } - else if (n_curr_trailing_z == numbyte) { - /* terminator is still incomplete */ - n_last_trailing_z += n_curr_trailing_z; - continue; - } + if (n_error) { + delete_all_lilimem(&sentinel); + return 1; + } - /* write numbyte chars to output, unless this is the last chunk: we do not - want to write the terminating \0 */ - if (!n_broken_pipe) { - if (n_last_trailing_z) { - byte_written += fwrite(cs_term, sizeof(char), n_last_trailing_z, pagerfp); - } - byte_written += fwrite(slvals.inbuffer, sizeof(char), numbyte-n_curr_trailing_z, pagerfp); - } - /* printf("inbuffer went to:%s<<\nn_read_done is %d<<n_done is %d<<\n", slvals.inbuffer, n_read_done, n_done); */ - if (!n_read_done) { - n_last_trailing_z = n_curr_trailing_z; - } - } while (!n_read_done); } while (!n_done); +/* printf("trying to read summary\n"); */ /* read summary */ /* send_status(slvals.n_sockfd, 0, TERM_NO); */ @@ -2248,4 +2207,5 @@ fprintf(errstream, get_status_msg(cs_status)); fprintf(stderr, "\n"); + delete_all_lilimem(&sentinel); return 1; } @@ -2256,4 +2216,5 @@ fprintf(stderr, "\n"); n_broken_pipe = 0; + delete_all_lilimem(&sentinel); return 1; } @@ -4831,4 +4792,6 @@ do { /* loop until we have all requested datasets */ + int n_error; + cs_status = read_status(slvals.n_sockfd); @@ -4852,57 +4815,63 @@ } - n_read_done = 0; + byte_written += read_terminated_string(&slvals, pagerfp, &n_error); - do { /* loop until a terminated string is complete */ - numbyte = tread(slvals.n_sockfd, slvals.inbuffer, OUTBUF_LEN); - if (numbyte == -1) { - fprintf(stderr, get_status_msg(109)); - fprintf(stderr, "\n"); - if (slvals.n_file_open || slvals.n_file_append) { - close_outfile(pagerfp); - } - else { - closepager(pagerfp); - } - n_broken_pipe = 0; - return 1; - } + if (n_error) { + delete_all_lilimem(&sentinel); + return 1; + } +/* n_read_done = 0; */ + +/* do { /\* loop until a terminated string is complete *\/ */ +/* numbyte = tread(slvals.n_sockfd, slvals.inbuffer, OUTBUF_LEN); */ +/* if (numbyte == -1) { */ +/* fprintf(stderr, get_status_msg(109)); */ +/* fprintf(stderr, "\n"); */ +/* if (slvals.n_file_open || slvals.n_file_append) { */ +/* close_outfile(pagerfp); */ +/* } */ +/* else { */ +/* closepager(pagerfp); */ +/* } */ +/* n_broken_pipe = 0; */ +/* return 1; */ +/* } */ - n_curr_trailing_z = get_trailz(slvals.inbuffer, numbyte); +/* n_curr_trailing_z = get_trailz(slvals.inbuffer, numbyte); */ - if (numbyte >= TERM_LEN) { - if (n_curr_trailing_z >= TERM_LEN) { - /* terminator is complete */ - n_read_done++; - /* send back confirmation to the server */ - send_status(slvals.n_sockfd, 0, TERM_NO); - } - } - else if (n_curr_trailing_z == numbyte - && n_curr_trailing_z + n_last_trailing_z >= TERM_LEN) { - /* terminator is complete including the previous cycle */ - n_read_done++; - /* send back confirmation to the server */ - send_status(slvals.n_sockfd, 0, TERM_NO); - } - else if (n_curr_trailing_z == numbyte) { - /* terminator is still incomplete */ - n_last_trailing_z += n_curr_trailing_z; - continue; - } +/* if (numbyte >= TERM_LEN) { */ +/* if (n_curr_trailing_z >= TERM_LEN) { */ +/* /\* terminator is complete *\/ */ +/* n_read_done++; */ +/* /\* send back confirmation to the server *\/ */ +/* send_status(slvals.n_sockfd, 0, TERM_NO); */ +/* } */ +/* } */ +/* else if (n_curr_trailing_z == numbyte */ +/* && n_curr_trailing_z + n_last_trailing_z >= TERM_LEN) { */ +/* /\* terminator is complete including the previous cycle *\/ */ +/* n_read_done++; */ +/* /\* send back confirmation to the server *\/ */ +/* send_status(slvals.n_sockfd, 0, TERM_NO); */ +/* } */ +/* else if (n_curr_trailing_z == numbyte) { */ +/* /\* terminator is still incomplete *\/ */ +/* n_last_trailing_z += n_curr_trailing_z; */ +/* continue; */ +/* } */ - /* write numbyte chars to output, unless this is the last chunk: we do not - want to write the terminating \0 */ - if (!n_broken_pipe) { - if (n_last_trailing_z) { - byte_written += fwrite(cs_term, sizeof(char), n_last_trailing_z, pagerfp); - } - byte_written += fwrite(slvals.inbuffer, sizeof(char), numbyte-n_curr_trailing_z, pagerfp); - } -/* printf("inbuffer went to:%s<<\nn_read_done is %d<<n_done is %d<<\n", slvals.inbuffer, n_read_done, n_done); */ - if (!n_read_done) { - n_last_trailing_z = n_curr_trailing_z; - } - } while (!n_read_done); +/* /\* write numbyte chars to output, unless this is the last chunk: we do not */ +/* want to write the terminating \0 *\/ */ +/* if (!n_broken_pipe) { */ +/* if (n_last_trailing_z) { */ +/* byte_written += fwrite(cs_term, sizeof(char), n_last_trailing_z, pagerfp); */ +/* } */ +/* byte_written += fwrite(slvals.inbuffer, sizeof(char), numbyte-n_curr_trailing_z, pagerfp); */ +/* } */ +/* /\* printf("inbuffer went to:%s<<\nn_read_done is %d<<n_done is %d<<\n", slvals.inbuffer, n_read_done, n_done); *\/ */ +/* if (!n_read_done) { */ +/* n_last_trailing_z = n_curr_trailing_z; */ +/* } */ +/* } while (!n_read_done); */ } while (!n_done); Index: refdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbib.c,v retrieving revision 1.41.2.7 retrieving revision 1.41.2.8 diff -u -U2 -r1.41.2.7 -r1.41.2.8 --- refdbib.c 2 Jan 2006 22:17:53 -0000 1.41.2.7 +++ refdbib.c 5 Feb 2006 01:33:23 -0000 1.41.2.8 @@ -515,6 +515,4 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int make_dbib(FILE* fp_infile, int n_type) { - int n_sockfd; /* file descriptor of the socket */ - char *outbuffer; char *new_outbuffer; char inbuffer[COMMAND_INBUF_LEN]; @@ -543,15 +541,22 @@ FILE *specfilefp; struct linger mylinger; + struct simplelistvals slvals; + + slvals.n_file_open = 0; + slvals.n_file_append = 0; + slvals.n_pipe = 0; + slvals.outfile = NULL; + slvals.outpipe = NULL; - outbuffer = malloc(outbuf_len); - if (outbuffer == NULL) { + slvals.outbuffer = malloc(outbuf_len); + if (slvals.outbuffer == NULL) { return 1; } - strcpy(outbuffer, "getbib "); + strcpy(slvals.outbuffer, "getbib "); - if (connect_to_server(&n_sockfd, server_ip, port_address) != 0) { + if (connect_to_server(&slvals.n_sockfd, server_ip, port_address) != 0) { LOG_PRINT(LOG_ERR, "could not connect to server"); - free(outbuffer); + free(slvals.outbuffer); return 1; } @@ -559,8 +564,8 @@ strcpy(scrambled_passwd, passwd); - if (init_dialog(n_sockfd, scrambled_passwd, srv_inbuffer)) { + if (init_dialog(slvals.n_sockfd, scrambled_passwd, srv_inbuffer)) { LOG_PRINT(LOG_ERR, "server authentication failed"); - free(outbuffer); - close(n_sockfd); + free(slvals.outbuffer); + close(slvals.n_sockfd); return 1; } @@ -569,70 +574,72 @@ switch (n_type) { case 2: - strcat(outbuffer, " -t teix -u "); + strcat(slvals.outbuffer, " -t teix -u "); break; case 1: - strcat(outbuffer, " -t db31x -u "); + strcat(slvals.outbuffer, " -t db31x -u "); break; case 0: /* fall through */ default: - strcat(outbuffer, " -t db31 -u "); + strcat(slvals.outbuffer, " -t db31 -u "); break; } - strcat(outbuffer, username); + strcat(slvals.outbuffer, username); if (!n_send_stylespec) { - strcat(outbuffer, " -n"); + strcat(slvals.outbuffer, " -n"); } if (*passwd) { - strcat(outbuffer, " -w "); - strcat(outbuffer, scrambled_passwd); + strcat(slvals.outbuffer, " -w "); + strcat(slvals.outbuffer, scrambled_passwd); } - strcat(outbuffer, " -d "); - strcat(outbuffer, current_db); + strcat(slvals.outbuffer, " -d "); + strcat(slvals.outbuffer, current_db); if (*output_format) { - strcat(outbuffer, " -s "); - strcat(outbuffer, output_format); + strcat(slvals.outbuffer, " -s "); + strcat(slvals.outbuffer, output_format); } if (*startnumber) { - strcat(outbuffer, " -o "); - strcat(outbuffer, startnumber); + strcat(slvals.outbuffer, " -o "); + strcat(slvals.outbuffer, startnumber); } if (*encoding) { - strcat(outbuffer, " -E "); - strcat(outbuffer, encoding); + strcat(slvals.outbuffer, " -E "); + strcat(slvals.outbuffer, encoding); } /* now send the command to the application server */ -/* printf("%s\n", outbuffer); */ -/* free(outbuffer); */ +/* printf("%s\n", slvals.outbuffer); */ +/* free(slvals.outbuffer); */ /* return 0; */ - LOG_PRINT(LOG_DEBUG, outbuffer); - send_status(n_sockfd, 0, TERM_NO); - numbyte = tiwrite(n_sockfd, outbuffer, TERM_YES); + LOG_PRINT(LOG_DEBUG, slvals.outbuffer); + send_status(slvals.n_sockfd, 0, TERM_NO); + numbyte = tiwrite(slvals.n_sockfd, slvals.outbuffer, TERM_YES); if (numbyte == -1) { - free(outbuffer); + free(slvals.outbuffer); fprintf(stderr, get_status_msg(110)); fprintf(stderr, "\n"); LOG_PRINT(LOG_WARNING, get_status_msg(110)); - close(n_sockfd); + close(slvals.n_sockfd); return 1; } - cs_status = read_status(n_sockfd); + cs_status = read_status(slvals.n_sockfd); if (cs_status && cs_status != 402) { - free(outbuffer); + free(slvals.outbuffer); fprintf(stderr, get_status_msg(cs_status)); fprintf(stderr, "\n"); LOG_PRINT(LOG_WARNING, get_status_msg(cs_status)); - close(n_sockfd); + close(slvals.n_sockfd); return 1; } if (cs_status == 402) { + int n_error; + if (stylespec_dir && *stylespec_dir) { strcpy(specfile, stylespec_dir); @@ -660,57 +667,62 @@ /* printf("specfile: %s<<\n", specfile); */ - n_read_done = 0; - - do { - numbyte = tread(n_sockfd, inbuffer, OUTBUF_LEN); -/* printf("in read specfile loop:%s<<\n", inbuffer); */ - if (numbyte == -1) { - fprintf(stderr, get_status_msg(109)); - fprintf(stderr, "\n"); - LOG_PRINT(LOG_WARNING, get_status_msg(109)); - close(n_sockfd); - free(outbuffer); - close_outfile(specfilefp); - n_broken_pipe = 0; - return 1; - } - - n_curr_trailing_z = get_trailz(inbuffer, numbyte); - - if (numbyte >= TERM_LEN) { - if (n_curr_trailing_z >= TERM_LEN) { - n_read_done++; - } - } - else if (n_curr_trailing_z == numbyte - && n_curr_trailing_z + n_last_trailing_z >= TERM_LEN) { - n_read_done++; - } - else if (n_curr_trailing_z == numbyte) { - /* terminator is still incomplete */ - n_last_trailing_z += n_curr_trailing_z; - continue; - } + byte_written += read_terminated_string(&slvals, pagerfp, &n_error); - if (!n_broken_pipe) { - /* write numbyte chars to output, unless this is the last chunk: - we do not want to write the terminating \0 */ - if (n_last_trailing_z) { - byte_written += fwrite(cs_term, sizeof(char), n_last_trailing_z, pagerfp); - } - byte_written += fwrite(inbuffer, sizeof(char), numbyte-n_curr_trailing_z, specfilefp); - } + if (n_error) { + return 1; + } +/* n_read_done = 0; */ - if (!n_read_done) { - n_last_trailing_z = n_curr_trailing_z; - } -/* printf("%s<< byte_written:%d\n", inbuffer, byte_written); */ - } while (!n_read_done); +/* do { */ +/* numbyte = tread(n_sockfd, inbuffer, OUTBUF_LEN); */ +/* /\* printf("in read specfile loop:%s<<\n", inbuffer); *\/ */ +/* if (numbyte == -1) { */ +/* fprintf(stderr, get_status_msg(109)); */ +/* fprintf(stderr, "\n"); */ +/* LOG_PRINT(LOG_WARNING, get_status_msg(109)); */ +/* close(n_sockfd); */ +/* free(slvals.outbuffer); */ +/* close_outfile(specfilefp); */ +/* n_broken_pipe = 0; */ +/* return 1; */ +/* } */ + +/* n_curr_trailing_z = get_trailz(inbuffer, numbyte); */ + +/* if (numbyte >= TERM_LEN) { */ +/* if (n_curr_trailing_z >= TERM_LEN) { */ +/* n_read_done++; */ +/* } */ +/* } */ +/* else if (n_curr_trailing_z == numbyte */ +/* && n_curr_trailing_z + n_last_trailing_z >= TERM_LEN) { */ +/* n_read_done++; */ +/* } */ +/* else if (n_curr_trailing_z == numbyte) { */ +/* /\* terminator is still incomplete *\/ */ +/* n_last_trailing_z += n_curr_trailing_z; */ +/* continue; */ +/* } */ + +/* if (!n_broken_pipe) { */ +/* /\* write numbyte chars to output, unless this is the last chunk: */ +/* we do not want to write the terminating \0 *\/ */ +/* if (n_last_trailing_z) { */ +/* byte_written += fwrite(cs_term, sizeof(char), n_last_trailing_z, pagerfp); */ +/* } */ +/* byte_written += fwrite(inbuffer, sizeof(char), numbyte-n_curr_trailing_z, specfilefp); */ +/* } */ + +/* if (!n_read_done) { */ +/* n_last_trailing_z = n_curr_trailing_z; */ +/* } */ +/* /\* printf("%s<< byte_written:%d\n", inbuffer, byte_written); *\/ */ +/* } while (!n_read_done); */ close_outfile(specfilefp); - send_status(n_sockfd, 0, TERM_NO); + send_status(slvals.n_sockfd, 0, TERM_NO); - cs_status = read_status(n_sockfd); + cs_status = read_status(slvals.n_sockfd); if (cs_status) { @@ -718,6 +730,6 @@ fprintf(stderr, "\n"); LOG_PRINT(LOG_WARNING, get_status_msg(cs_status)); - free(outbuffer); - close(n_sockfd); + free(slvals.outbuffer); + close(slvals.n_sockfd); return 1; } @@ -726,9 +738,9 @@ /* run phases 1 through 4 of client/server protocol */ - n_result = send_xml_data(fp_infile, pagerfp, stderr, n_sockfd, &byte_written); + n_result = send_xml_data(fp_infile, pagerfp, stderr, slvals.n_sockfd, &byte_written); if (n_result) { - free(outbuffer); - close(n_sockfd); + free(slvals.outbuffer); + close(slvals.n_sockfd); return 1; } @@ -738,8 +750,8 @@ /* signal server that we're done */ - send_status(n_sockfd, 402, TERM_NO); + send_status(slvals.n_sockfd, 402, TERM_NO); /* check server status, should be "chunk added successfully" */ - if ((cs_status = read_status(n_sockfd)) != 403) { + if ((cs_status = read_status(slvals.n_sockfd)) != 403) { if (cs_status == 400) { int num_trailz; @@ -747,5 +759,5 @@ /* retrieve server-generated error message */ do { - numbyte = tread(n_sockfd, inbuffer, OUTBUF_LEN); + numbyte = tread(slvals.n_sockfd, inbuffer, OUTBUF_LEN); /* printf("phase4 server reply:%s<<\n", inbuffer); */ if (numbyte == -1) { @@ -776,5 +788,5 @@ /* request data */ - send_status(n_sockfd, 0, TERM_NO); + send_status(slvals.n_sockfd, 0, TERM_NO); /* openpager and open_outfile are guaranteed to return a valid file/pipe - @@ -790,5 +802,7 @@ do { /* read in loop over all chunks of data the server is going to send */ - if ((cs_status = read_status(n_sockfd)) == 402) { + int n_error; + + if ((cs_status = read_status(slvals.n_sockfd)) == 402) { n_done_refs++; } @@ -797,6 +811,6 @@ fprintf(stderr, "\n"); LOG_PRINT(LOG_WARNING, get_status_msg(cs_status)); - free(outbuffer); - close(n_sockfd); + free(slvals.outbuffer); + close(slvals.n_sockfd); closepager(pagerfp); n_broken_pipe = 0; @@ -804,56 +818,61 @@ } - n_read_done = 0; + byte_written += read_terminated_string(&slvals, pagerfp, &n_error); - /* read data in loop */ - do { - numbyte = tread(n_sockfd, inbuffer, OUTBUF_LEN); - if (numbyte == -1) { - fprintf(stderr, get_status_msg(109)); - closepager(pagerfp); - n_broken_pipe = 0; - return 1; - } + if (n_error) { + return 1; + } +/* n_read_done = 0; */ + +/* /\* read data in loop *\/ */ +/* do { */ +/* numbyte = tread(n_sockfd, inbuffer, OUTBUF_LEN); */ +/* if (numbyte == -1) { */ +/* fprintf(stderr, get_status_msg(109)); */ +/* closepager(pagerfp); */ +/* n_broken_pipe = 0; */ +/* return 1; */ +/* } */ - n_curr_trailing_z = get_trailz(inbuffer, numbyte); +/* n_curr_trailing_z = get_trailz(inbuffer, numbyte); */ - if (numbyte >= TERM_LEN) { - if (n_curr_trailing_z >= TERM_LEN) { - /* terminator is complete */ - n_read_done++; - /* send back confirmation to the server */ - send_status(n_sockfd, 0, TERM_NO); - } - } - else if (n_curr_trailing_z == numbyte - && n_curr_trailing_z + n_last_trailing_z >= TERM_LEN) { - /* terminator is complete including the previous cycle */ - n_read_done++; - /* send back confirmation to the server */ - send_status(n_sockfd, 0, TERM_NO); - } - else if (n_curr_trailing_z == numbyte) { - /* terminator is still incomplete */ - n_last_trailing_z += n_curr_trailing_z; - continue; - } - - /* write numbyte chars to output, unless this is the last chunk: we do not - want to write the terminating \0 */ - if (!n_broken_pipe) { - if (n_last_trailing_z) { - byte_written += fwrite(cs_term, sizeof(char), n_last_trailing_z, pagerfp); - } - byte_written += fwrite(inbuffer, sizeof(char), numbyte-n_curr_trailing_z, pagerfp); - } +/* if (numbyte >= TERM_LEN) { */ +/* if (n_curr_trailing_z >= TERM_LEN) { */ +/* /\* terminator is complete *\/ */ +/* n_read_done++; */ +/* /\* send back confirmation to the server *\/ */ +/* send_status(n_sockfd, 0, TERM_NO); */ +/* } */ +/* } */ +/* else if (n_curr_trailing_z == numbyte */ +/* && n_curr_trailing_z + n_last_trailing_z >= TERM_LEN) { */ +/* /\* terminator is complete including the previous cycle *\/ */ +/* n_read_done++; */ +/* /\* send back confirmation to the server *\/ */ +/* send_status(n_sockfd, 0, TERM_NO); */ +/* } */ +/* else if (n_curr_trailing_z == numbyte) { */ +/* /\* terminator is still incomplete *\/ */ +/* n_last_trailing_z += n_curr_trailing_z; */ +/* continue; */ +/* } */ + +/* /\* write numbyte chars to output, unless this is the last chunk: we do not */ +/* want to write the terminating \0 *\/ */ +/* if (!n_broken_pipe) { */ +/* if (n_last_trailing_z) { */ +/* byte_written += fwrite(cs_term, sizeof(char), n_last_trailing_z, pagerfp); */ +/* } */ +/* byte_written += fwrite(inbuffer, sizeof(char), numbyte-n_curr_trailing_z, pagerfp); */ +/* } */ - if (!n_read_done) { - n_last_trailing_z = n_curr_trailing_z; - } - } while (!n_read_done); +/* if (!n_read_done) { */ +/* n_last_trailing_z = n_curr_trailing_z; */ +/* } */ +/* } while (!n_read_done); */ } while (!n_done_refs); /* request summary */ - send_status(n_sockfd, 0, TERM_NO); + send_status(slvals.n_sockfd, 0, TERM_NO); /* printf("byte written:%d\n", byte_written); */ @@ -861,10 +880,10 @@ - if ((cs_status = read_status(n_sockfd)) != 0) { + if ((cs_status = read_status(slvals.n_sockfd)) != 0) { fprintf(stderr, get_status_msg(109)); fprintf(stderr, "\n"); LOG_PRINT(LOG_WARNING, get_status_msg(109)); - free(outbuffer); - close(n_sockfd); + free(slvals.outbuffer); + close(slvals.n_sockfd); closepager(pagerfp); n_broken_pipe = 0; @@ -876,5 +895,5 @@ do { /* loop until we've got a complete dataset */ - numbyte = tread(n_sockfd, inbuffer, COMMAND_INBUF_LEN); + numbyte = tread(slvals.n_sockfd, inbuffer, COMMAND_INBUF_LEN); /* printf("numbyte:%d\n", numbyte); */ if (numbyte == -1) { @@ -882,6 +901,6 @@ fprintf(stderr, "\n"); LOG_PRINT(LOG_WARNING, get_status_msg(109)); - free(outbuffer); - close(n_sockfd); + free(slvals.outbuffer); + close(slvals.n_sockfd); closepager(pagerfp); n_broken_pipe = 0; @@ -922,5 +941,5 @@ /* send back confirmation to the server */ - send_status(n_sockfd, 0, TERM_NO); + send_status(slvals.n_sockfd, 0, TERM_NO); closepager(pagerfp); @@ -929,8 +948,8 @@ mylinger.l_onoff = 1; /* let close wait */ mylinger.l_linger = 5; /* 5 seconds timeout */ - setsockopt(n_sockfd, SOL_SOCKET, SO_LINGER, (const void*)&mylinger, sizeof(mylinger)); + setsockopt(slvals.n_sockfd, SOL_SOCKET, SO_LINGER, (const void*)&mylinger, sizeof(mylinger)); n_broken_pipe = 0; - free(outbuffer); - close(n_sockfd); + free(slvals.outbuffer); + close(slvals.n_sockfd); return n_retval; } |
From: Markus H. <mho...@us...> - 2006-02-05 01:31:25
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18855 Modified Files: Tag: Release_0_9_5_stable refdb-client.c refdb-client.h Log Message: new function read_terminated_string() Index: refdb-client.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdb-client.c,v retrieving revision 1.31.2.2 retrieving revision 1.31.2.3 diff -u -U2 -r1.31.2.2 -r1.31.2.3 --- refdb-client.c 29 Jul 2005 21:15:35 -0000 1.31.2.2 +++ refdb-client.c 5 Feb 2006 01:31:02 -0000 1.31.2.3 @@ -862,4 +862,104 @@ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + read_terminated_string(): reads a terminated string, usually a dataset + + size_t read_terminated_string returns the number of bytes written to + pagerfp. In case of an error, *ptr_error + is set to 1 + + struct simplelistvals* ptr_slvals ptr to struct with data for dialog + + FILE *pagerfp ptr to a FILE struct for the output stream for server + messages + + int* ptr_error ptr to error variable + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +size_t read_terminated_string(struct simplelistvals* ptr_slvals, FILE* pagerfp, int* ptr_error) { + int n_read_done = 0; + int n_curr_trailing_z = 0; + int n_last_trailing_z = 0; + size_t byte_written = 0; + size_t numbyte; + + *ptr_error = 0; + + do { /* loop until a terminated string is complete */ +/* printf("looking for a terminated string...\n"); */ + if (n_curr_trailing_z) { + numbyte += tread(ptr_slvals->n_sockfd, ptr_slvals->inbuffer+numbyte, TERM_LEN-n_curr_trailing_z); + } + else { + numbyte = tread(ptr_slvals->n_sockfd, ptr_slvals->inbuffer, OUTBUF_LEN); + } + + if (numbyte == -1) { + fprintf(stderr, get_status_msg(109)); + fprintf(stderr, "\n"); + if (ptr_slvals->n_file_open || ptr_slvals->n_file_append) { + close_outfile(pagerfp); + } + else { + closepager(pagerfp); + } + n_broken_pipe = 0; +/* delete_all_lilimem(&sentinel); */ + *ptr_error = 1; + return 0; + } + + n_curr_trailing_z = get_trailz(ptr_slvals->inbuffer, numbyte); +/* printf("n_curr_trailing_z went to %d<<n_last_trailing_z went to %d<<numbyte went to %d\n", n_curr_trailing_z, n_last_trailing_z, numbyte); */ + if (numbyte >= TERM_LEN) { + if (n_curr_trailing_z >= TERM_LEN) { + /* terminator is complete */ +/* printf("found complete terminator\n"); */ + n_last_trailing_z = 0; + n_read_done++; + /* send back confirmation to the server */ + send_status(ptr_slvals->n_sockfd, 0, TERM_NO); + } + else { + /* terminator is still incomplete */ +/* printf("incomplete terminator, trying again\n"); */ + } + } + else if (n_curr_trailing_z == numbyte + && n_curr_trailing_z + n_last_trailing_z >= TERM_LEN) { +/* printf("completed terminator\n"); */ + n_last_trailing_z = 0; + /* terminator is complete including the previous cycle */ + n_read_done++; + /* send back confirmation to the server */ + send_status(ptr_slvals->n_sockfd, 0, TERM_NO); + } + else if (n_curr_trailing_z == numbyte) { + /* terminator is still incomplete */ +/* printf("incomplete terminator, trying again\n"); */ + n_last_trailing_z += n_curr_trailing_z; + continue; + } + + /* write numbyte chars to output, unless this is the last chunk: we do not + want to write the terminating \0 */ + if (!n_broken_pipe) { + if (n_last_trailing_z) { +/* printf("writing n_last_trailing_z\n"); */ + byte_written += fwrite(cs_term, sizeof(char), n_last_trailing_z, pagerfp); + } +/* printf("writing numbytes\n"); */ + byte_written += fwrite(ptr_slvals->inbuffer, sizeof(char), numbyte-n_curr_trailing_z, pagerfp); + } +/* printf("n_read_done is %d<<n_done is %d<<\n", n_read_done, n_done); */ +/* printf("inbuffer went to:%s<<\nn_read_done is %d<<n_done is %d<<\n", ptr_slvals->inbuffer, n_read_done, n_done); */ + if (!n_read_done) { + n_last_trailing_z = n_curr_trailing_z; + } + } while (!n_read_done); + + return byte_written; +} + +/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pipehandler(): handler for the SIGPIPE signal. Sets the global variable n_broken_pipe to non-zero. This condition Index: refdb-client.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdb-client.h,v retrieving revision 1.15.2.1 retrieving revision 1.15.2.2 diff -u -U2 -r1.15.2.1 -r1.15.2.2 --- refdb-client.h 15 Apr 2005 22:45:08 -0000 1.15.2.1 +++ refdb-client.h 5 Feb 2006 01:31:02 -0000 1.15.2.2 @@ -20,4 +20,8 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +#ifndef REFDB_CLIENT_H +#define REFDB_CLIENT_H 1 + +#include <stdio.h> /* required for the FILE definition */ struct simplelistvals { @@ -27,5 +31,5 @@ int n_pipe; /* if 1, write to pipe */ char* outbuffer; /* holds the command for the server */ - char inbuffer[OUTBUF_LEN]; /* holds the reply from the server */ + char inbuffer[OUTBUF_LEN+TERM_LEN]; /* holds the reply from the server */ char* outfile; /* ptr to string with output filename */ char* outpipe; /* ptr to string with pipe command */ @@ -42,2 +46,4 @@ void inthandler(int sig); char* build_batchcommand(int argc, char** argv, int optind, char* s, char* the_command); +size_t read_terminated_string(struct simplelistvals* ptr_slvals, FILE* pagerfp, int* ptr_error); +#endif |