|
@@ -224,38 +224,34 @@ static int rsi_parse(struct cache_detail *cd,
|
|
|
|
|
|
/* major/minor */
|
|
|
len = qword_get(&mesg, buf, mlen);
|
|
|
- if (len < 0)
|
|
|
+ if (len <= 0)
|
|
|
goto out;
|
|
|
- if (len == 0) {
|
|
|
+ rsii.major_status = simple_strtoul(buf, &ep, 10);
|
|
|
+ if (*ep)
|
|
|
+ goto out;
|
|
|
+ len = qword_get(&mesg, buf, mlen);
|
|
|
+ if (len <= 0)
|
|
|
+ goto out;
|
|
|
+ rsii.minor_status = simple_strtoul(buf, &ep, 10);
|
|
|
+ if (*ep)
|
|
|
goto out;
|
|
|
- } else {
|
|
|
- rsii.major_status = simple_strtoul(buf, &ep, 10);
|
|
|
- if (*ep)
|
|
|
- goto out;
|
|
|
- len = qword_get(&mesg, buf, mlen);
|
|
|
- if (len <= 0)
|
|
|
- goto out;
|
|
|
- rsii.minor_status = simple_strtoul(buf, &ep, 10);
|
|
|
- if (*ep)
|
|
|
- goto out;
|
|
|
|
|
|
- /* out_handle */
|
|
|
- len = qword_get(&mesg, buf, mlen);
|
|
|
- if (len < 0)
|
|
|
- goto out;
|
|
|
- status = -ENOMEM;
|
|
|
- if (dup_to_netobj(&rsii.out_handle, buf, len))
|
|
|
- goto out;
|
|
|
+ /* out_handle */
|
|
|
+ len = qword_get(&mesg, buf, mlen);
|
|
|
+ if (len < 0)
|
|
|
+ goto out;
|
|
|
+ status = -ENOMEM;
|
|
|
+ if (dup_to_netobj(&rsii.out_handle, buf, len))
|
|
|
+ goto out;
|
|
|
|
|
|
- /* out_token */
|
|
|
- len = qword_get(&mesg, buf, mlen);
|
|
|
- status = -EINVAL;
|
|
|
- if (len < 0)
|
|
|
- goto out;
|
|
|
- status = -ENOMEM;
|
|
|
- if (dup_to_netobj(&rsii.out_token, buf, len))
|
|
|
- goto out;
|
|
|
- }
|
|
|
+ /* out_token */
|
|
|
+ len = qword_get(&mesg, buf, mlen);
|
|
|
+ status = -EINVAL;
|
|
|
+ if (len < 0)
|
|
|
+ goto out;
|
|
|
+ status = -ENOMEM;
|
|
|
+ if (dup_to_netobj(&rsii.out_token, buf, len))
|
|
|
+ goto out;
|
|
|
rsii.h.expiry_time = expiry;
|
|
|
rsip = rsi_update(&rsii, rsip);
|
|
|
status = 0;
|