summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
47284b1)
Before this patch, rconn_send() would delete 'b' on success, and
not on error. This is confusing and error-prone. This patch
causes rconn_send() to always delete 'b'.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
if (error) {
VLOG_INFO_RL(&rl, "%s: failed to queue default flows (%s)",
rconn_get_name(rconn), strerror(error));
if (error) {
VLOG_INFO_RL(&rl, "%s: failed to queue default flows (%s)",
rconn_get_name(rconn), strerror(error));
-/* Sends 'b' on 'rc'. Returns 0 if successful (in which case 'b' is
- * destroyed), or ENOTCONN if 'rc' is not currently connected (in which case
- * the caller retains ownership of 'b').
+/* Sends 'b' on 'rc'. Returns 0 if successful, or ENOTCONN if 'rc' is not
+ * currently connected. Takes ownership of 'b'.
*
* If 'counter' is non-null, then 'counter' will be incremented while the
* packet is in flight, then decremented when it has been sent (or discarded
*
* If 'counter' is non-null, then 'counter' will be incremented while the
* packet is in flight, then decremented when it has been sent (or discarded
retval = counter->n >= queue_limit ? EAGAIN : rconn_send(rc, b, counter);
if (retval) {
COVERAGE_INC(rconn_overflow);
retval = counter->n >= queue_limit ? EAGAIN : rconn_send(rc, b, counter);
if (retval) {
COVERAGE_INC(rconn_overflow);
struct rconn_packet_counter *counter)
{
update_openflow_length(msg);
struct rconn_packet_counter *counter)
{
update_openflow_length(msg);
- if (rconn_send(ofconn->rconn, msg, counter)) {
- ofpbuf_delete(msg);
- }
+ rconn_send(ofconn->rconn, msg, counter);
}
\f
/* Sending asynchronous messages. */
}
\f
/* Sending asynchronous messages. */