cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: NULLs in binary input file result in mangled request?

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Thu, 13 Oct 2005 19:17:42 +0200 (CEST)

On Thu, 13 Oct 2005, curl-users_at_cool.haxx.se_at_textnode.com wrote:

> First post to the list, so hi folks!

Howdy ho!

> /usr/local/bin/curl --verbose --data-binary @eaif_post.bin -H "Content-Type:
> application/vnd.wap.mms-message" -H "x-nokia-mmsc-message-type:
> MultiMediaMessage" -H "x-nokia-mmsc-version: 2.0" http://mmsc/eaif
>
> The file eaif_post.bin contains a binary payload which has NULLs present in
> various places.
>
> When the request is sent out, a snoop with ethereal shows that the HTTP POST
> contains content matching the contents of the file eaif_post.bin only up to
> the first NULL.

> From that point onwards the request contains garbage (seemingly random
> bytes).

I cannot repeat this. I created a tiny binary file for the purpose of trying
it out, and I stuffed it with lots of zero bytes and ascii characters and
doing a post with that worked pefectly fine for me.

> here are the contents of the file eaif_post.bin after base64 encoding

I'll try to decode that and do a test run later on. Life is _really_ busy
right now...

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-10-13