[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [OSSTEST PATCH v13 19/24] TestSupport: Implement target_subunit_cmd a subunit stream parser into substeps
On Wed, Jul 26, 2017 at 04:41:58PM +0100, Ian Jackson wrote: > Anthony PERARD writes ("Re: [OSSTEST PATCH v13 19/24] TestSupport: Implement > target_subunit_cmd a subunit stream parser into substeps"): > > I think I start by looking at what kind of characters could be part of > > type and sub-type, and just start writing a more complicated regex. > > > > So is the following would be enough for you? > > m{^Content-Type: [^/ ]+/[^/ ]+(?:;.+)?$} > > Why do you need to check the at all ? I think, according to the spec, > that the only thing which can occur here is "Content-Type: something" > or "]". What would be wrong with > m{^content-type:}i > ? Ok, will go with that. > > > > + # Read chunks of a part > > > > + while (<$stdout>) { > > > > + if (/^([0-9A-F]+)\r$/i) { > > > > + my $chunk_size = hex($1); > > > > > > What makes you think the digits are in hex ? > > > > I tried with [0-9] (because DIGITS), but that was not enought. Then I've > > check the subunit implementation, there are using "%X" which is hex. > > Wow. Can you put a comment next to this please ? Something like > > # The chunk size is in hex, even though this does not seem to be > # documented in the subunit specification. > > perhaps. I don't think there is a specification for subunit, beside the source code. In the README of the project, it is called a "description", and there is even "When in doubt, refer the source". But I guess I can add the comment. -- Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |