[freetds] old patch

James K. Lowden jklowden at freetds.org
Tue Jul 11 08:25:31 EDT 2006

ZIGLIO, Frediano, VF-IT wrote:
> About patch
> http://freetds.cvs.sourceforge.net/freetds/freetds/src/tds/token.c?r1=1.
> 313&r2=1.314&sortby=date
> these lines
>  if( marker == TDS_FAIL ) {
>     tdsdump_log(TDS_DBG_FUNC, "error: tds_process_param_result()
> returned TDS_FAIL\n");
>     return TDS_FAIL;
>  }
> seem a bit odd.. tds_get_byte does not return TDS_FAIL and also you
> should close connection if you detect an problem in server data (but
> perhaps tds_get_byte returns invalid only if connection was broken).

You're quite right.  But I'm only as confused as the code is.  

I was trying to catch the return from tds_process_param_result(), which
can be a token *or* TDS_FAIL.  But of course the logic:

	while ((marker = tds_get_byte(tds)) == TDS_PARAM_TOKEN) {
		tds_process_param_result(tds, pinfo);

ignores the return code and discards the token.  I'm surprised it works. 



More information about the FreeTDS mailing list