[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] MCH6903 on httpapi https request



Hello Scott,

sorry for not providing more info in the original mail.

From the debug log:
HTTPAPI Ver 1.42 released 2020-10-12
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R3M0

This is the relevant code:

       if ws_debug or ws_debug_pgm or F0000I = 'Y'; // Write log?
         if F0000C = 0;
          F0000C = uniqueId();
         endif;
         http_debug(*on: '/tmp/WS-Logs/' + P0 + '_'
                                         + %char(F0000C) + '_'
                                         + %char(F0000J) + '.log');
        else;
         http_debug(*off);
       endif;

       monitor;
         if http_setOption('network-ccsid': '1208') = -1;
           F0001J = http_error();
           F0005W = 'ERR';
         endif;
        on-error;
         F0001J = http_error();
         F0005W = 'ERR';
       endmon;

       F0000S = 'grant_type=password&scope=openid'
              + '&client_id=' + http_urlEncode(%trimr(%subst(F00067: 1: 20)))
              + '&client_secret=' + http_urlEncode(%trimr(%subst(F00067: 21)))
              + '&username=' + http_urlEncode(%trim(F00006))
              + '&password=' + http_urlEncode(%trim(F00007));
       
       monitor;
         rc = http_req('POST'
                      :%trimr(F0000F)
                      :*omit
                      :rqOutput
                      :*omit
                      :%trimr(F0000S)
                      :'application/x-www-form-urlencoded'
                      );
         F0001Q = rqOutput;
         if rc <> 1;
           F0005W = 'ERR';
          else;
           F0005W = '';
         endif;
        on-error;
         F0001Q = '';
         F0005W = 'ERR';
       endmon;
 
       F0001J = http_error(x1: x2);
       F0001H = x1;
       F0001I = x2;
     
       if F0001I > 200 and F0001I < 300;
           F0005W = '';
         endif;

       ........

       monitor;
         y_string = %trimr(F0001Q);
         y_docNode = yajl_buf_load_tree( %addr(y_string: *data):
                                         %len(y_string):
                                         y_errmsg );
         if y_docNode = *null or y_errmsg <> '';
           F00057 = y_errmsg;
           F0005W = 'ERR';
         endif;
        on-error;
         F0005W = 'ERR';
       endmon;

       x1 = 0;
       dow yajl_object_loop(y_docNode: x1: y_key: y_val);
        select;
         when y_key = 'access_token';
          F0001A = yajl_get_string(y_val);
         when y_key = 'expires_in';
          t_timestamp = %timestamp() + %seconds(yajl_get_number(y_val) - 5);
          F0001D = %dec(t_timestamp);
         when y_key = 'refresh_token';
          F0001C = yajl_get_string(y_val);
         when y_key = 'refresh_expires_in';
          t_timestamp = %timestamp() + %seconds(yajl_get_number(y_val) - 5);
          F0001E = %dec(t_timestamp);
         when y_key = 'id_token';
          F0001B = yajl_get_string(y_val);
         when y_key = 'error';
          F0001F = yajl_get_string(y_val);
         when y_key = 'error_description';
          F0001G = yajl_get_string(y_val);
        endsl;
       enddo;

       monitor;
         yajl_tree_free(y_docNode);
         F0005W = '';
        on-error;
         F0005W = 'ERR';
       endmon;

BTW. This is part of a tool generated pgm. Pls ignore the strange field names.

Thanks and best regards
Richard


Am Do., 25. Feb. 2021 um 00:49 Uhr schrieb Scott Klement <sk@xxxxxxxxxxxxxxxx>:
Hard to say.  How are you coding the requests?


On 2/24/2021 9:34 AM, Richard la Croix wrote:

> hello,
>
> I have a problem with a long running job that does many https requests.
> After about 2000 requests I get the following errors im the joblog:
>
> MCH6903 - The heap space has reached its maximum allowable size"
> C2M1212 - The pointer parameter passed to free or realloc is not valid.
> CPF9897 - (GSKit) I/O: Unknown system status (my translation from German).
>
>
--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi


--

--
Richard la Croix
Software Engineering

 

richard.lacroix@xxxxxxxxxxx
T +41 41 767 81 53

 

Hapimag AG | Sumpfstrasse 18
6312 Steinhausen | Schweiz
www.hapimag.com
    
Eingetragen: Handelsregister des Kantons Zug, Firmennummer/UID: CHE-101.391.790,
MWST.-Nr.: CHE-101.391.790 MWST, CEO: Hassan Kadbi

-

P Please consider the environment before printing this email
 
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi