@@ -32,7 +32,6 @@ Lua-cURLv2 binding has several problems:
3232* it has memory leak when send multipart/formdata
3333* it does not save string for curl options that may result crush in libcurl
3434* there no way to get result for operations in multi interface (e.g. if one of easy operation fail you can not get result code/error message)
35- * you can not use multi interface for upload operation (?)
3635* you can not use your own callback function to perform operation with multi interface
3736* you can not pass your context to callback functions
3837
@@ -62,7 +61,7 @@ curl.easy()
6261curl .easy ()
6362 :setopt_url (' http://posttestserver.com/post.php' )
6463 :setopt_writefunction (io.write )
65- :setopt_httppost (curl .form () -- lcurl guarantee that form will be alive
64+ :setopt_httppost (curl .form () -- Lua-cURL guarantee that form will be alive
6665 :add_content (" test_content" , " some data" , {
6766 " MyHeader: SomeValue"
6867 })
@@ -101,16 +100,12 @@ curl.easy()
101100-- Multi FTP Upload
102101
103102-- We get error E_LOGIN_DENIED for this operation
104- e1 = curl .easy ()
105- :setopt_url (" ftp://moteus:999999@127.0.0.1/test1.dat" )
106- :setopt_upload (true )
103+ e1 = curl .easy {url = " ftp://moteus:999999@127.0.0.1/test1.dat" , upload = true }
107104 :setopt_readfunction (
108105 function (t ) return table.remove (t ) end , {" 1111" , " 2222" }
109106 )
110107
111- e2 = curl .easy ()
112- :setopt_url (" ftp://moteus:123456@127.0.0.1/test2.dat" )
113- :setopt_upload (true )
108+ e2 = curl .easy {url = " ftp://moteus:123456@127.0.0.1/test2.dat" , upload = true }
114109 :setopt_readfunction (get_bin_by ((" e" ):rep (1000 ), 5 ))
115110
116111m = curl .multi ()
0 commit comments