Good Book on Parsing Strings?

B

bwaichu

I am writing a very basic web server, and I need to parse the HTTP
Request string that I am receiving. Are there any good C books that
suggest ways to parse strings effectively?

Thanks!
 
M

Malcolm

I am writing a very basic web server, and I need to parse the HTTP
Request string that I am receiving. Are there any good C books that
suggest ways to parse strings effectively?

Thanks!
For information on how to write a parser download my book
_MiniBasic - how to write a script interpreter_.
www.lulu.com/bgy1mm
It's only $1.25 download, a bit more for a paper copy.
If that breaks your bank balance, most of the information is available on
the website for nothing. However I'd recommend having it all together.
 
P

pemo

I am writing a very basic web server, and I need to parse the HTTP
Request string that I am receiving. Are there any good C books that
suggest ways to parse strings effectively?

There are many books that treat this subject a bit mathematically, e.g.,
String Searching Algorithms by Graham Stephen - is this the kinda thing
you're after? This one doesn't have any C, but does include pseudo code
that you could easily convert.


--
==============================================================================
USENET: Post to exotic, distant machines. Meet exciting, unusual people.
And flame them.

Dan Sorenson
==============================================================================
 
C

CBFalconer

pemo said:
There are many books that treat this subject a bit mathematically,
e.g., String Searching Algorithms by Graham Stephen - is this the
kinda thing you're after? This one doesn't have any C, but does
include pseudo code that you could easily convert.

String parsing is much different from string searching. I suggest
the OP start with something simple, and an example of that is
contained in my id2id program. That system is concerned solely
with possible identifiers in a text stream, and can more or less
ignore everything else. This is done with two routines:
skiptoident and getident.

The full details are available in the source code for id2id, at:

<http://cbfalconer.home.att.net/download/>
 
B

bwaichu

CBFalconer said:
String parsing is much different from string searching. I suggest
the OP start with something simple, and an example of that is
contained in my id2id program. That system is concerned solely
with possible identifiers in a text stream, and can more or less
ignore everything else. This is done with two routines:
skiptoident and getident.

The full details are available in the source code for id2id, at:

<http://cbfalconer.home.att.net/download/>

Thanks. I'll check it out.

Basically, I just wanted to read through the HTTP request and dump
each element into a structure for use later.
 
W

Walter Roberson

I am writing a very basic web server, and I need to parse the HTTP
Request string that I am receiving. Are there any good C books that
suggest ways to parse strings effectively?

I would suggest that you use a pre-written third-party HTTP parser.
The HTTP rules are more complex than is obvious, and it has been
common for implementations to have noticable parsing bugs;
even well-examined parsers such as Apache have been vulnerable to
security problems from mis-parsing.
 
B

bwaichu

Walter said:
I would suggest that you use a pre-written third-party HTTP parser.
The HTTP rules are more complex than is obvious, and it has been
common for implementations to have noticable parsing bugs;
even well-examined parsers such as Apache have been vulnerable to
security problems from mis-parsing.

I am writing this to learn the HTTP protocol, not to create software
for someone else to use.
I am then going to write a fuzzer to send malformed requests to the
server. I think I'll learn a lot by writing both.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top