multi: notify rename, remove the last stragglers

in the public API.

Follow-up to 357808f4ad

Closes #18910
This commit is contained in:
Stefan Eissing 2025-10-07 13:40:05 +02:00 committed by Daniel Stenberg
parent 7ddbde4f73
commit 53be8166b2
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
9 changed files with 20 additions and 20 deletions

View file

@ -49,7 +49,7 @@ int main(void)
int rc; int rc;
CURLM *multi = curl_multi_init(); CURLM *multi = curl_multi_init();
rc = curl_multi_notify_disable(multi, CURLM_NTFY_INFO_READ); rc = curl_multi_notify_disable(multi, CURLM_NOTIFY_INFO_READ);
} }
~~~ ~~~

View file

@ -49,7 +49,7 @@ int main(void)
int rc; int rc;
CURLM *multi = curl_multi_init(); CURLM *multi = curl_multi_init();
rc = curl_multi_notify_enable(multi, CURLM_NTFY_INFO_READ); rc = curl_multi_notify_enable(multi, CURLM_NOTIFY_INFO_READ);
} }
~~~ ~~~

View file

@ -61,7 +61,7 @@ int main(void)
/* ... use socket callback and custom pointer */ /* ... use socket callback and custom pointer */
curl_multi_setopt(multi, CURLMOPT_NOTIFYFUNCTION, ntfy_cb); curl_multi_setopt(multi, CURLMOPT_NOTIFYFUNCTION, ntfy_cb);
curl_multi_setopt(multi, CURLMOPT_NOTIFYDATA, &setup); curl_multi_setopt(multi, CURLMOPT_NOTIFYDATA, &setup);
curl_multi_notify_enable(multi, CURLM_NTFY_INFO_READ); curl_multi_notify_enable(multi, CURLM_NOTIFY_INFO_READ);
} }
~~~ ~~~

View file

@ -63,7 +63,7 @@ are shut down.
**notification** is the type of notification, e.g. what happened. The **notification** is the type of notification, e.g. what happened. The
following types are available: following types are available:
## CURLM_NTFY_INFO_READ ## CURLM_NOTIFY_INFO_READ
When enabled via curl_multi_notify_enable(3), this informs the application When enabled via curl_multi_notify_enable(3), this informs the application
that there are new messages to be processed via curl_multi_info_read(3). that there are new messages to be processed via curl_multi_info_read(3).
@ -76,7 +76,7 @@ again.
The *easy* handle passed is an internal handle. The *easy* handle passed is an internal handle.
## CURLM_NTFY_EASY_DONE ## CURLM_NOTIFY_EASY_DONE
When enabled via curl_multi_notify_enable(3), this notification is triggered When enabled via curl_multi_notify_enable(3), this notification is triggered
when a an easy handle has finished. This happens both for when a an easy handle has finished. This happens both for
@ -118,7 +118,7 @@ int main(void)
/* ... use socket callback and custom pointer */ /* ... use socket callback and custom pointer */
curl_multi_setopt(multi, CURLMOPT_NOTIFYFUNCTION, ntfy_cb); curl_multi_setopt(multi, CURLMOPT_NOTIFYFUNCTION, ntfy_cb);
curl_multi_setopt(multi, CURLMOPT_NOTIFYDATA, &setup); curl_multi_setopt(multi, CURLMOPT_NOTIFYDATA, &setup);
curl_multi_notify_enable(multi, CURLM_NTFY_INFO_READ); curl_multi_notify_enable(multi, CURLM_NOTIFY_INFO_READ);
} }
~~~ ~~~

View file

@ -545,8 +545,8 @@ CURLM_BAD_SOCKET 7.15.4
CURLM_CALL_MULTI_PERFORM 7.9.6 CURLM_CALL_MULTI_PERFORM 7.9.6
CURLM_CALL_MULTI_SOCKET 7.15.5 CURLM_CALL_MULTI_SOCKET 7.15.5
CURLM_INTERNAL_ERROR 7.9.6 CURLM_INTERNAL_ERROR 7.9.6
CURLM_NTFY_EASY_DONE 8.17.0 CURLM_NOTIFY_EASY_DONE 8.17.0
CURLM_NTFY_INFO_READ 8.17.0 CURLM_NOTIFY_INFO_READ 8.17.0
CURLM_OK 7.9.6 CURLM_OK 7.9.6
CURLM_OUT_OF_MEMORY 7.9.6 CURLM_OUT_OF_MEMORY 7.9.6
CURLM_RECURSIVE_API_CALL 7.59.0 CURLM_RECURSIVE_API_CALL 7.59.0
@ -570,8 +570,8 @@ CURLMOPT_MAX_PIPELINE_LENGTH 7.30.0
CURLMOPT_MAX_TOTAL_CONNECTIONS 7.30.0 CURLMOPT_MAX_TOTAL_CONNECTIONS 7.30.0
CURLMOPT_MAXCONNECTS 7.16.3 CURLMOPT_MAXCONNECTS 7.16.3
CURLMOPT_NETWORK_CHANGED 8.16.0 CURLMOPT_NETWORK_CHANGED 8.16.0
CURLMOPT_NOTIFYDATA 8.17.0 CURLMOPT_NOTIFYDATA 8.17.0
CURLMOPT_NOTIFYFUNCTION 8.17.0 CURLMOPT_NOTIFYFUNCTION 8.17.0
CURLMOPT_PIPELINING 7.16.0 CURLMOPT_PIPELINING 7.16.0
CURLMOPT_PIPELINING_SERVER_BL 7.30.0 CURLMOPT_PIPELINING_SERVER_BL 7.30.0
CURLMOPT_PIPELINING_SITE_BL 7.30.0 CURLMOPT_PIPELINING_SITE_BL 7.30.0

View file

@ -529,8 +529,8 @@ CURL_EXTERN CURLMcode curl_multi_waitfds(CURLM *multi,
/* /*
* Notifications dispatched by a multi handle, when enabled. * Notifications dispatched by a multi handle, when enabled.
*/ */
#define CURLM_NTFY_INFO_READ 0 #define CURLM_NOTIFY_INFO_READ 0
#define CURLM_NTFY_EASY_DONE 1 #define CURLM_NOTIFY_EASY_DONE 1
/* /*
* Callback to install via CURLMOPT_NOTIFYFUNCTION. * Callback to install via CURLMOPT_NOTIFYFUNCTION.

View file

@ -173,13 +173,13 @@ static void mstate(struct Curl_easy *data, CURLMstate state
data->mstate = state; data->mstate = state;
switch(state) { switch(state) {
case MSTATE_DONE: case MSTATE_DONE:
CURLM_NTFY(data, CURLM_NTFY_EASY_DONE); CURLM_NTFY(data, CURLM_NOTIFY_EASY_DONE);
break; break;
case MSTATE_COMPLETED: case MSTATE_COMPLETED:
/* we sometimes directly jump to COMPLETED, trigger also a notification /* we sometimes directly jump to COMPLETED, trigger also a notification
* in that case. */ * in that case. */
if(oldstate < MSTATE_DONE) if(oldstate < MSTATE_DONE)
CURLM_NTFY(data, CURLM_NTFY_EASY_DONE); CURLM_NTFY(data, CURLM_NOTIFY_EASY_DONE);
/* changing to COMPLETED means it is in process and needs to go */ /* changing to COMPLETED means it is in process and needs to go */
DEBUGASSERT(Curl_uint_bset_contains(&data->multi->process, data->mid)); DEBUGASSERT(Curl_uint_bset_contains(&data->multi->process, data->mid));
Curl_uint_bset_remove(&data->multi->process, data->mid); Curl_uint_bset_remove(&data->multi->process, data->mid);
@ -226,7 +226,7 @@ static void ph_freeentry(void *p)
static void multi_addmsg(struct Curl_multi *multi, struct Curl_message *msg) static void multi_addmsg(struct Curl_multi *multi, struct Curl_message *msg)
{ {
if(!Curl_llist_count(&multi->msglist)) if(!Curl_llist_count(&multi->msglist))
CURLM_NTFY(multi->admin, CURLM_NTFY_INFO_READ); CURLM_NTFY(multi->admin, CURLM_NOTIFY_INFO_READ);
Curl_llist_append(&multi->msglist, msg, &msg->list); Curl_llist_append(&multi->msglist, msg, &msg->list);
} }

View file

@ -137,7 +137,7 @@ void Curl_mntfy_init(struct Curl_multi *multi)
CURLMcode Curl_mntfy_resize(struct Curl_multi *multi) CURLMcode Curl_mntfy_resize(struct Curl_multi *multi)
{ {
if(Curl_uint_bset_resize(&multi->ntfy.enabled, CURLM_NTFY_EASY_DONE + 1)) if(Curl_uint_bset_resize(&multi->ntfy.enabled, CURLM_NOTIFY_EASY_DONE + 1))
return CURLM_OUT_OF_MEMORY; return CURLM_OUT_OF_MEMORY;
return CURLM_OK; return CURLM_OK;
} }
@ -155,7 +155,7 @@ void Curl_mntfy_cleanup(struct Curl_multi *multi)
CURLMcode Curl_mntfy_enable(struct Curl_multi *multi, unsigned int type) CURLMcode Curl_mntfy_enable(struct Curl_multi *multi, unsigned int type)
{ {
if(type > CURLM_NTFY_EASY_DONE) if(type > CURLM_NOTIFY_EASY_DONE)
return CURLM_UNKNOWN_OPTION; return CURLM_UNKNOWN_OPTION;
Curl_uint_bset_add(&multi->ntfy.enabled, type); Curl_uint_bset_add(&multi->ntfy.enabled, type);
return CURLM_OK; return CURLM_OK;
@ -163,7 +163,7 @@ CURLMcode Curl_mntfy_enable(struct Curl_multi *multi, unsigned int type)
CURLMcode Curl_mntfy_disable(struct Curl_multi *multi, unsigned int type) CURLMcode Curl_mntfy_disable(struct Curl_multi *multi, unsigned int type)
{ {
if(type > CURLM_NTFY_EASY_DONE) if(type > CURLM_NOTIFY_EASY_DONE)
return CURLM_UNKNOWN_OPTION; return CURLM_UNKNOWN_OPTION;
Curl_uint_bset_remove(&multi->ntfy.enabled, type); Curl_uint_bset_remove(&multi->ntfy.enabled, type);
return CURLM_OK; return CURLM_OK;

View file

@ -1736,7 +1736,7 @@ static void mnotify(CURLM *multi, unsigned int notification,
(void)easy; (void)easy;
switch(notification) { switch(notification) {
case CURLM_NTFY_INFO_READ: case CURLM_NOTIFY_INFO_READ:
result = check_finished(s); result = check_finished(s);
/* remember first failure */ /* remember first failure */
if(result && !s->result) if(result && !s->result)
@ -1766,7 +1766,7 @@ static CURLcode parallel_transfers(CURLSH *share)
(void)curl_multi_setopt(s->multi, CURLMOPT_NOTIFYFUNCTION, mnotify); (void)curl_multi_setopt(s->multi, CURLMOPT_NOTIFYFUNCTION, mnotify);
(void)curl_multi_setopt(s->multi, CURLMOPT_NOTIFYDATA, s); (void)curl_multi_setopt(s->multi, CURLMOPT_NOTIFYDATA, s);
(void)curl_multi_notify_enable(s->multi, CURLM_NTFY_INFO_READ); (void)curl_multi_notify_enable(s->multi, CURLM_NOTIFY_INFO_READ);
result = add_parallel_transfers(s->multi, s->share, result = add_parallel_transfers(s->multi, s->share,
&s->more_transfers, &s->added_transfers); &s->more_transfers, &s->added_transfers);