-
-
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
curl: use dynbuf for config file buffer management #5946
Conversation
d4591d7
to
1b54f96
Compare
Sharing memory allocation functions between the tool and library is tricky. In Windows the tool and library can each be using a separate CRT if libcurl is a DLL and therefore have separate memory handling. Also it would probably be slower to call into the DLL for each dynbuf memory call. |
Yes, but this isn't meant to share allocation functions. It is meant to share the dynbuf.c code and the allocations done by the tool should be done like normal tool-side allocations. Still a bit tricky to get right in the build systems but I think I'm almost there now... |
If the code is built separately for the tool and library and there's naming conflicts and the tool and library can't both use the same function name (I seem to remember that's happened before) then you could change the function name depending on BUILDING_LIBCURL like #ifdef BUILDING_LIBCURL void DYN_FNAME(dyn_nappend) (... |
Ah right, it will be a problem in static builds... |
I opted to plain redefined function names for the tool. I think it looks and feels better. |
|
79925c7
to
1e6d21f
Compare
This looks fine now and I'll land this (unless someone objects) within a day or two. |
06e2b6f
to
80e20e4
Compare
80e20e4
to
b8fff67
Compare
Yet another force-push |
... fixes an integer overflow at the same time. Reported-by: ihsinme on github Assisted-by: Jay Satiro
b8fff67
to
2877e66
Compare
Okay, pushed a new version that makes curl actually return an error back out if it runs into an out of memory. |
This logic is doing exactly one line at a time... |
... fixes an integer overflow at the same time. Reported-by: ihsinme on github Assisted-by: Jay Satiro Closes #5946
The fix for this seems to break the standard commandline that the PHP devs use: winlibs/cURL#16 |
By making the dynbuf functions available as
curlx_
verisons, the config file parser in the tool code can use that for its buffer management and for saver reallocs etc.Once landed, we can move more curl functions over to dynbuf,
(Alternative take to #5941 )