@@ -336,6 +336,33 @@ static int lcurl_easy_set_SHARE(lua_State *L){
336336 lua_settop (L , 1 );
337337 return 1 ;
338338}
339+
340+ #if LCURL_CURL_VER_GE (7 ,46 ,0 )
341+
342+ static int lcurl_easy_set_STREAM_DEPENDS_impl (lua_State * L , int opt ){
343+ lcurl_easy_t * p = lcurl_geteasy (L );
344+ lcurl_easy_t * e = lcurl_geteasy_at (L , 2 );
345+ CURLcode code = curl_easy_setopt (p -> curl , opt , e -> curl );
346+ if (code != CURLE_OK ){
347+ return lcurl_fail_ex (L , p -> err_mode , LCURL_ERROR_EASY , code );
348+ }
349+
350+ lcurl_storage_preserve_iv (L , p -> storage , opt , 2 );
351+
352+ lua_settop (L , 1 );
353+ return 1 ;
354+ }
355+
356+ static int lcurl_easy_set_STREAM_DEPENDS (lua_State * L ){
357+ return lcurl_easy_set_STREAM_DEPENDS_impl (L , CURLOPT_STREAM_DEPENDS );
358+ }
359+
360+ static int lcurl_easy_set_STREAM_DEPENDS_E (lua_State * L ){
361+ return lcurl_easy_set_STREAM_DEPENDS_impl (L , CURLOPT_STREAM_DEPENDS_E );
362+ }
363+
364+ #endif
365+
339366//}
340367
341368//{ unset
@@ -522,6 +549,38 @@ static int lcurl_easy_unset_POSTFIELDS(lua_State *L){
522549 return 1 ;
523550}
524551
552+ #if LCURL_CURL_VER_GE (7 ,46 ,0 )
553+
554+ static int lcurl_easy_unset_STREAM_DEPENDS (lua_State * L ){
555+ lcurl_easy_t * p = lcurl_geteasy (L );
556+
557+ CURLcode code = curl_easy_setopt (p -> curl , CURLOPT_STREAM_DEPENDS , NULL );
558+ if (code != CURLE_OK ){
559+ return lcurl_fail_ex (L , p -> err_mode , LCURL_ERROR_EASY , code );
560+ }
561+
562+ lcurl_storage_remove_i (L , p -> storage , CURLOPT_STREAM_DEPENDS );
563+
564+ lua_settop (L , 1 );
565+ return 1 ;
566+ }
567+
568+ static int lcurl_easy_unset_STREAM_DEPENDS_E (lua_State * L ){
569+ lcurl_easy_t * p = lcurl_geteasy (L );
570+
571+ CURLcode code = curl_easy_setopt (p -> curl , CURLOPT_STREAM_DEPENDS_E , NULL );
572+ if (code != CURLE_OK ){
573+ return lcurl_fail_ex (L , p -> err_mode , LCURL_ERROR_EASY , code );
574+ }
575+
576+ lcurl_storage_remove_i (L , p -> storage , CURLOPT_STREAM_DEPENDS_E );
577+
578+ lua_settop (L , 1 );
579+ return 1 ;
580+ }
581+
582+ #endif
583+
525584//}
526585
527586//}
@@ -907,6 +966,10 @@ static int lcurl_easy_setopt(lua_State *L){
907966 OPT_ENTRY (readfunction , READFUNCTION , TTT , 0 , 0 )
908967 OPT_ENTRY (headerfunction , HEADERFUNCTION , TTT , 0 , 0 )
909968 OPT_ENTRY (progressfunction , PROGRESSFUNCTION , TTT , 0 , 0 )
969+ #if LCURL_CURL_VER_GE (7 ,46 ,0 )
970+ OPT_ENTRY (stream_depends , STREAM_DEPENDS , TTT , 0 , 0 )
971+ OPT_ENTRY (stream_depends_e , STREAM_DEPENDS_E , TTT , 0 , 0 )
972+ #endif
910973 }
911974#undef OPT_ENTRY
912975
@@ -930,6 +993,10 @@ static int lcurl_easy_unsetopt(lua_State *L){
930993 OPT_ENTRY (readfunction , READFUNCTION , TTT , 0 , 0 )
931994 OPT_ENTRY (headerfunction , HEADERFUNCTION , TTT , 0 , 0 )
932995 OPT_ENTRY (progressfunction , PROGRESSFUNCTION , TTT , 0 , 0 )
996+ #if LCURL_CURL_VER_GE (7 ,46 ,0 )
997+ OPT_ENTRY (stream_depends , STREAM_DEPENDS , TTT , 0 , 0 )
998+ OPT_ENTRY (stream_depends_e , STREAM_DEPENDS_E , TTT , 0 , 0 )
999+ #endif
9331000 }
9341001#undef OPT_ENTRY
9351002
@@ -990,6 +1057,10 @@ static const struct luaL_Reg lcurl_easy_methods[] = {
9901057 OPT_ENTRY (readfunction , READFUNCTION , TTT , 0 , 0 )
9911058 OPT_ENTRY (headerfunction , HEADERFUNCTION , TTT , 0 , 0 )
9921059 OPT_ENTRY (progressfunction , PROGRESSFUNCTION , TTT , 0 , 0 )
1060+ #if LCURL_CURL_VER_GE (7 ,46 ,0 )
1061+ OPT_ENTRY (stream_depends , STREAM_DEPENDS , TTT , 0 , 0 )
1062+ OPT_ENTRY (stream_depends_e , STREAM_DEPENDS_E , TTT , 0 , 0 )
1063+ #endif
9931064#undef OPT_ENTRY
9941065
9951066#define OPT_ENTRY (L , N , T , S , D ) { "unsetopt_" #L , lcurl_easy_unset_ ##N },
@@ -1001,6 +1072,10 @@ static const struct luaL_Reg lcurl_easy_methods[] = {
10011072 OPT_ENTRY (readfunction , READFUNCTION , TTT , 0 , 0 )
10021073 OPT_ENTRY (headerfunction , HEADERFUNCTION , TTT , 0 , 0 )
10031074 OPT_ENTRY (progressfunction , PROGRESSFUNCTION , TTT , 0 , 0 )
1075+ #if LCURL_CURL_VER_GE (7 ,46 ,0 )
1076+ OPT_ENTRY (stream_depends , STREAM_DEPENDS , TTT , 0 , 0 )
1077+ OPT_ENTRY (stream_depends_e , STREAM_DEPENDS_E , TTT , 0 , 0 )
1078+ #endif
10041079#undef OPT_ENTRY
10051080
10061081#define OPT_ENTRY (L , N , T , S ) { "getinfo_" #L , lcurl_easy_get_ ##N },
@@ -1036,6 +1111,10 @@ static const lcurl_const_t lcurl_easy_opt[] = {
10361111 OPT_ENTRY (readfunction , READFUNCTION , TTT , 0 , 0 )
10371112 OPT_ENTRY (headerfunction , HEADERFUNCTION , TTT , 0 , 0 )
10381113 OPT_ENTRY (progressfunction , PROGRESSFUNCTION , TTT , 0 , 0 )
1114+ #if LCURL_CURL_VER_GE (7 ,46 ,0 )
1115+ OPT_ENTRY (stream_depends , STREAM_DEPENDS , TTT , 0 , 0 )
1116+ OPT_ENTRY (stream_depends_e , STREAM_DEPENDS_E , TTT , 0 , 0 )
1117+ #endif
10391118#undef OPT_ENTRY
10401119#undef FLG_ENTRY
10411120
0 commit comments