[freetds] old patch

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Tue Jul 11 11:34:20 EDT 2006


> > 
> > About patch
> > 
> http://freetds.cvs.sourceforge.net/freetds/freetds/src/tds/tok
> en.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. 
> :-/
> 

Well... is not that it returns token, is that token variable is reused
to store a TDS_FAIL/TDS_SUCCEED... just rename token in
tds_process_param_result to rc :) However result is not used...

freddy77




More information about the FreeTDS mailing list