Combining WiServer's multiple responses?

Discussion about any of the included sketches (i.e. WebServer), or user-generated applications.

Combining WiServer's multiple responses?

Postby bethesda » Sun Nov 14, 2010 1:13 pm

As noted in the SimpleClient.pde comments, WiServer often returns it's response to an HTTP GET in multiple 'packets', meaning it calls the callback function multiple times. The problem with this is that the data I'm looking for could span the boundary of two of these responses, getting cut in half. So, I'm thinking I'll concatenate all the data it returns in multiple responses, then parse the whole thing. The problem is I don't know how to detect when the response is complete. Appreciate any assistance on this.
bethesda
 
Posts: 6
Joined: Thu Nov 04, 2010 5:43 pm

Re: Combining WiServer's multiple responses?

Postby GregEigsti » Sun Nov 14, 2010 1:44 pm

The problem is I don't know how to detect when the response is complete.

I believe your callback is called with no data to indicate end of data. You might instrument with Serial.print() and make sure.
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Re: Combining WiServer's multiple responses?

Postby bethesda » Sun Nov 14, 2010 2:59 pm

Thanks, that makes sense. Will try it.
bethesda
 
Posts: 6
Joined: Thu Nov 04, 2010 5:43 pm


Return to Sketches and Applications

Who is online

Users browsing this forum: No registered users and 2 guests