Yup, I&#39;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> &lt;<a href="mailto:balinny@gmail.com">balinny@gmail.com</a>&gt; 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>&gt; I just checked this into subversion and will attach it here, if you
<br>&gt; know perl hopefully it isn&#39;t too obtuse to read and get an idea of how<br>&gt; it works, which is very very simple (compared to the old SOAP interface).<br>&gt;<br>&gt; I&#39;m trying to get a new <a href="http://dispatch.grub.org">
dispatch.grub.org</a> officially set up and a<br>&gt; whole bunch of work units available under it.&nbsp;&nbsp;It&#39;ll just use HTTP<br>&gt; basic auth and probably 250-url sized work units.&nbsp;&nbsp;It should be really<br>&gt; really easy to code grub clients in any language or environment :)
<br>&gt;<br>Nice! :-)<br>However, as i&#39;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 &quot;http://$host$path $ip<br>19691231175959 $ctype &quot;,length($body),&quot;\n$body&quot;; 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&#39;t connect to host / host doesn&#39;t answer?&nbsp;&nbsp;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&#39;t connect to <a href="http://www.nantah.com:80">www.nantah.com:80</a> (Bad hostname &#39;<a href="http://www.nantah.com">www.nantah.com</a>&#39;)<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&#39;s)
<br>There&#39;s an unterminated string. at line 78. It should be print<br>$res-&gt;status_line,&quot;\n&quot;; 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&#39;t available for upload_archive<br>Grub user-agent isn&#39;t being used, but added as an &quot;Agent&quot; header. Is<br>that intentional? i changed to:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach my $header (@headers) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$host = $1 if($header =~ /Host\: (.+)$/);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$useragent = $1 if($header =~ /(User-)?Agent\: (.+)$/);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ua-&gt;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>