Parsing http header with TLex class

example of TLex use:
TLex8 lbuf=TLex8(aBuf);

check:
if (crF)
{
  if (lbuf.Peek()==Klf)
  {
    TUint hdridx=iHeadEnd + 1 + lbuf.Offset();
    if (iLastHdrIdx +1 == hdridx)
      iHdrClosed = ETrue;
    iLastHdrIdx = hdridx;
    iIdxs->Append(iLastHdrIdx);
    iHdrNr++;
  }
  lbuf.Inc();
  crF=EFalse;
}
while (lbuf.Offset() lbuf.Inc();

if (lbuf.Peek()==Kcr) crF=ETrue;
if (lbuf.Offset()==aSize)
  goto parsed;
goto check;
parsed:

Take a whole http response and parse header lines. iLastIdrIdx is found searching \r\n\r\n sequence in aBuf. This code parse header and put in iIdxs int array. LIT8(Kcr,"\r"); LIT8(Klf,"\n");

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is used to make sure you are a human visitor and to prevent spam submissions.
Copy the characters (respecting upper/lower case) from the image.