BIND 10 #2572: extend MasterLexer to provide current/total bytes of source(s)

BIND 10 Development do-not-reply at isc.org
Thu Jan 10 23:44:47 UTC 2013


#2572: extend MasterLexer to provide current/total bytes of source(s)
-------------------------------------+-------------------------------------
            Reporter:  jinmei        |                        Owner:
                Type:  task          |  jinmei
            Priority:  medium        |                       Status:
           Component:  libdns++      |  reviewing
            Keywords:                |                    Milestone:
           Sensitive:  0             |  Sprint-20130122
         Sub-Project:  DNS           |                   Resolution:
Estimated Difficulty:  4             |                 CVSS Scoring:
         Total Hours:  0             |              Defect Severity:  N/A
                                     |  Feature Depending on Ticket:
                                     |  loadzone-ng
                                     |          Add Hours to Ticket:  0
                                     |                    Internal?:  0
-------------------------------------+-------------------------------------

Comment (by jinmei):

 Thanks for the review.

 Replying to [comment:6 jelte]:

 > Very general question/consideration; do we want to support being able to
 read from inputs where file size is undefined? (i.e. not error on -1 but
 just report 'unknown' so that you can, for instance, pipe cin to parse
 from?)

 Hmm, good point.  Although we've not used it that way, the interface
 could be used so and I can imagine use cases like that.  So I think
 the implementation should allow that.  I've updated the code so that
 the above scenario should work.  (The "undefined" case should be
 identified at the time of initial seek; I kept the operations and
 error handling that follow).  Unfortunately I found it difficult to
 test it in the unittest framework (we'd need another process or create
 a unix domain socket or something, which seemed overkilling for this
 purpose), so I only emulated the case by tweaking error bits in
 istream.

 > master_lexer.h:
 >
 > getPosition: the note about 'if a source is pushed, this method will
 normally return a smaller number', is that 'when a source is pushed due to
 encountered data like the $INCLUDE directive' (which has an unget
 somewhere)? If so it might make sense, otherwise i don't see how the
 position would move back, or am I misunderstanding something here?

 Oops, (I believe) that was simply a typo and should have been
 "popped".  Fixed.

-- 
Ticket URL: <https://bind10.isc.org/ticket/2572#comment:7>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list