mirror of
https://github.com/samba-team/samba.git
synced 2025-03-10 12:58:35 +03:00
s3: Make change notify immediately return a catch-all packet on underlying error
* This allows a problem in the underlying CN backend to be bubbled up to the general CN layer so a catch-all reply can be returned * We now also return a catch-all response immediately if the server-side event queue becomes too big
This commit is contained in:
parent
b329ea1cf3
commit
9a90cbea83
@ -372,13 +372,26 @@ static void notify_fsp(files_struct *fsp, uint32 action, const char *name)
|
||||
if ((fsp->notify->num_changes > 1000) || (name == NULL)) {
|
||||
/*
|
||||
* The real number depends on the client buf, just provide a
|
||||
* guard against a DoS here.
|
||||
* guard against a DoS here. If name == NULL the CN backend is
|
||||
* alerting us to a problem. Possibly dropped events. Clear
|
||||
* queued changes and send the catch-all response to the client
|
||||
* if a request is pending.
|
||||
*/
|
||||
TALLOC_FREE(fsp->notify->changes);
|
||||
fsp->notify->num_changes = -1;
|
||||
if (fsp->notify->requests != NULL) {
|
||||
change_notify_reply(fsp->conn,
|
||||
fsp->notify->requests->req,
|
||||
fsp->notify->requests->max_param,
|
||||
fsp->notify);
|
||||
change_notify_remove_request(fsp->notify->requests);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* If we've exceeded the server side queue or received a NULL name
|
||||
* from the underlying CN implementation, don't queue up any more
|
||||
* requests until we can send a catch-all response to the client */
|
||||
if (fsp->notify->num_changes == -1) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user