Page 1 of 2

wxCURL

Posted: Thu Sep 16, 2004 12:50 pm
by caseyodonnell
I just wanted to put some comments in here for people interested in using wxCURL. This may actually be the beginning of a READ ME. :)

A.) Use the CVS and not .ZIP version posted on the site. CVS will be updated a lot more often. I'll try to put a new version of the .ZIP up soon.

B.) I'm going to switch over the MSW workspace to use environment variables rather than relational-coded paths. I'll do this for both CURL and WXWIDGETS...I'll document these issues shortly.

C.) ...RAN OUT OF TIME... I'll finish up adding to this later. Please feel free to use this topic to ask questions though. And I will respond. I've added a notification check-mark, so I will pay attention.

Cheers.
Casey

Trying to bring discussion in here...

Posted: Thu Sep 16, 2004 2:07 pm
by caseyodonnell
Ryan Wilcox wrote:
achim wrote:
Ryan Wilcox wrote: VC and XCode. I thought about putting a bakefile together (and I need DevCpp support as well). Maybe I'll have some time later this week...
the comments are shurely adequate,
but a short documentation, or a READ ME would be very fine.
Good point. For now the sample app helps a little. For the longer term, I don't know - maybe DoXgen (since it's common), or HeaderDoc (which I personally like, but it's not-common), or take a page from wxWidgets and do it in latex.

Contributions (esp in the form of documentation, or samples) is very welcome :-)
I like the latex approach, though it takes a bit more effort. Fortunately it would be easier to produce several kinds of documentation. It is definitely on the list of things to do...

Since it started as a personal project, I'm a bit behind on making it more usable.

Posted: Fri Sep 17, 2004 10:32 am
by achim
hi,

working myself into wxCURL right now, and without any warranty,
I can offer my results as a kind of predocumentation, so maybe you
need not to write down everthing...

If you would like to use my flowings, we should talk about the form:
I'd propose just text, cause there are no formating problems,
and you can paste it together...

If, shure you did, you already started, tell me where you did,
and maybe in which direction (no need to do doubble)

cheers
achim

Posted: Fri Sep 17, 2004 1:50 pm
by Ryan Wilcox
working myself into wxCURL right now, and without any warranty,
I can offer my results as a kind of predocumentation, so maybe you
need not to write down everthing...
I'd be interesting in seeing them. Maybe we could use that as a springboard to a GettingStarted bit of documentation or something.

Get them to me - I'll wrap them in latex nice and pretty, make some additions of my own, and commit them to wxCurl CVS.

Posted: Fri Sep 17, 2004 2:04 pm
by caseyodonnell
You both rule. :)
Ryan Wilcox wrote:
working myself into wxCURL right now, and without any warranty,
I can offer my results as a kind of predocumentation, so maybe you
need not to write down everthing...
I'd be interesting in seeing them. Maybe we could use that as a springboard to a GettingStarted bit of documentation or something.

Get them to me - I'll wrap them in latex nice and pretty, make some additions of my own, and commit them to wxCurl CVS.

Posted: Fri Sep 17, 2004 5:44 pm
by achim
hi,

sorry, but got unfortunaly a problem to get it running:
Tried as a hint including the wxCure-cpp-files in my project, and fetched the dll:
[syntax="c"]
wxDynamicLibrary *p_libcurl = new wxDynamicLibrary("libcurl"); // debug-version
[/syntax]

This seems to work (p_libcurl->IsLoaded() is true), but get lots linking-errors!

Experimenting still with the dll...(wxDYNLIB_FUNCTION?)

Think of need it running before documenting anything :(

How about the makefile.gcc ?

solong
achim

Posted: Fri Sep 17, 2004 6:47 pm
by caseyodonnell
Don't know quite what you're up to...you shouldn't need to load the DLL up. You just compile libcurl as a DLL. The compile wxCurl as a static library (the only way it builds). Then you link your application against wxCurl and libcurl.

Make sure you have the libcurl DLL in the directory with your app and voila...

No need to load the DLL or anything. At least wxCurl isn't designed to work that way. Look at the included sample app. If you have to, open up the .dsp in a text editor. You'll notice that it links against a .lib for libcurl and a .lib for wxcurl. This means that you'll have the stub libcurl code in your app...which loads up the DLL for you.

Let me know what OS/Compiler/Dir Structure you're using, just so I have a fair idea of where you are coming from.

Hanging out on these forums is distracting...must close them. Maybe then I'd get some work done on a READ ME. ;)

Cheers.
achim wrote: [syntax="c"]
wxDynamicLibrary *p_libcurl = new wxDynamicLibrary("libcurl"); // debug-version
[/syntax]

Posted: Mon Sep 20, 2004 1:21 pm
by Ryan Wilcox
achim wrote:hi,

sorry, but got unfortunaly a problem to get it running:
Tried as a hint including the wxCure-cpp-files in my project
If you're going the "include all the files I need in my project file" route, as opposed to the DLL/Library route, you will also need to include all the libcurl sources in your project file as well.

If you can, I suggest going the DLL/Library way... but I know that the XCode targets for the sample app (for wxCurl) have one target where there are wxcurl sources + libcurl sources + app sources. (Another target goes the Framework route - basically the Mac version of a DLL.)

Posted: Mon Sep 20, 2004 2:48 pm
by achim
hi,

got it running so far, but get segmentationfaults...
tell you more on wednesday, have to work now...

solong
achim

Posted: Thu Sep 23, 2004 3:21 pm
by achim
hi,

got it running, and with the new zip-version, got no segmentationfaults anymore :D
Wrote a little bit for wxCurlBase.
Need to know where to send it, can you please send me a pm (Private Message) with an email in it, where I can send it to?
Guess it makes no sense to post/paste it here.

cheers
achim

Posted: Fri Sep 24, 2004 1:55 pm
by achim
hi again,

hope you could use the doc start...
But there is still another problem about the authentication for a pwd-protected web-area (NT-authentification, SP 6 I guess).
This don't work by creating the wxCurlHTTP object like this
[syntax="c"]
m_p_HTTP = new wxCurlHTTP(url_path,
m_dmlgnu,
m_dmlgnp);
[/syntax]

while m_dmlgnu and m_dmlgnp containing valid user-data for login, and m_p_HTTP->m_szUsername and m_p_HTTP->m_szPassword are set to these valid data.
The Get(wxOutputStream& buffer, const wxString& szRemoteFile /*=wxEmptyString*/) methode fails in
[syntax="c"]
if(m_pCURL && buffer.IsOk()) // line 279, http.cpp
[/syntax]
because !buffer.IsOk(): buffer.<wxStreamBase> => m_lasterror = wxSTREAM_WRITE_ERROR.

EDIT:
tested meanwhile m_p_HTTP->SetOpt(CURLOPT_HTTPAUTH, value)
value = CURLAUTH_ANYSAFE => same error
value = CURLAUTH_ANY => same error
value = CURLAUTH_NTLM => CURLE_FAILED_INIT
value = CURLAUTH_DIGEST => same error
value = CURLAUTH_GSSNEGOTIATE => CURLE_FAILED_INIT
value = CURLAUTH_BASIC (default) => same error
/EDIT

Any other ideas?

cheers
Achim

Posted: Fri Sep 24, 2004 5:16 pm
by Ryan Wilcox
achim wrote:hi again,

hope you could use the doc start...
But there is still another problem about the authentication for a pwd-protected web-area (NT-authentification, SP 6 I guess).

cheers
Achim
Can you turn on verbose output?

Code: Select all


wxString verbString;

m_p_HTTP->Verbose(true);

// ... do your stuff here

verbString = m_p_HTTP->GetVerboseString();
then display verbString somehow.

verbString will display what's happening in the libcurl internals, and maybe shed some light on the issue.

Posted: Sat Sep 25, 2004 1:45 pm
by achim
Hi Ryan,

thanx so far, but unfortunaly I don't know, what the verbose string
"\230

Posted: Sat Sep 25, 2004 4:42 pm
by Ryan Wilcox
[quote="achim"]Hi Ryan,

thanx so far, but unfortunaly I don't know, what the verbose string
"\230

Posted: Mon Oct 11, 2004 5:59 am
by caseyodonnell
The current version of curl that I include is not compiled with SSL. If you want SSL, all you need to do is follow the directions included with Libcurl to compile a DLL with SSL. Because we haven't explicitly added SSL methods to wxCurl, I haven't built it this way. There are a ton of compile options, and trying to support all of them is a big task (multiply wxWidgets compile options times libcurl compile options times OpenSSL compile options times libexpat options times zlib options...big number). Instead I've opted to support one libcurl setup (which will soon hopefully include one OpenSSL setup), and assume that the user can modify this as they see fit.
achim wrote: Guess the problem is the CURLOPT_HTTPAUTH optionsetting with value = CURLAUTH_NTLM,
the optionsetting fails ( res in wxCurlBase::SetOpt(CURLoption option, ...) got the value CURLE_FAILED_INIT ).

Think there might be a correlation with the used libcurl.dll
(see curlopt.txt|101: NOTE that you need to build libcurl with SSL support for this option to work.)
Not yet, I've asked people for what SSL API they would like, but have recieved minimal feedback. I was unaware that CURLAUTH_NTLM requires OpenSSL. In all honesty, I'm probably going to stop including DLL's with wxCurl, because it's pretty cumbersome. Compiling libcurl is a necessary step to getting wxCurl working anyway.
achim wrote: So, I use the libcurl.dll shiped with new zip-version, has it been built with SSL support?
I don't know why you would need or want curl-cpp in your project. Unless you're using that API (which is reasonably out-dated, and does some weird cookie handling that is already handled more effectively (and safer) within libcurl.) instead of wxCurl.
achim wrote: Got it running by including the Curl-cpp files in my project, and linking against libcurl.dll.
But maybe it might be necessary to build the wxCurl static lib myself, but got no idea how to do this, not to mention to build libcurl.dll
Because there are so many differen't build options, it's tough for us to cover every possible build configuration. I'm certainly welcome to people helping out with that.

Take a look at libcurl's read-me files for how to compile libcurl with different options. wxCurl already builds to a static library, but it uses libcurl as a DLL. So many options, too little time. If you have a specific request (ie. libcurl static, openssl static, wxcurl static) let us know and we'll try to help out. Sorry for the slow reply.