File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 2424#include "lcerror.h"
2525#include "lcutils.h"
2626#include "lchttppost.h"
27+ #include <stdio.h>
2728
2829#define LCURL_MULTI_NAME LCURL_PREFIX" Multi"
2930static const char * LCURL_MULTI = LCURL_MULTI_NAME ;
@@ -433,24 +434,29 @@ static int lcurl_opt_set_string_array_(lua_State *L, int opt){
433434 n = lua_rawlen (L , 2 );
434435 }
435436
437+ fprintf (stderr , "\n>>> array size %d\n" , n );
438+
436439 if (n == 0 ){
437440 code = curl_multi_setopt (p -> curl , opt , 0 );
438441 }
439442 else {
440443 int i ;
441444 char const * * val = malloc (sizeof (char * ) * (n + 1 ));
445+ fprintf (stderr , ">>> allocate size %d: %p\n" , sizeof (char * ) * (n + 1 ), val );
442446 if (!* val ){
443447 return lcurl_fail_ex (L , p -> err_mode , LCURL_ERROR_MULTI , CURLM_OUT_OF_MEMORY );
444448 }
445449 for (i = 1 ; i <= n ; ++ i ){
446450 lua_rawgeti (L , 2 , i );
451+ fprintf (stderr , ">>> add string %s\n" , lua_tostring (L , -1 ));
447452 val [i - 1 ] = lua_tostring (L , -1 );
448453 lua_pop (L , 1 );
449454 }
450455 val [n ] = NULL ;
451456 code = curl_multi_setopt (p -> curl , opt , val );
452457 free ((void * )val );
453458 }
459+ fprintf (stderr , ">>> setopt result %d\n" , code );
454460
455461 if (code != CURLM_OK ){
456462 return lcurl_fail_ex (L , p -> err_mode , LCURL_ERROR_MULTI , code );
You can’t perform that action at this time.
0 commit comments