Ravi | 3 Apr 04:43 2013
Picon

could not resolve hostname with sabredav/php

Hi ,

I'm new to list and trying write a code to connect to a webdav 
(sabredav) with following path  - cloud.com/files/webdav.php. when 
ne_session_create invoked in complains can't resolve the DNS, but i can 
connect to webdav server using finder/cyberduck. and if i tried some 
other webdav servers like mydrive.ch  it works. So i think 
ne_session_create can't handle slashes (/files/webdav.php)......please 
help me out....

thanks,
rgds,
ravi

neon | 8 Feb 02:48 2013

Compiling on Windows 7 with MinGW

Hello.

I see several posts in the archive regarding compiling Neon with mingw, but they're all from quite some time
ago. Has this been attempted recently? When I run ./configure, after it runs its checks for a while I end up with:

configure: error: format string for off64_t not found

I'm using the version of mingw packaged with the Windows 32-bit version of the Qt 5 SDK. This is not a datatype
with which I'm familiar. I would appreciate any help!

Kyle

neon | 4 Feb 15:03 2013

Host Not Found Misunderstanding

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
p, li { white-space: pre-wrap; }
David Strauss | 18 Jan 01:06 2013
Picon

Memory leak in GnuTLS session management?

I keep getting memory leak traces for sessions in Valgrind, so I dug
into the Neon and GnuTLS code a bit.

Here's what I see:
 * ne_sock_connect_ssl() calls gnutls_session_get_data2() and sends in
&ctx->cache.client as the second argument.
 * gnutls_session_get_data2() allocates memory for what it puts into
its second argument. This memory should be freed by the caller using
gnutls_free(). This is documented in the man page [1].
 * There are only four calls to gnutls_free() from Neon, and they're
all for ctx->cache.server.key.data or ctx->cache.server.data.data.
 * I don't see any obvious way the ctx->cache.client pointer would get
copied into either of the values being freed.

It would break abstraction for us to access and free parts of the
context. Surely, session data shouldn't just linger. Multithreaded
clients (like ours) need to create and clean up sessions often without
leaking memory.

This is the trace I see in Valgrind for the packaged Neon 0.29.6 on Fedora 17:

3,072 bytes in 1 blocks are definitely lost in loss record 27 of 31
realloc (vg_replace_malloc.c:662)
_gnutls_buffer_append_data (gnutls_str.c:146)
_gnutls_session_pack (gnutls_session_pack.c:781)
gnutls_session_get_data2 (gnutls_session.c:119)
ne_sock_connect_ssl (ne_socket.c:1804)
ne__negotiate_ssl (ne_gnutls.c:928)
send_request.isra.5 (ne_request.c:1650)
ne_begin_request (ne_request.c:1189)
[...snip...]

[1] http://linux.die.net/man/3/gnutls_session_get_data2

--
David Strauss
   | david@...
   | +1 512 577 5827 [mobile]

kk kk | 10 Dec 09:25 2012
Picon

About ne_set_read_timeout

Dear all,


If i use ne_set_read_timeout to indicate timeout value, for example, ne_set_read_timeout(sess, 10); // about 10s.
How can i interrupt the READ operation before timeout?
For example, user wants to cancel the operation immediately.

Thanks!

Regards,
Kang
Markus Goetz | 6 Dec 17:55 2012

Decompression PROPFIND compressed with gzip?

Hello,

I'm trying to find a way to integrate ne_propfind_named with ne_decompress_reader.
How can my body reader feed back the decompressed bytes back into neon so it can parse the WebDAV XML and give me the PROPFIND results?

thanks,
Markus Goetz p, li { white-space: pre-wrap; }
Matthias Petschick | 22 Nov 12:40 2012
Picon

[PATCH] fix segfault due to unitialized variable

Hi,

x509_crt_copy in ne_gnutls.c depends on the local size variable being 0
(or small enough) so that the subsequent call to gnutls_x509_crt_export
updates the variable to the correct size to hold the certificate. Since
size is used unitialized, the value for it is undefined and more than
likely not 0, resulting in gnutls_x509_crt_export not returning
GNUTLS_E_SHORT_MEMORY_BUFFER and consequently x509_crt_copy returning NULL.
This is not caught by make_peers_chain which then passes the NULL
pointer to populate_cert, which eventually causes a segfault down the
road when NULL is dereferenced by get_dn in gnutls.

The attached patch makes sure size is initialized correctly to 0 and
checks if x509_crt_copy returns NULL.

Cheers,

Matthias

Attachment (ne_gnutls.c.patch): text/x-patch, 961 bytes
Chris Pick | 28 Oct 00:18 2012

Method to require SSL dependency

Is there an equivalent of NEON_NEED_XML_PARSER for SSL?
If I'm bundling neon with a program that uses ssl functionality, is
there any other way to require it?

My current setup:
$ cat configure.ac
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.62)
AC_INIT([test], [1.0], [neon@...])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_SRCDIR([src/test.c])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC

# Checks for libraries.
NEON_VPATH_BUNDLED([${srcdir}/neon-0.29.6], [neon-0.29.6], [
NEON_NORMAL_BUILD
])

# Checks for header files.
AC_CHECK_HEADERS([stdlib.h])

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

$ cat Makefile.am
bin_PROGRAMS = test
test_SOURCES = src/test.c
test_LDADD =  <at> NEON_LIBS <at> 

ACLOCAL_AMFLAGS = -I neon-0.29.6/macros

gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -I../neon-0.29.6 -MT test.o
-MD -MP -MF .deps/test.Tpo -c -o test.o `test -f 'src/test.c' || echo
'../'`src/test.c
../src/test.c:4:22: error: ne_alloc.h: No such file or directory

Mat Booth | 27 Oct 15:44 2012

Re: Hi , question about your post on mailing list

On 25 October 2012 10:48, Robert Gdula <robert.gdula@...> wrote:
> Hi, I've found on the mailing list, that you try to compile neon library
> with mingw32 on windows, maybe you have already compile library to share
> with me, I'm trying almost 2 days without success.
>
> Best regards,
>
> Robert Gdula

Indeed. Have you tried the patch that I sent to the mailing list? It
can be found here:

http://people.apache.org/~mbooth/01-mingw-macro.win.patch

I'm afraid I don't currently have access to a Windows machine to test
it on. These were the commands I issued to build it (cross-compiled to
mingw from within the cygwin environment):

./autogen.sh
# Need some configure "help" on Windows
echo "ne_cv_libsfor_RSA_new='-lcrypto'" >> config.cache
echo "ne_cv_libsfor_SSL_library_init='-lssl'" >> config.cache
echo "lt_cv_deplibs_check_method='pass_all'" >> config.cache
echo "ne_cv_fmt_off64_t=lld" >> config.cache
LDFLAGS="$LDFLAGS -lssl -lcrypto" \
  ./configure --enable-shared --with-expat --disable-nls \
  --with-ssl=openssl --with-zlib --without-gssapi \
  -C --host=i686-pc-mingw32

This assumes of course that you already have zlib, expat and openssl
build and available.

Please send future messages to the mailing list, so that everyone can
see our conversation :-)

--

-- 
Mat Booth
Software Engineer
WANdisco, Inc.
http://www.wandisco.com

Marco Maggi | 30 Sep 08:35 2012
Picon

wrong return value in ne_set_request_body_fd documentation

The    manual    page    says   the    return    value    of
"ne_set_request_body_fd()"  is  "int",   but  it  is  "void"
instead.
--

-- 
Marco Maggi

Marco Maggi | 30 Sep 08:50 2012
Picon

on the status of the documentation

Ciao,

  I see that there are a number of undocumented functions in
the header files; can someone  tell me the current status of
the  documentation?    Should  the  undocumented   funcs  be
documented?  Manpages and XML?  Manpages or XML?

TIA
--

-- 
Marco Maggi


Gmane