-
Notifications
You must be signed in to change notification settings - Fork 25
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
buffer: refactor buffer to be dynamically-sized #53
base: master
Are you sure you want to change the base?
Changes from all commits
8932c77
14a9563
3cf9285
e76558a
a36af8d
5ee2021
154d1a3
6e9c709
ef706f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,27 +100,7 @@ bool | |
mpd_sync_send_command_v(struct mpd_async *async, const struct timeval *tv0, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PS: struct timeval is not used here because `mpd_sync_io' is not called anymore; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is an internal API, we can remove the parameter easily. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The refactoring is to allow libmpdclient to be limited in its message size only by MPD. If i'm right, currently MPD supports up to 8KiB messages. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You didn't answer my question. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reasons were: (i) At least one user would like to send messages > 4KiB (issue #51), and (ii) this code would also adapt in case MPD changes the limit of received messages. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #51 does not request being able to send large requests. He complains about the lousy error handling if he tries to send a huge malformed request. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the debian bug report: I think for the majority of cases 4KiB is more than sufficient; The reason i submitted the other PR is in case the changes i'm proposing here are deemed undesirable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, that's where the Debian bug report deviates from #51, but we were talking about #51. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. He also mentions this feature request in #51. The title is about the hard coded limit. True, the test seems to be about fuzzing, but from the MPD protocol page i didn't find any mention of a limit to the find/search command. In theory, you could concatenate multiple find requests in a single huge line like: |
||
const char *command, va_list args) | ||
{ | ||
struct timeval tv, *tvp; | ||
va_list copy; | ||
bool success; | ||
|
||
if (tv0 != NULL) { | ||
tv = *tv0; | ||
tvp = &tv; | ||
} else | ||
tvp = NULL; | ||
|
||
while (true) { | ||
va_copy(copy, args); | ||
success = mpd_async_send_command_v(async, command, copy); | ||
va_end(copy); | ||
|
||
if (success) | ||
return true; | ||
|
||
if (!mpd_sync_io(async, tvp)) | ||
return false; | ||
} | ||
return mpd_async_send_command_v(async, command, args); | ||
} | ||
|
||
bool | ||
|
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.
What does this function do?
Documentation missing!
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.
fixed in 14a9563