El Lunes, 14 de Abril de 2008, Robert Klemme escribi=F3:
> 2008/4/12, I=F1aki Baz Castillo <ibc / aliax.net>:
> > 2008/4/12, Joel VanderWerf <vjoel / path.berkeley.edu>:
> >  >  Why do you need a From class that is distinct from Header?
> >
> > Because in an initial parsing I just get a headers array, whiotu
> >  inspecting each of them.
> >  Later, if I need, I look for some specific headers (From, To...) and
> >  need to add some methods to them.
>
> IMHO it is more efficient and less error prone if you create
> appropriate instances during initial parsing.  You have all the
> information at that point in time plus you you save one additional
> pass through the collection.

Yes, but let me explain:

I'm doing a SIP protocol parser. In SIP a repeated request can be received=
=20
because retransmissions and there is no need at all of parsing the entire=20
request to know if it's a retransmission (since it will be discarded).
Also, I don't need to parse all the headers, but I cannot know which header=
s=20
I'll need to parse since that is a application layer decission instead of=20
transport layer decission.
=46or example: If I implement a SIp proxy I just need to parse some headers=
, if=20
I do a SIP server UAS I need to parse others. Transport layer is common but=
=20
application layer not, so I don't need to do all the parsing in transport=20
layer.




Thanks a lot for all you suggestions and help. Best regards.


=2D-=20
I=F1aki Baz Castillo