]> asedeno.scripts.mit.edu Git - git.git/blobdiff - http.c
docs/checkout: clarify what "non-branch" means
[git.git] / http.c
diff --git a/http.c b/http.c
index b8f947e405fa95cdd422e67637b4f816354cf808..2e3d6493ef40e1b34fea8d166d760f0b1fcccafc 100644 (file)
--- a/http.c
+++ b/http.c
@@ -44,6 +44,25 @@ size_t fread_buffer(void *ptr, size_t eltsize, size_t nmemb, void *buffer_)
        return size;
 }
 
+#ifndef NO_CURL_IOCTL
+curlioerr ioctl_buffer(CURL *handle, int cmd, void *clientp)
+{
+       struct buffer *buffer = clientp;
+
+       switch (cmd) {
+       case CURLIOCMD_NOP:
+               return CURLIOE_OK;
+
+       case CURLIOCMD_RESTARTREAD:
+               buffer->posn = 0;
+               return CURLIOE_OK;
+
+       default:
+               return CURLIOE_UNKNOWNCMD;
+       }
+}
+#endif
+
 size_t fwrite_buffer(const void *ptr, size_t eltsize, size_t nmemb, void *buffer_)
 {
        size_t size = eltsize * nmemb;
@@ -138,9 +157,7 @@ static int http_options(const char *var, const char *value, void *cb)
 
 static void init_curl_http_auth(CURL *result)
 {
-       if (!user_name)
-               curl_easy_setopt(result, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
-       else {
+       if (user_name) {
                struct strbuf up = STRBUF_INIT;
                if (!user_pass)
                        user_pass = xstrdup(getpass("Password: "));