Skip to Content.
Sympa Menu

freetds - RE: [freetds] Comment on change

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Comment on change
  • Date: Wed, 5 Mar 2003 10:45:37 -0500

> From: ZIGLIO Frediano [mailto:Frediano.Ziglio AT vodafoneomnitel.it]
> Sent: March 5, 2003 9:56 AM
>
> @ dbcancel(DBPROCESS * dbproc)
> @ {
> @ +int marker;
> @ +TDSSOCKET *tds;
> @ +
> @ + tds = (TDSSOCKET *) dbproc->tds_socket;
> @ +
> @ + while (tds->state != TDS_COMPLETED ) {
> @ +
> @ + marker = tds_get_byte(tds);
> @ +
> @ + tdsdump_log(TDS_DBG_INFO1, "%L dbcancel() discarding
> results. marker is %x\n", marker);
> @ +
> @ + if (tds_process_default_tokens(tds, marker) ==
> TDS_FAIL)
> @ + return TDS_FAIL;
> @ + }
> @ +
> @ tds_send_cancel(dbproc->tds_socket);
> @ tds_process_cancel(dbproc->tds_socket);
> @ return SUCCEED;
> @ }
> @
>
> ?? skipping data instead to send a proper cancel is quite
> bad... if server
> is returning huge amount of data cancel take ages.... IMHO
> libtds (token.c)
> should be encharge for processing cancel, not dblib.

Bill, what was the motivation here? Do you have an example of a query or
situation where
dbcancel(DBPROCESS * dbproc)
{
tds_send_cancel(dbproc->tds_socket);
tds_process_cancel(dbproc->tds_socket);
return SUCCEED;
}

is insufficient? If so, I'd like to address it in libtds, as Freddy
suggests.

Your version is highly dangerous IMO. Safer would have been to call
dbcanquery() before tds_send_cancel(). That would have discarded genuine
rows, not just anything the server happened to send. But that begs the
question of why tds_send_cancel() isn't good enough.

--jkl


The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that we do not accept account orders and/or
instructions by e-mail, and therefore will not be responsible for carrying
out such orders and/or instructions.





Archive powered by MHonArc 2.6.24.

Top of Page