-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL API #2842
Conversation
looks good to me, there is some good inspiration over at https://github.com/uriparser/uriparser/blob/master/test/test.cpp |
tests/unit/Makefile.inc
Outdated
@@ -95,3 +95,4 @@ unit1608_CPPFLAGS = $(AM_CPPFLAGS) | |||
|
|||
unit1609_SOURCES = unit1609.c $(UNITFILES) | |||
unit1609_CPPFLAGS = $(AM_CPPFLAGS) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit: An unnecessary empty line slipped in here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops
Is there any reason why CURLUcode curl_url(char *URL, CURLURL **urlhandle, unsigned int flags) This function makes a call to UPDATE: Forgot to say: Thanks for this API, it is very useful! |
No reason at all really. It's just an old weakness of mine to skip out on the 'const's... I'll fix. Thanks! |
More minor fixes, squashed and rebased. |
docs/libcurl/curl_url.3
Outdated
.B #include <curl/curl.h> | ||
|
||
.nf | ||
CURLUcode curl_url(char *url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the constifying, it's looking good! One minor: curl_url()
prototype above needs to be synced with this change.
I think coveralls got some hiccups there when it claims a -3.4% less test coverage, as this patch provides quite a bit of testing already. I'm ignoring that for now, as I hope to add more tests anyway as I go along and fix the remaining parts. |
I'm not entirely happy with how Current CURLURL *h;
rc = curl_url("http://example.com", &h, 0); /* create handle * I suspect that way of storing the handle pointer is going to cause users grief. A bit too unusual. New CURLURL *h = curl_url(); /* create handle */
curl_url_set(h, CURLUPART_URL, "http://example.com", 0); It is more in style with how our other APIs work and makes sure there's one single way to set URL in the handle, Syntax-check a URLA downside with this approach is that there's no longer any "shortcut" for just syntax-checking a URL without creating a handle, but then again I'm not convinced that's a very important feature. |
I've synced the wiki page to match how the current patch implements the API. |
The URL API. Man pages with all the details and a fair amount of tests are included. I encourage all interested parties to try it out and report your experiences, both good and bad!
I'm saving these items until after the initial merge and done as separate PRs:
CURLOPT_CURLU
to allow passing in a URL handle to work with