Yup, I'll be sending out another patch in a few hours.<br><br><br><br><div><span class="gmail_quote">On 1/9/08, <b class="gmail_sendername">Balinny</b> <<a href="mailto:balinny@gmail.com">balinny@gmail.com</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">jer wrote:<br>> I just checked this into subversion and will attach it here, if you
<br>> know perl hopefully it isn't too obtuse to read and get an idea of how<br>> it works, which is very very simple (compared to the old SOAP interface).<br>><br>> I'm trying to get a new <a href="http://dispatch.grub.org">
dispatch.grub.org</a> officially set up and a<br>> whole bunch of work units available under it. It'll just use HTTP<br>> basic auth and probably 250-url sized work units. It should be really<br>> really easy to code grub clients in any language or environment :)
<br>><br>Nice! :-)<br>However, as i'm not a fluent speaker of Perl, i went to create a C<br>version :-)<br><br>I found a number of doubts:<br>*At the perl version you do print $arc "http://$host$path $ip<br>19691231175959 $ctype ",length($body),"\n$body"; so the end of previous
<br>page body touches the start of next chunk, but from<br><a href="http://www.archive.org/web/researcher/ArcFileFormat.php">http://www.archive.org/web/researcher/ArcFileFormat.php</a> a \n would be<br>required in front of http://
<br><br>*$body contains both headers and body. Separated by CRLF CRLF or only CRLF?<br>*What should the client do if the dns doesn not respond / can't connect to host / host doesn't answer? Add an entry with size 0? Not include it on the index?
<br><br>Include a fake answer as the perl client does?<br>500 Can't connect to <a href="http://www.nantah.com:80">www.nantah.com:80</a> (Bad hostname '<a href="http://www.nantah.com">www.nantah.com</a>')<br>Content-Type: text/plain
<br>Client-Date: Wed, 09 Jan 2008 16:53:42 GMT<br>Client-Warning: Internal response<br>Should the fake Client-* be present?<br><br>*What to do with Transfer-Encoding: chunked?<br>**Remove the header + decode body<br>**Keep header + decode body
<br>**Keep Header + keep body<br>(perl renames header to Client-Transfer-Encoding and decodes body)<br>I vote for Keep header + decode body, so that allows the client to do<br>things like fetching the content compressed but preserve original data
<br>for the server.<br><br>*Is the client allowed to change the url positions in the file? Say a<br>web is down on first fetch and is retrieved later and appended...<br><br>Some comments about the perl version (using Yousef's)
<br>There's an unterminated string. at line 78. It should be print<br>$res->status_line,"\n"; or you get an error on line 96: print STDOUT...<br>The final call to upload_archive(); is wrong. It is already called at
<br>line 52.<br>At lines 11 and 12 $reg and $ua are wrongly defined as local, so they<br>aren't available for upload_archive<br>Grub user-agent isn't being used, but added as an "Agent" header. Is<br>that intentional? i changed to:
<br> foreach my $header (@headers) {<br> $host = $1 if($header =~ /Host\: (.+)$/);<br> $useragent = $1 if($header =~ /(User-)?Agent\: (.+)$/);<br> }<br> $ua->agent($useragent);
<br>_______________________________________________<br>Grub-dev mailing list<br><a href="mailto:Grub-dev@wikia.com">Grub-dev@wikia.com</a><br><a href="http://lists.wikia.com/mailman/listinfo/grub-dev">http://lists.wikia.com/mailman/listinfo/grub-dev
</a><br></blockquote></div><br>