Hello all,

I've written a small WebDAV client, and in one of the tests, I upload a 9k
text file using a PUT request. I've written the request block provider
callbacks, which write data from a stringbuf to Neon's buffer (it's a C++
client).

So far, every test works just fine when compiling with MinGW, or on Linux,
but when compiling the client using Borland Developer Studio 2006 (sadly,
I'm forced to use it), somehow the request is cutoff: when I check back on
the server, the last 1k of the file seems to be missing. The missing 1k is
sent before the next request, obviously making it fail. I'm using an Apache
2.1 server with mod_dav. This is the only test that doesn't seem to work:
I've done PROPFINDs, DELETEs, all sorts of request except file locking.

Looking on the access.log, I get something like:

xxx.xxx.xxx.xxx - - [date] "s fixed you can use this workaround:" 400 346
"-" "-"

It looks like if Neon wasn't forcing the last 1k of the file to be sent, but
just waiting for the TCP buffer to be filled.

To get the DLL, I compiled Neon with these options:

./configure --prefix=/mingw --enable-ssl=openssl --enable-shared

Then I grabbed the src/.libs/libneon-26.dll, and used implib to generate the
import library:

implib -a -c -f libneon26-lib.dll borneon.lib

I'm compiling my project with 32 bits alignment, multithreading runtime
library, and console application support.

I've checked with the debugger my callback, and it's doing everything
properly (it's using a static wrapper). Normally, the sequence is 8192
bytes, then the rest, and then 0 bytes, just like the Neon docs say.

In any case, I've included the code below.

int Request::provideRequestBodyBlock(char *buf, size_t buflen)
{
  if (buflen == 0) {
    // Back to the beginning of the request body (we might have to send it
several times)
    requestBodyBuffer.pubseekpos(0);
    return 0;
  }

  // Read as many characters as we can
  int nbytesWritten = requestBodyBuffer.sgetn(buf, buflen);
#ifndef NDEBUG
  cout << "Provided " << nbytesWritten << " bytes to the request body" <<
endl;
#endif
  return nbytesWritten;
}

Does anyone have some sort of clue on what the problem could be? If you need
any more information, just ask.

Thanks,
Antonio
_______________________________________________
neon mailing list
[email protected]
http://mailman.webdav.org/mailman/listinfo/neon

Reply via email to