New push punctions
Since there are 2 new functions, should'nt the SONAME be bumped ? --- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
Re: New push punctions
On 20 July 2015 at 14:10, Patrick Monnerat patrick.monne...@datasphere.ch wrote: Since there are 2 new functions, should'nt the SONAME be bumped ? No. Programs using an old libcurl version will continue working with the latest version... so the soname stays the same. If libcurl would use symbol versioning the way glibc does, curl_multi_setopt would get a new version, but that's it. --- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
RE: New push punctions
Cristian Morales Vega wrote: Since there are 2 new functions, should'nt the SONAME be bumped ? No. Programs using an old libcurl version will continue working with the latest version... so the soname stays the same. If libcurl would use symbol versioning the way glibc does, curl_multi_setopt would get a new version, but that's it. I do not agree: Rule no 2 applies (lib/Makefile.am, line 96: if interfaces were added use C+1:0:A+1). So version info should be set as: if SONAME_BUMP VERSIONINFO=-version-info 9:0:4 else VERSIONINFO=-version-info 8:0:4 Endif This won't change the final SONAME on platforms which support what you described, because they use C-A for SONAME. But others (i.e.: iSeries) will bump (they use C alone). --- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
Patch: No special error handling for Content-Encoding: compress
Hi, Currently, libcurl rejects responses with Content-Encoding: compress when CURLOPT_ACCEPT_ENCODING is set to . I think that libcurl should treat the Content-Encoding compress the same as other Content-Encodings that it does not support, e.g. bzip2. I have attached a patch for this. Regards, Michael diff --git a/lib/http.c b/lib/http.c index b9e8047..a1eef81 100644 --- a/lib/http.c +++ b/lib/http.c @@ -3582,14 +3582,6 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data, k-auto_decoding = GZIP; start += 6; } -else if(checkprefix(compress, start)) { - k-auto_decoding = COMPRESS; - start += 8; -} -else if(checkprefix(x-compress, start)) { - k-auto_decoding = COMPRESS; - start += 10; -} else /* unknown! */ break; @@ -3622,9 +3614,6 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data, else if(checkprefix(gzip, start) || checkprefix(x-gzip, start)) k-auto_decoding = GZIP; - else if(checkprefix(compress, start) - || checkprefix(x-compress, start)) -k-auto_decoding = COMPRESS; } else if(checkprefix(Content-Range:, k-p)) { /* Content-Range: bytes [num]- diff --git a/lib/http_chunks.c b/lib/http_chunks.c index 80c0f95..7e91b37 100644 --- a/lib/http_chunks.c +++ b/lib/http_chunks.c @@ -218,7 +218,6 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn, (ssize_t)piece); break; - case COMPRESS: default: failf (conn-data, Unrecognized content encoding type. diff --git a/lib/transfer.c b/lib/transfer.c index 32e8702..718139b 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -756,7 +756,6 @@ static CURLcode readwrite_data(struct SessionHandle *data, result = Curl_unencode_gzip_write(conn, k, nread); break; - case COMPRESS: default: failf (data, Unrecognized content encoding type. libcurl understands `identity', `deflate' and `gzip' diff --git a/lib/urldata.h b/lib/urldata.h index 0655922..b1c2056 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -660,7 +660,6 @@ struct SingleRequest { #define IDENTITY 0 /* No encoding */ #define DEFLATE 1 /* zlib deflate [RFC 1950 1951] */ #define GZIP 2 /* gzip algorithm [RFC 1952] */ -#define COMPRESS 3 /* Not handled, added for completeness */ #ifdef HAVE_LIBZ zlibInitState zlib_init; /* possible zlib init state; --- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
RE: New push functions
Kamil Dudka wrote: This won't change the final SONAME on platforms which support what you described, because they use C-A for SONAME. But others (i.e.: iSeries) will bump (they use C alone). What is the actual motivation to do so? If applications and other libraries are built against the old version of libcurl, will they have to be rebuilt to load the new version of libcurl just because of the SONAME bump? The same discussion occurs each time there is some reason to change VERSIONINFO. The answer is: an soname bump always causes the linked programs to be rebuilt. However, we must talk about VERSIONINFO bump rather than SONAME bump (my bad). In short (for symbol addition only): - Many OS deals with symbol names: in this case, the order in the table may even change without impact -- no need to change the SONAME. - Some other OS use position in table: as long as you don't change the symbol order in the table, there's still no need to change the SONAME if you only add new symbols to the end of the table. - Finally, some other OS have a symbol table signature that is copied to the calling binary program at link time, and that must match at execution time. In this case, any change to the symbol table should be reflected by an SONAME change. The three rules for changing VERSIONINFO accomodates this OS dependency: - OS that do not need a SONAME change on symbol addition uses C-A as the soname value: since C and A are both bumped by 1 on addition only. If a deletion occurs, A is cleared and the soname bump occurs. - The other OS use C alone, which is bumped on any symbol table change. As a result, on linux, the soname is currently 4. On iseries, it is 8. On each platform, soname is monotonically increasing, but this is more often on iSeries. As a consequence, a linux soname may skip many numbers when an soname bump is really needed (i.e.: when a symbol is deleted). If a symbol was deleted just now, VERSIONINFO should be set to 9:0:0 (from 8:0:3), so the soname will jump from 4 to 9 on linux and from 8 to 9 on iSeries... I have never seen an OS that uses the R part of the VERSIONINFO. :-) --- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
Re: New push punctions
On Monday 20 July 2015 16:44:48 Patrick Monnerat wrote: Cristian Morales Vega wrote: Since there are 2 new functions, should'nt the SONAME be bumped ? No. Programs using an old libcurl version will continue working with the latest version... so the soname stays the same. If libcurl would use symbol versioning the way glibc does, curl_multi_setopt would get a new version, but that's it. I do not agree: Rule no 2 applies (lib/Makefile.am, line 96: if interfaces were added use C+1:0:A+1). So version info should be set as: if SONAME_BUMP VERSIONINFO=-version-info 9:0:4 else VERSIONINFO=-version-info 8:0:4 Endif This won't change the final SONAME on platforms which support what you described, because they use C-A for SONAME. But others (i.e.: iSeries) will bump (they use C alone). What is the actual motivation to do so? If applications and other libraries are built against the old version of libcurl, will they have to be rebuilt to load the new version of libcurl just because of the SONAME bump? Kamil --- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
RE: CURL custom POST commands
On 7/17/2015 2:40 PM, Fitzgerald, Kevin wrote: Thank you for the example. But I think I am not going about this correctly. What I actually need to be able to do is connect to a web service (which it appears I am able to do), and send it a POST request. Below is an example of the request that I am sending. I think I really just need a curl option that will simply send the request to the web service. Any thoughts, can this be done (I’m hoping!)? Again, thanks. POST /licensecertificationext/service/licensecertification.asmx HTTP/1.1 Host: acc.dwd.wisconsin.gov Connection: keep-alive Authorization: Basic – an encrypted username and password here Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Content-Type: text/xml; charset=utf-8 Content-Length: 767 SOAPAction:http://workweb.dwd.state.wi.us/KIDS/LicenseCertification/Service/checkCertifications;http://workweb.dwd.state.wi.us/KIDS/LicenseCertification/Service/checkCertifications Please don't top post it makes the conversation harder to follow. This is what it would look like, all one line: curl -u user:pass --data-binary @soapreq.xml -H Content-Type: text/xml; charset=utf-8 -H SOAPAction: \https://workweb.dwd.state.wi.us/KIDS/LicenseCertification/Service/checkCertifications\;https://workweb.dwd.state.wi.us/KIDS/LicenseCertification/Service/checkCertifications/ https://acc.dwd.wisconsin.gov/licensecertificationext/service/licensecertification.asmx Put your XML in soapreq.xml. Note I changed both urls to https, which I strongly recommend you use for something like this if it's accepted, even if it's not yet mandatory. In the XML I'd change the 'checkCertifications xmlns' url to https as well. Sorry about the top posting. Thanks for this, but it looks like a command line request. What I need to do is send my POST within a C program in a UNIX environment. I was not clear on that. I guess what need to be able to do using the CURL commands in C, is set up an HTTP socket that allows me to send the custom request to the web service and receive a response. I have tried different things but CURL is creating its own POST command that is rejected by the web service as unauthorized (401), because it is password protected, so the web service never actually sees my custom POST request. What I am looking for is an example of a C program that does something like what I am trying to do, as I am new to CURL and am trying to figure things out on the fly. Thanks, Kevin --- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
RE: CURL custom POST commands
Fitzgerald, Kevin wrote: curl -u user:pass --data-binary @soapreq.xml -H Content-Type: text/xml; charset=utf-8 -H SOAPAction: \https://workweb.dwd.state.wi.us/KIDS/LicenseCertification/Service/chec kCertifications\ https://workweb.dwd.state.wi.us/KIDS/LicenseCertification/Service/check Certifications/ https://acc.dwd.wisconsin.gov/licensecertificationext/service/licensecer tification.asmx Thanks for this, but it looks like a command line request. What I need to do is send my POST within a C program in a UNIX environment. If you add --libcurl skeleton.c to a curl command, it generates a C skeleton for the request into the given file name (skeleton.c): you have to edit and adjust it afterwards. This works for any curl command line. --- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
Re: Issue with the line feed character
Hello, Yes, I do realize that the URL cannot contain a line feed character (hence the error I’m having). I’ve already made changes to read the file without the LF character, but I wanted to ask here (actually on the curlpp mailing list) for an option to ignore this character. Anyway, I’ve fixed it and I managed to learn a lot about curlpp and libcurl in the process, so I wouldn’t call this a total loss. Thanks again for taking interest in my issue and I’m sorry for posting my question to the wrong mailing list! Best regards, Tiago Cerqueira PS: Just out of curiosity, do you (or anyone) has any ideas on why the error is only happening on certain systems, with the same version of the library? No dia 19/07/2015, às 23:27, Daniel Stenberg dan...@haxx.se escreveu: On Mon, 13 Jul 2015, Tiago Cerqueira (1090678) wrote: I've narrowed down the URL problem to a variable that is being read from a config file (one line, it just contains the information needed). I was wondering if there is an option to force curlpp to ignore the line feed character. This is not the list for curlpp but for libcurl, and no there's no such option. But since you write the code that reads the URL from the file, why don't you just strip it off before you pass the URL to libcurl? A URL cannot legally contain a line feed character anyway and it is a mistake on your part to include it to begin with! -- / daniel.haxx.se --- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html --- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
Re: Issue with the line feed character
On Mon, 20 Jul 2015, Tiago Cerqueira (1090678) wrote: Yes, I do realize that the URL cannot contain a line feed character (hence the error I’m having). I’ve already made changes to read the file without the LF character, but I wanted to ask here (actually on the curlpp mailing list) for an option to ignore this character. There is no such option in libcurl. It previously even allowed line-feed characters and passed them on, but recent versions will trigger on them and return an error. -- / daniel.haxx.se--- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
Re: CURL custom POST commands
On Jul 20, 2015, at 9:57 AM, Patrick Monnerat patrick.monne...@datasphere.ch wrote: Fitzgerald, Kevin wrote: Thanks for this, but it looks like a command line request. What I need to do is send my POST within a C program in a UNIX environment. If you add --libcurl skeleton.c to a curl command, it generates a C skeleton for the request into the given file name (skeleton.c): you have to edit and adjust it afterwards. This works for any curl command line. And here is a quick SOAP-specific modification of my previous example as well: https://gist.github.com/p120ph37/8281362ae9da042f3043 --- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html