curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: libcurl usage on os400 (ccsid troubles)

From: Patrick Monnerat via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 12 Sep 2019 15:28:29 +0200

On 9/12/19 1:23 PM, Александр wrote:
> Hello, Patrick.

Hi Aleksandr,

Please use the mailing list at
https://cool.haxx.se/mailman/listinfo/curl-library or create a github
issue for all curl library related issues: they might interest other
people as well and since I do not have access to an IBM i for 3 years,
someone else could also help you.

I Cc this reply to the list.

> I've discovered you as an author of libcurl for os400 makefiles
> (should admit, quality ones).
> All build process of libcurl ran smoothly except couple specific
> places I've got to build by hand.
This may interest us. If the build process described in
packages/OS400/README.OS400 fails, please create an issue on github.
>
> However, there are troubles when it comes to usage.
> Can you please elaborate solving it?
> Code attached.
>
> The main failure reason is CURLE_COULDNT_RESOLVE_HOST no matter what
> host is selected (even plain resolvable ip).
>
> I think that the main issue is in line 367 of MPRINTF.C because strtol
> picks up job CCSID.
> Then the code is hanging when it gets string of 05u in ansi and
> considers it as a decimal.

If this is the real reason, the regular (EBCDIC) strtol is called
instead of the QADRT version (ASCII). This should not occur and may come
from what you've done manually during the build process.

I rather suspect the use of curl_easy_setopt() for string options
instead of curl_easy_setopt_ccsid(): curl_easy_setopt() takes ASCII
strings and you give it EBCDIC strings.

In addition, your C program has some bugs/caveats:

- NEVER redefine CURL_* preprocess symbols. Including curl/curl.h should
define them for you.

- The remote port is defined twice inconsistently (with CURLOPT_URL and
CURLOPT_PORT). As a result, the one in CURLOPT_URL is meaningless. Of
course this is not the source of your current problem.

Please remember the curl library is an ASCII-based library and maybe
read again packages/OS400/README.OS400.

Regards,

Patrick

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-09-12