int MyDoGet(int sock, PSTR url, PSTR rxBuffer)
{
if (strlen(url))
{
if(httpstricmp(url,"IMAGE.GIF"))
{/* Browser is asking for GIF image */
GraphData gd;
SizeData sd;
GetData(gd,sd,url);
SendGifHeader(sock);
DrawGraph(sock,sd.xsize,sd.ysize,gd.MinD,gd.MaxD,gd.MinT,gd.MaxT);
return 1;
}
else
if(httpstricmp(url,"RESET"))
{/* Browser is asking us to reset limit values */
char buffer[80];
char * cp=url;
while ((*cp) &&( *cp!='?')) cp++;
sprintf(buffer,"INDEX.HTM%s",cp);
/* Decide what kind of reset request it was */
if(httpstricmp(url,"RESETMAX.HTM"))
{
gMaxMeasured=-9999;
}
else
if(httpstricmp(url,"RESETMIN.HTM"))
{
gMinMeasured=9999;
}
else
if(httpstricmp(url,"RESETBUF.HTM"))
{
gNextPosition=0;
}
RedirectResponse(sock,buffer);
return 1;
}
}
return (* oldhand)(sock,url,rxBuffer); /*Use old handler */
}
Listing 7The MyDoGet code looks at the document URL and performs different actions depending on the document name
part of the URL. If it is IMAGE.GIF, the request is sent to the image-rendering system. If it contains
RESET, it processes one of several actions and redirects the browser to a new web page.