Host Not Found Misunderstanding

Henrik Holst henrik.holst at millistream.com
Mon Feb 4 09:45:25 EST 2013


Hi,

  ne_session_create() wants the hostname and not the url.

/hh
Den 4 feb 2013 15:05 skrev <neon at status.e4ward.com>:

>  Hello. I've followed the simple example shown here:
> http://www.ikeepincloud.com/en/c_library .
>
> A snippet of relevant code:
>
> void testNeon()
> {
>     char *url = "my_owncloud_instance_url/remote.php/webdav";
>
>     ne_session *dav;
>     int res, fd;
>
>     ne_sock_init();
>
>     dav = ne_session_create("http", url, 80);
>
>     ne_set_server_auth(dav, define_auth, NULL);
>
>     res = ne_mkcol(dav, "/test/");
>
>     if (res != NE_OK)
>     {
>         qDebug() << "Request failed:" << QString(ne_get_error(dav));
>     }
>     else
>     {
>         qDebug() << "Success!";
>     }
> }
>
> static int define_auth(void *userdata, const char *realm, int attempts,
> char *username, char *password)
> {
>     char *user = "username";
>     char *pass = "userpassword";
>
>     strncpy(username, user, NE_ABUFSIZ);
>     strncpy(password, pass, NE_ABUFSIZ);
>
>     return attempts;
> }
>
>
> This prints out "Request failed: Could not resolve hostname
> 'my_owncloud_instance_url/remote.php/webdav': Host not found"
>
> When my visit the URL in question in firefox (actually copying the url
> posted in the error), it prompts me for my username and password. This
> implies to me that it's working. Am I missing something? I would appreciate
> any help!
>
> Kyle Fazzari
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.manyfish.co.uk/pipermail/neon/attachments/20130204/c06cd8d3/attachment.html 


More information about the neon mailing list