The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
dedup.c File Reference

Binary IO abstractions for deduping packets. More...

#include <freeradius-devel/bio/bio_priv.h>
#include <freeradius-devel/bio/null.h>
#include <freeradius-devel/bio/buf.h>
#include <freeradius-devel/bio/dedup.h>
+ Include dependency graph for dedup.c:

Go to the source code of this file.

Data Structures

struct  fr_bio_dedup_entry_s
 
union  fr_bio_dedup_entry_s.__unnamed19__
 
struct  fr_bio_dedup_entry_s.__unnamed19__.__unnamed21__
 
struct  fr_bio_dedup_s
 

Macros

#define _BIO_DEDUP_PRIVATE
 

Typedefs

typedef struct fr_bio_dedup_list_s fr_bio_dedup_list_t
 
typedef struct fr_bio_dedup_s fr_bio_dedup_t
 

Enumerations

enum  fr_bio_dedup_state_t : uint8_t {
  FR_BIO_DEDUP_STATE_FREE ,
  FR_BIO_DEDUP_STATE_ACTIVE ,
  FR_BIO_DEDUP_STATE_PENDING ,
  FR_BIO_DEDUP_STATE_REPLIED ,
  FR_BIO_DEDUP_STATE_PARTIAL ,
  FR_BIO_DEDUP_STATE_CANCELLED ,
  FR_BIO_DEDUP_STATE_NO_REPLY ,
  FR_BIO_DEDUP_STATE_CLEANUP
}
 

Functions

static fr_cmp_ret_t _entry_cmp (void const *one, void const *two)
 
fr_bio_t * fr_bio_dedup_alloc (TALLOC_CTX *ctx, fr_bio_dedup_receive_t receive, fr_bio_dedup_release_t release, fr_bio_dedup_get_item_t get_item, fr_bio_dedup_config_t const *cfg, fr_bio_t *next)
 Allocate a fr_bio_dedup_t.
 
static ssize_t fr_bio_dedup_blocked (fr_bio_dedup_t *my, fr_bio_dedup_entry_t *item, ssize_t rcode)
 The write is blocked.
 
static ssize_t fr_bio_dedup_blocked_data (fr_bio_dedup_t *my, uint8_t const *buffer, size_t size, ssize_t rcode)
 The write is blocked, but we don't have "item".
 
static int fr_bio_dedup_buffer_save (fr_bio_dedup_t *my, uint8_t const *buffer, size_t size, ssize_t rcode)
 Save partially written data to our local buffer.
 
static ssize_t fr_bio_dedup_buffer_write (fr_bio_dedup_t *my)
 Write data from our local buffer to the next bio.
 
int fr_bio_dedup_conflict (fr_bio_t *bio, fr_bio_dedup_entry_t *item)
 Mark an entry as conflicting with a newer request.
 
void fr_bio_dedup_entry_cancel (fr_bio_t *bio, fr_bio_dedup_entry_t *item)
 Cancel one item.
 
int fr_bio_dedup_entry_extend (fr_bio_t *bio, fr_bio_dedup_entry_t *item, fr_time_t expires)
 Extend the expiry time for an entry.
 
static void fr_bio_dedup_entry_free (fr_bio_dedup_t *my, fr_bio_dedup_entry_t *item)
 Put an entry which is no longer in use into the free list, or free the entry if the free list is full.
 
static ssize_t fr_bio_dedup_flush_pending (fr_bio_dedup_t *my)
 Flush any packets in the pending queue.
 
int fr_bio_dedup_no_reply (UNUSED fr_bio_t *bio, fr_bio_dedup_entry_t *item)
 Mark an entry as "we intend to never reply".
 
static bool fr_bio_dedup_no_reply_expiring (fr_bio_dedup_entry_t const *item)
 Return true if an entry in state FR_BIO_DEDUP_STATE_NO_REPLY is in the expiry tree.
 
static void fr_bio_dedup_pending_add (fr_bio_dedup_t *my, fr_bio_dedup_entry_t *item)
 Add an entry to the pending list, because writes are blocked.
 
static ssize_t fr_bio_dedup_read (fr_bio_t *bio, void *packet_ctx, void *buffer, size_t size)
 
static void fr_bio_dedup_release (fr_bio_dedup_t *my, fr_bio_dedup_entry_t *item, fr_bio_dedup_release_reason_t reason)
 Release an entry back to the free list.
 
static void fr_bio_dedup_replied (fr_bio_dedup_t *my, fr_bio_dedup_entry_t *item)
 Add an entry to the expiry tree once the reply has been written, or once a "no reply" entry is done.
 
ssize_t fr_bio_dedup_respond (fr_bio_t *bio, fr_bio_dedup_entry_t *item)
 Resend a reply when we receive a duplicate request.
 
static int fr_bio_dedup_shutdown (fr_bio_t *bio)
 Remove the dedup cache.
 
static void fr_bio_dedup_timer (UNUSED fr_timer_list_t *tl, fr_time_t now, void *uctx)
 Release every entry which expires within 10ms of now.
 
static int fr_bio_dedup_timer_reset (fr_bio_dedup_t *my)
 Reset the timer after changing the rb tree.
 
static void fr_bio_dedup_timer_reset_item (fr_bio_dedup_t *my, fr_bio_dedup_entry_t *item)
 
static ssize_t fr_bio_dedup_write (fr_bio_t *bio, void *packet_ctx, void const *buffer, size_t size)
 Write raw data to the bio.
 
static ssize_t fr_bio_dedup_write_data (fr_bio_t *bio, void *packet_ctx, const void *buffer, size_t size)
 There's a partial block of data written.
 
static ssize_t fr_bio_dedup_write_partial (fr_bio_t *bio, void *packet_ctx, const void *buffer, size_t size)
 There's a partial packet written.
 
static int fr_bio_dedup_write_resume (fr_bio_t *bio)
 Resume writes.
 

Detailed Description

Binary IO abstractions for deduping packets.

Id
598608888e1452acb0a5ec3cc835f554682f39fe

The dedup BIO receives packets from the network, and allows for deduplication of requests, so that duplicate requests are only processed once. In addition, if a reply is available, a duplicate request will result in a duplicate reply.

The application creates the dedup tree, and sets the compare function. The compare function has to take two fr_bio_dedup_entry_t, and then checks packet_ctx. Each protocol has its own requirements for dedup :( The application searches the dedup tree, and inserts new entries in the fr_bio_dedup_receive_t callback. Only the dedup bio removes entries from the dedup tree, or when the application calls fr_bio_dedup_conflict().

When packets are read() from the next bio, the fr_bio_dedup_receive_t callback is run. That callback tells the dedup BIO whether or not the packet should be received, and whether or not the packet should be returned to the caller. The receive callback is also passed a fr_bio_dedup_entry_t pointer, where the packet_ctx, packet, and size are already filled out. This entry is used to correlate requests and replies.

When packets are write() to the network, the fr_bio_dedup_get_item_t callback is called to get the previously cached fr_bio_dedup_entry_t pointer. This is because there is no generic way to get an additional context to this BIO via the write() routine. i.e. the packet_ctx for write() may include things like src/dst ip/port, and therefore can't always be an fr_bio_dedup_entry_t. The caller should associate the fr_bio_dedup_entry_t with the packet_ctx for the reply. The get_item() routine can then return the entry.

For simplicity, the next bio should be a memory one. That way the read() can read more than one packet if necessary. And the write() can cache a partial packet if it blocks.

The entry needs to be cached in order to maintain the internal tracking used by the dedup BIO.

On client retransmit, the fr_bio_dedup_receive_t callback is run, just as if it is a new packet. The dedup BIO does not know if the received data is a new packet until the fr_bio_dedup_receive_t callback says so. On duplicate client request, the fr_bio_dedup_receive_t callback can call fr_bio_dedup_respond() to send a duplicate reply. That call bypasses the normal dedup stack, and writes directly to the next bio.

The calling application can also call fr_bio_dedup_respond() as soon as it has a reply. i.e. skip the BIO write() call. That works, and is safe.

The dedup BIO tracks a number of lists / trees internally. Packets which are received but which have no reply are in an "active" list. Packets which have a reply are in an "expired" RB tree, where a timer is set to expire packets. If a write() call results in a partial write, that packet is put into a "partially written" state. If multiple calls to write() are done when writing is blocked, the replies are put into a "pending" state. A pending reply is added to the expiry tree, so that it's cleaned up if it expires before the socket becomes writable again.

The calling application can always call fr_bio_dedup_cancel() to cancel or expire a packet. This call is safe, and can be made at any time, no matter what state the packet is in.

In some cases, the application doesn't reply to the client. These are:

  1. The application decided that it doesn't need to reply. It calls fr_bio_dedup_no_reply(), and the entry stays in the dedup BIO until it expires. Retransmitted requests see the cached entry, and don't send a reply.
  2. A newer request conflicts with an older request. The application calls fr_bio_dedup_conflict() for the old request, but is likely to still be running the old request. When the old request is done, the application calls fr_bio_dedup_respond() which notices that the entry is done, and releases it.

Definition in file dedup.c.


Data Structure Documentation

◆ fr_bio_dedup_entry_s

struct fr_bio_dedup_entry_s

Definition at line 114 of file dedup.c.

+ Collaboration diagram for fr_bio_dedup_entry_s:
Data Fields
union fr_bio_dedup_entry_s.__unnamed19__ __unnamed__
fr_rb_node_t dedup node in fr_bio_dedup_config_t.dedup
uint8_t * packet cached packet data for finding duplicates

cached packet data.

void * packet_ctx packet_ctx for dedup purposes
size_t packet_size size of the cached packet data
uint8_t * reply reply cached by the application
void * reply_ctx reply ctx
size_t reply_size size of the cached reply
void * uctx user-writable context

◆ fr_bio_dedup_entry_s.__unnamed19__

union fr_bio_dedup_entry_s.__unnamed19__

Definition at line 125 of file dedup.c.

Data Fields
struct fr_bio_dedup_entry_s.__unnamed19__.__unnamed21__ __unnamed__

◆ fr_bio_dedup_entry_s.__unnamed19__.__unnamed21__

struct fr_bio_dedup_entry_s.__unnamed19__.__unnamed21__

Definition at line 126 of file dedup.c.

Data Fields
fr_rb_node_t node for the expiry timers

◆ fr_bio_dedup_s

struct fr_bio_dedup_s

Definition at line 147 of file dedup.c.

+ Collaboration diagram for fr_bio_dedup_s:
Data Fields
fr_bio_buf_t buffer
fr_bio_dedup_config_t config
fr_rb_tree_t * dedup the application's dedup tree, from fr_bio_dedup_config_t
fr_event_list_t * el
fr_timer_t * ev
fr_bio_dedup_entry_t * first
FR_BIO_COMMON
fr_bio_dedup_get_item_t get_item turn a packet_ctx into a fr_bio_dedup_entry_t
fr_bio_dedup_entry_t * partial
fr_rb_tree_t rb expire list
fr_bio_dedup_receive_t receive called when we receive a potentially new packet
fr_bio_dedup_release_t release called to release a packet

Macro Definition Documentation

◆ _BIO_DEDUP_PRIVATE

#define _BIO_DEDUP_PRIVATE

Definition at line 83 of file dedup.c.

Typedef Documentation

◆ fr_bio_dedup_list_t

typedef struct fr_bio_dedup_list_s fr_bio_dedup_list_t

Definition at line 86 of file dedup.c.

◆ fr_bio_dedup_t

Definition at line 87 of file dedup.c.

Enumeration Type Documentation

◆ fr_bio_dedup_state_t

Enumerator
FR_BIO_DEDUP_STATE_FREE 
FR_BIO_DEDUP_STATE_ACTIVE 

Received, but not replied.

FR_BIO_DEDUP_STATE_PENDING 

Have a reply, but we're can't (yet) write it out.

The entry is in the expiry tree. and the pending list.

FR_BIO_DEDUP_STATE_REPLIED 

Replied, and waiting for it to expire.

FR_BIO_DEDUP_STATE_PARTIAL 

Partially written.

FR_BIO_DEDUP_STATE_CANCELLED 

Partially written, and then cancelled.

FR_BIO_DEDUP_STATE_NO_REPLY 

Active, or waiting to expire. Don't reply.

FR_BIO_DEDUP_STATE_CLEANUP 

Active, but conflicting request.

Don't reply, and clean up immediately when responding.

Definition at line 101 of file dedup.c.

Function Documentation

◆ _entry_cmp()

static fr_cmp_ret_t _entry_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 1220 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_alloc()

fr_bio_t * fr_bio_dedup_alloc ( TALLOC_CTX *  ctx,
fr_bio_dedup_receive_t  receive,
fr_bio_dedup_release_t  release,
fr_bio_dedup_get_item_t  get_item,
fr_bio_dedup_config_t const *  cfg,
fr_bio_t *  next 
)

Allocate a fr_bio_dedup_t.

Definition at line 1499 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_blocked()

static ssize_t fr_bio_dedup_blocked ( fr_bio_dedup_t *  my,
fr_bio_dedup_entry_t *  item,
ssize_t  rcode 
)
static

The write is blocked.

We couldn't write out the entire packet, the bio is blocked. Don't write anything else until we become unblocked!

Do NOT free the timer. We can still expire old entries. The partially written entry is not in the expiry tree, because expiring a partially written entry would nuke it's packet. And then write only a partial packet to the socket.

Definition at line 860 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_blocked_data()

static ssize_t fr_bio_dedup_blocked_data ( fr_bio_dedup_t *  my,
uint8_t const *  buffer,
size_t  size,
ssize_t  rcode 
)
static

The write is blocked, but we don't have "item".

We couldn't write out the entire packet, the bio is blocked. Don't write anything else until we become unblocked!

Do NOT free the timer. We can still expire old entries.

Definition at line 958 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_buffer_save()

static int fr_bio_dedup_buffer_save ( fr_bio_dedup_t *  my,
uint8_t const *  buffer,
size_t  size,
ssize_t  rcode 
)
static

Save partially written data to our local buffer.

Definition at line 730 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_buffer_write()

static ssize_t fr_bio_dedup_buffer_write ( fr_bio_dedup_t *  my)
static

Write data from our local buffer to the next bio.

Definition at line 751 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_conflict()

int fr_bio_dedup_conflict ( fr_bio_t *  bio,
fr_bio_dedup_entry_t *  item 
)

Mark an entry as conflicting with a newer request.

The application calls this function from the fr_bio_dedup_receive_t callback, when a newer request is found to conflict with an older request which the application is still processing. The old entry stays in the active list, but is marked as FR_BIO_DEDUP_STATE_CLEANUP. The entry is then released when the application finishes processing the older request, and calls fr_bio_dedup_respond().

If the application has already finished processing the older request, the entry is released now, with reason FR_BIO_DEDUP_CANCELLED.

  • Replied, or "no reply" and waiting to expire. The entry is released.
  • Pending reply. The reply is removed from the write queue (so we don't write it), and the entry is released.
  • Reply partially written. The rest of the reply is still written, as the next bio has already started writing the reply. The entry is marked FR_BIO_DEDUP_STATE_CANCELLED, and goes back to the free list once the write finishes.

Any other state is an application error. Because the dedup bio has already removed a cancelled, cleanup, or free entry from the dedup tree, the application cannot find the entry to pass to this function.

Parameters
biothe binary IO handler
itemthe older entry, which conflicts with the request passed to fr_bio_dedup_receive_t
Returns
  • <0 error, the entry is unchanged
  • 0 success

Definition at line 1397 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_entry_cancel()

void fr_bio_dedup_entry_cancel ( fr_bio_t *  bio,
fr_bio_dedup_entry_t *  item 
)

Cancel one item.

Parameters
biothe binary IO handler
itemthe dedup context from #fr_bio_dedup_respond_t

Definition at line 1245 of file dedup.c.

+ Here is the call graph for this function:

◆ fr_bio_dedup_entry_extend()

int fr_bio_dedup_entry_extend ( fr_bio_t *  bio,
fr_bio_dedup_entry_t *  item,
fr_time_t  expires 
)

Extend the expiry time for an entry.

Parameters
biothe binary IO handler
itemthe dedup context from #fr_bio_dedup_respond_t
expiresthe new expiry time
Returns
  • <0 error
  • 0 success

Definition at line 1263 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_entry_free()

static void fr_bio_dedup_entry_free ( fr_bio_dedup_t *  my,
fr_bio_dedup_entry_t *  item 
)
static

Put an entry which is no longer in use into the free list, or free the entry if the free list is full.

The caller must not use the entry after this function returns.

Definition at line 601 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_flush_pending()

static ssize_t fr_bio_dedup_flush_pending ( fr_bio_dedup_t *  my)
static

Flush any packets in the pending queue.

Definition at line 635 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_no_reply()

int fr_bio_dedup_no_reply ( UNUSED fr_bio_t *  bio,
fr_bio_dedup_entry_t *  item 
)

Mark an entry as "we intend to never reply".

The application calls this function while it is processing the request, and then later calls fr_bio_dedup_respond() once, when it has finished processing the request. fr_bio_dedup_respond() does not write a reply, and moves the entry to the expiry tree. The entry is cleaned up when it expires, with reason FR_BIO_DEDUP_NO_REPLY. Calling fr_bio_dedup_respond() a second time is an error.

The entry must still be active, i.e. received, but not replied. Or, it must be in the FR_BIO_DEDUP_STATE_CLEANUP, as we can mark a request as conflicting before the application has finished processing it.

Any other state is an application error.

Parameters
biothe binary IO handler
itemthe dedup context from fr_bio_dedup_receive_t
Returns
  • <0 error, the entry is unchanged
  • 0 success

Definition at line 1336 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_no_reply_expiring()

static bool fr_bio_dedup_no_reply_expiring ( fr_bio_dedup_entry_t const *  item)
inlinestatic

Return true if an entry in state FR_BIO_DEDUP_STATE_NO_REPLY is in the expiry tree.

We need to distinguish "no reply, and still being processed" (in the active list) from "no reply, and waiting to expire" (in the expiry tree). We do that by checking if the expiry time is zero.

Definition at line 204 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_pending_add()

static void fr_bio_dedup_pending_add ( fr_bio_dedup_t *  my,
fr_bio_dedup_entry_t *  item 
)
static

Add an entry to the pending list, because writes are blocked.

A pending entry is also in the expiry tree. If the next bio stays blocked until the entry expires, the expiry timer releases the entry, and the reply is never written.

  • An active entry moves from the active list to the expiry tree, with an expiry time of now plus the configured lifetime.
  • A replied entry is already in the expiry tree, and keeps the expiry time which the entry has.

Definition at line 315 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_read()

static ssize_t fr_bio_dedup_read ( fr_bio_t *  bio,
void *  packet_ctx,
void *  buffer,
size_t  size 
)
static

Definition at line 1136 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_release()

static void fr_bio_dedup_release ( fr_bio_dedup_t *  my,
fr_bio_dedup_entry_t *  item,
fr_bio_dedup_release_reason_t  reason 
)
static

Release an entry back to the free list.

Definition at line 520 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_replied()

static void fr_bio_dedup_replied ( fr_bio_dedup_t *  my,
fr_bio_dedup_entry_t *  item 
)
static

Add an entry to the expiry tree once the reply has been written, or once a "no reply" entry is done.

The expiry time is set from now, i.e. from when the reply was written (or for a "no reply" entry, from when the application called fr_bio_dedup_respond()), and not from when the reply was queued.

Expiration for an entry is the maximum of now + expiry, or now + lifetime. i.e. The continued reception of duplicate requests indicates that we should extend the expiry time.

Also updates the timers, because otherwise all callers have to do that.

Definition at line 234 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_respond()

ssize_t fr_bio_dedup_respond ( fr_bio_t *  bio,
fr_bio_dedup_entry_t *  item 
)

Resend a reply when we receive a duplicate request.

This function should be called by the respond() callback to re-send a duplicate reply.

It can also be called by the application when it first has a response to the request.

Parameters
biothe binary IO handler
itemthe dedup context from #fr_bio_dedup_sent_t
Returns
  • <0 on error
  • 0 for "wrote no data"
  • >0 for "wrote data".

Definition at line 351 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_shutdown()

static int fr_bio_dedup_shutdown ( fr_bio_t *  bio)
static

Remove the dedup cache.

Definition at line 1444 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_timer()

static void fr_bio_dedup_timer ( UNUSED fr_timer_list_t *  tl,
fr_time_t  now,
void *  uctx 
)
static

Release every entry which expires within 10ms of now.

Because a pending entry is in the expiry tree, the timer also releases pending entries. Pending entries which expire mean that they were never written, so we can just clean them up.

Definition at line 1020 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_timer_reset()

static int fr_bio_dedup_timer_reset ( fr_bio_dedup_t *  my)
static

Reset the timer after changing the rb tree.

Definition at line 478 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_timer_reset_item()

static void fr_bio_dedup_timer_reset_item ( fr_bio_dedup_t *  my,
fr_bio_dedup_entry_t *  item 
)
inlinestatic

Definition at line 216 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_write()

static ssize_t fr_bio_dedup_write ( fr_bio_t *  bio,
void *  packet_ctx,
void const *  buffer,
size_t  size 
)
static

Write raw data to the bio.

Due to the BIO API, this function can be passed a NULL buffer (for flushing the BIOs), and it can't be passed a fr_bio_dedup_entry_t. Instead, it has to be passed a "void *packet_ctx", and it calls the fr_bio_dedup_get_item_t callback to find the entry.

When there is an entry, the reply in the entry must be the data which is being written, and this function calls fr_bio_dedup_respond(). The one difference is that for an entry marked with fr_bio_dedup_no_reply() or fr_bio_dedup_conflict(), this function returns the full size instead of 0. When there is no entry, the data is written as un-tracked data.

The application can call fr_bio_dedup_respond() directly instead of calling this function.

Definition at line 1060 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_write_data()

static ssize_t fr_bio_dedup_write_data ( fr_bio_t *  bio,
void *  packet_ctx,
const void *  buffer,
size_t  size 
)
static

There's a partial block of data written.

Write all of that data first, before writing another packet.

Definition at line 918 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_write_partial()

static ssize_t fr_bio_dedup_write_partial ( fr_bio_t *  bio,
void *  packet_ctx,
const void *  buffer,
size_t  size 
)
static

There's a partial packet written.

Write all of that one first, before writing another packet.

The packet can either be cancelled, or IO blocked. In either case, we must write this packet before we can write another one.

Definition at line 791 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_dedup_write_resume()

static int fr_bio_dedup_write_resume ( fr_bio_t *  bio)
static

Resume writes.

Write the rest of any partly written reply or data, and then write the replies on the pending list.

Returns
  • <0 on error
  • 0 for "still blocked"
  • 1 for "can resume"

Definition at line 987 of file dedup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: