tests: update sav/test_parser* because AST changes
[nit.git] / lib / curl / native_curl.nit
index cc6f298..8fc9ccb 100644 (file)
@@ -17,8 +17,8 @@
 # Binding of C libCurl which allow us to interact with network.
 module native_curl is pkgconfig "libcurl"
 
-intrude import standard::file
-import standard
+intrude import core::file
+import core
 
 in "C header" `{
        #include <curl/curl.h>
@@ -342,6 +342,7 @@ redef class Collection[E]
                assert collectionItemType: self isa Collection[String] else
                        print "Collection item must be strings."
                end
+               if is_empty then return new CURLSList
                var primList = new CURLSList.with_str(self.first)
                var is_first = true
                for s in self do
@@ -696,8 +697,12 @@ extern class CURLOption `{ CURLoption `}
 
        # Connection Options
 
-#      new     `{ return CURLOPT_TIMEOUT; `}
-#      new     `{ return CURLOPT_TIMEOUT_MS; `}
+       # Set maximum time the request is allowed to take.
+       new     timeout `{ return CURLOPT_TIMEOUT; `}
+
+       # Set maximum time the request is allowed to take (in ms).
+       new     timeout_ms `{ return CURLOPT_TIMEOUT_MS; `}
+
 #      new     `{ return CURLOPT_LOW_SPEED_LIMIT; `}
 #      new     `{ return CURLOPT_LOW_SPEED_TIME; `}
 #      new     `{ return CURLOPT_MAX_SEND_SPEED_LARGE; `}