cURL / Mailing Lists / curl-library / Single Mail

curl-library

http client changes for libcurl on non-ASCII platforms

From: David McCreedy <mccreedytpf_at_msn.com>
Date: Tue, 09 Jan 2007 04:37:43 +0000

This patch allows the HTTP-related code in libcurl to run on non-ASCII
platforms.
While common code was modified, no changes should be seen on ASCII-based
platforms.

Eight files were changed: formdata.c, formdata.h, http.c, http_chunks.c,
http_digest.c, sendf.c, transfer.c, and url.c.

There are three general changes affecting multiple programs:

1) Constants were changed from hardcoded hex (or octal) values to C escape
sequences. Or vice versa, depending on where they were in the processing.
Sometimes we're working with data in the network encoding and sometimes
we're working with data in the host's encoding.
And if you're lucky enough to be on an ASCII host, it's all the same thing.

2) Strategic conversions were added to formdata.c, http.c, http_chunks.c,
http_digest.c, and transfer.c
(You'll note that in http_digest.c the CURL_OUTPUT_DIGEST_CONV macro was
added since the conversion calls needed to go in multiple places in the code
but a subroutine was ill suited for the logic.)

3) The internal Curl_formclean function was changed to prevent multiple free
calls for the same storage. It now takes a pointer to the initial FormData
pointer and it nulls that out after the storage is freed.
This isn't ASCII related; I noticed it because I'm running on an operating
system that cares about multiple free calls on the same storage address.

And there were a couple of changes specific to formdata.c and formdata.h:

1) Several changes were made to formdata.c's test harness that is compiled
if _FORM_DEBUG is defined.
For example, the Makefile.b32 file is now used since Makefile.b32.resp is no
longer around. And the errors are clearer, which would have saved me time
in figuring out that Makefile.b32.resp wasn't found.
I'm guessing this code hasn't been used in a long time, but I found it
helpful.

2) A new formtype enum of FORM_CONTENT was added to formdata.h to allow
differentiation between form data that needs to be converted to the network
encoding and actual content (which is never converted).
So you'll see that some of the FORM_DATA checks have changed to
FORM_CONTENT.

Thank you,

-David McCreedy

Received on 2007-01-09