[Chilli] change in wwwsh

Xabier Oneca -- xOneca xoneca at gmail.com
Tue Sep 24 20:52:05 UTC 2013


Hello Matt,

As I understand it, it pads the data with spaces if for some reason full
$CONTENT_LENGTH is not received.

I wondered why was that done, thanks for the info!
El 23/09/2013 20:15, "Beebe, Matthew" <matthew.beebe at hei-ss.com> escribió:

> Hello all:****
>
> ** **
>
> r476 (sep 2012) of coova-chilli introduced a change in wwwsh:****
>
> ** **
>
> What previously had been this:****
>
> dd of=$POST_FILE count=$CONTENT_LENGTH bs=1 2>/dev/null****
>
> ** **
>
> Became this:****
>
> dd of=$POST_FILE cbs=$CONTENT_LENGTH conv=block count=1 2>/dev/null****
>
> ** **
>
> ** **
>
> ie:****
>
> ****
>
> ===================================================================****
>
> --- wwwsh(revision 475)****
>
> +++ wwwsh(revision 485)****
>
> @@ -24,7 +24,7 @@****
>
> if [ ${CONTENT_LENGTH:-0} -gt 0 ]; then****
>
>      POST_FILE=/tmp/post.$$****
>
>      export POST_FILE****
>
> -    dd of=$POST_FILE count=$CONTENT_LENGTH bs=1 2>/dev/null****
>
> +    dd of=$POST_FILE cbs=$CONTENT_LENGTH conv=block count=1 2>/dev/null**
> **
>
>      $haserl $file < $POST_FILE****
>
>      /bin/rm -f $POST_FILE****
>
> else****
>
> ** **
>
> ** **
>
> This was apparently related to a change proposed back in Jan 2011 to
> assist with Content-Length responses sent from some browsers.  (see:
> http://coova.org/node/4640) (though I'm not certain that was the reason,
> but it was the same change as proposed)****
>
> ** **
>
> ** **
>
> However, the "cbs=" and "conv=block" are parameters not supported by the
> dd program included in most embedded systems (ie: the standard busybox
> binary doesn't handle those parameters)****
>
> ** **
>
> While I _WAS_ smart enough to track this down as the source of my
> problems, and _WAS_ smart enough to search through the svn commits to find
> where/when the change was introduced, I'm apparently not smart enough to
> understand what it is doing...  :)****
>
> ** **
>
> If I change it to the prior way, my immediate problem goes away, but I
> must confess I don't fully understand what this change was fixing, so I
> can't be certain I'm not breaking something important.  ****
>
> ** **
>
> I'd also like to take a stab at re-factoring it in a way that is more
> broadly supported, but am a little lost on what it is trying to
> accomplish.  Any thoughts/comments are appreciated.  ****
>
> ** **
>
> Thanks.****
>
> ** **
>
> -Matt****
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> _______________________________________________
> Chilli mailing list
> Chilli at coova.org
> http://lists.coova.org/cgi-bin/mailman/listinfo/chilli
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.coova.org/pipermail/chilli/attachments/20130924/ac685a17/attachment.html>


More information about the Chilli mailing list