RE: Help with this code snippet please (Tom Wood)

"Tom Wood" <[email protected]>
Newsgroups gmane.network.tux
Message-ID <[email protected]>
Thank you, I think the major problem with my code is that I'm not following
the event-driven model to the T. I found an example from an earlier post after I posted this message that clued me
in on how tux modules work! I'm off and running now! Thanks again!

-----Original Message-----
From: [email protected] [mailto:[email protected]]On
Behalf Of [email protected]
Sent: Friday, July 12, 2002 1:43 PM
To: [email protected]
Subject: RE: Help with this code snippet please (Tom Wood)


From: "Tom Wood" <[email protected]>
To: <[email protected]>
Subject: Help with this code snippet please
Date: Thu, 11 Jul 2002 17:54:56 -0400
Reply-To: [email protected]

> For some reason the gif image review.gif will get blurred or mangled
> when it is sent to the clients browser using this code.
> Can someone tell me what I'm doing wrong?

> if(tux(TUX_ACTION_GET_OBJECT, req) > -1 && !req->error)

this should be

if(tux(TUX_ACTION_GET_OBJECT, req) < 0 || req->error)

> 	strcpy(req->objectname, "REVIEW.GIF");
> 	req->objectlen = strlen(req->objectname);
> 	req->event = 1;
> 	ret = tux(TUX_ACTION_GET_OBJECT, req);
> 	if(ret < 0 || req->error)
> 	{
> 		return tux(TUX_ACTION_FINISH_CLOSE_REQ, req);
> 	}
> 	else
> 	{
> 		return ret;
> 	}

You're missing some vital steps; after GET_OBJECT you must call
TUX_ACTION_SEND_OBJECT and TUX_ACTION_FINISH_CLOSE_REQ, preferably in the
event-driven model (which you haven't used properly here).

Again, demo2.c shows how to do this correctly.

David



_______________________________________________
tux-list mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/tux-list
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.375 / Virus Database: 210 - Release Date: 7/10/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.375 / Virus Database: 210 - Release Date: 7/10/2002
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.