rfree(p->lock);
p->lock = NULL;
- p->partial_response = NULL;
-
struct snmp_register *r, *r2;
WALK_LIST_DELSAFE(r, r2, p->register_queue)
{
p->to_send = 0;
p->errs = 0;
- p->partial_response = NULL;
p->startup_timer = tm_new_init(p->pool, snmp_startup_timeout, p, 0, 0);
p->ping_timer = tm_new_init(p->pool, snmp_ping_timeout, p, 0, 0);
};
}
- if (!p->partial_response && c.size < sizeof(struct agentx_response))
+ if (c.size < sizeof(struct agentx_response))
{
snmp_manage_tbuf(p, &c);
// TODO renew pkt, pkt_start pointers context clen
snmp_log("sk_send error");
// TODO think through the error state
- p->partial_response = NULL;
-
mb_free(o_start);
mb_free(o_end);
(c.byte_ord) ? put_u32(&h->payload, pkt_size) : (h->payload = pkt_size);
//snmp_log("new rx-buffer size %u", h->payload);
*skip = AGENTX_HEADER_SIZE;
- p->partial_response = response_header;
/* number of bytes parsed from RX-buffer */
return pkt - pkt_start;
{
//snmp_log("prepare_response()");
- if (!p->partial_response)
- {
- struct agentx_response *r = (void *) c->buffer;
- struct agentx_header *h = &r->h;
-
- SNMP_BLANK_HEADER(h, AGENTX_RESPONSE_PDU);
- SNMP_SESSION(h, p);
+ struct agentx_response *r = (void *) c->buffer;
+ struct agentx_header *h = &r->h;
- /* protocol doesn't care about subagent upTime */
- STORE_U32(r->uptime, 0);
- STORE_U16(r->error, AGENTX_RES_NO_ERROR);
- STORE_U16(r->index, 0);
+ SNMP_BLANK_HEADER(h, AGENTX_RESPONSE_PDU);
+ SNMP_SESSION(h, p);
- ADVANCE(c->buffer, c->size, sizeof(struct agentx_response));
- return r;
- }
+ /* protocol doesn't care about subagent upTime */
+ STORE_U32(r->uptime, 0);
+ STORE_U16(r->error, AGENTX_RES_NO_ERROR);
+ STORE_U16(r->index, 0);
- return p->partial_response;
+ ADVANCE(c->buffer, c->size, sizeof(struct agentx_response));
+ return r;
}