Skip to content
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

strparse: string parsing helper functions #15692

Closed
wants to merge 1 commit into from
Closed

Conversation

bagder
Copy link
Member

@bagder bagder commented Dec 5, 2024

Designed to aid converting off from sscanf parsers. sscanf is hard to use right, easy to mess up and often makes for sloppy error checking.

The new parsers allow more exact and pedandic parsing.

This new set of functions should be possible to use (and extend) and switch over other libcurl parser code to use going forward.

Adapts the following to use the new functions:

  • altsvc.c
  • hsts.c
  • http_aws_sigv4.c

Bonus: fewer memory copies, fewer stack buffers.

  • internal documentation
  • unit tests

@bagder bagder added the feature-window A merge of this requires an open feature window label Dec 5, 2024
@github-actions github-actions bot added the tests label Dec 5, 2024
@bagder bagder marked this pull request as ready for review December 5, 2024 22:05
@bagder bagder mentioned this pull request Dec 5, 2024
4 tasks
@bagder bagder force-pushed the bagder/strparse branch 2 times, most recently from ebea96d to 28b90ad Compare December 6, 2024 15:10
Designed to aid converting off from sscanf parsers. sscanf is hard to
use right, easy to mess up and often makes for sloppy error checking.

The new parsers allow more exact and pedandic parsing.

This new set of functions should be possible to use (and extend) and
switch over other libcurl parser code to use going forward.

Adapts the following to use the new functions:

- altsvc.c
- hsts.c
- http_aws_sigv4.c

Bonus: fewer memory copies, fewer stack buffers.

Test: Unit test1664

Docs: docs/internals/STRPARSE.md

Closes #15692
@bagder bagder closed this in d5c738c Dec 12, 2024
@bagder bagder deleted the bagder/strparse branch December 12, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-window A merge of this requires an open feature window tests
Development

Successfully merging this pull request may close these issues.

1 participant