Skip to content

Commit

Permalink
imap: Don't try to hibernate if it's not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse committed Nov 28, 2024
1 parent 600aa7c commit c64c105
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/imap/imap-client-hibernate.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,19 @@ imap_hibernate_process_send(struct client *client, const buffer_t *state,
bool imap_client_hibernate(struct client **_client, const char **reason_r)
{
struct client *client = *_client;
buffer_t *state;
const char *error;
int ret, fd_notify = -1, fd_hibernate = -1;

*reason_r = NULL;

if (client->fd_in != client->fd_out) {
/* we won't try to hibernate stdio clients */
*reason_r = "stdio clients can't be hibernated";
return FALSE;
}

#ifdef BUILD_IMAP_HIBERNATE
buffer_t *state;
const char *error;
int ret, fd_notify = -1, fd_hibernate = -1;

if (o_stream_get_buffer_used_size(client->output) > 0) {
/* wait until we've sent the pending output to client */
*reason_r = "output pending to client";
Expand Down Expand Up @@ -294,4 +296,8 @@ bool imap_client_hibernate(struct client **_client, const char **reason_r)
net_disconnect(fd_hibernate);
buffer_free(&state);
return ret > 0;
#else
*reason_r = "imap hibernation is not enabled";
return FALSE;
#endif
}

0 comments on commit c64c105

Please sign in to comment.