From 6a9ec900f656439652b2f20e34b2452d561eb0a6 Mon Sep 17 00:00:00 2001 From: Pablo Mazzini Date: Fri, 25 Jan 2019 20:43:12 +0000 Subject: [async] re-add modifiers to Send method (#239) --- dhcpv4/async/client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dhcpv4') diff --git a/dhcpv4/async/client.go b/dhcpv4/async/client.go index 81b10f7..617c711 100644 --- a/dhcpv4/async/client.go +++ b/dhcpv4/async/client.go @@ -194,7 +194,11 @@ func (c *Client) remoteAddr() (*net.UDPAddr, error) { // Send inserts a message to the queue to be sent asynchronously. // Returns a future which resolves to response and error. -func (c *Client) Send(message *dhcpv4.DHCPv4) *promise.Future { +func (c *Client) Send(message *dhcpv4.DHCPv4, modifiers ...dhcpv4.Modifier) *promise.Future { + for _, mod := range modifiers { + mod(message) + } + p := promise.NewPromise() c.packetsLock.Lock() c.packets[message.TransactionID] = p -- cgit v1.2.3