Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309455
b: refs/heads/master
c: 57dac9d
h: refs/heads/master
i:
  309453: c57c594
  309451: 1e0a546
  309447: 398bcbe
  309439: 2acd2f5
v: v3
  • Loading branch information
Alex Elder authored and Alex Elder committed May 14, 2012
1 parent 411972c commit 01cd489
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b7f6519e6bc7a0c5a9e3eadc8a2c79c0d4556050
refs/heads/master: 57dac9d1620942608306d8c17c98a9d1568ffdf4
30 changes: 10 additions & 20 deletions trunk/net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ static int read_partial_message(struct ceph_connection *con)
{
struct ceph_msg *m = con->in_msg;
int ret;
int to, left;
int to;
unsigned front_len, middle_len, data_len;
bool do_datacrc = !con->msgr->nocrc;
int skip;
Expand All @@ -1638,15 +1638,10 @@ static int read_partial_message(struct ceph_connection *con)
dout("read_partial_message con %p msg %p\n", con, m);

/* header */
while (con->in_base_pos < sizeof(con->in_hdr)) {
left = sizeof(con->in_hdr) - con->in_base_pos;
ret = ceph_tcp_recvmsg(con->sock,
(char *)&con->in_hdr + con->in_base_pos,
left);
if (ret <= 0)
return ret;
con->in_base_pos += ret;
}
to = 0;
ret = read_partial(con, &to, sizeof (con->in_hdr), &con->in_hdr);
if (ret <= 0)
return ret;

crc = crc32c(0, &con->in_hdr, offsetof(struct ceph_msg_header, crc));
if (cpu_to_le32(crc) != con->in_hdr.crc) {
Expand Down Expand Up @@ -1759,16 +1754,11 @@ static int read_partial_message(struct ceph_connection *con)
}

/* footer */
to = sizeof(m->hdr) + sizeof(m->footer);
while (con->in_base_pos < to) {
left = to - con->in_base_pos;
ret = ceph_tcp_recvmsg(con->sock, (char *)&m->footer +
(con->in_base_pos - sizeof(m->hdr)),
left);
if (ret <= 0)
return ret;
con->in_base_pos += ret;
}
to = sizeof (m->hdr);
ret = read_partial(con, &to, sizeof (m->footer), &m->footer);
if (ret <= 0)
return ret;

dout("read_partial_message got msg %p %d (%u) + %d (%u) + %d (%u)\n",
m, front_len, m->footer.front_crc, middle_len,
m->footer.middle_crc, data_len, m->footer.data_crc);
Expand Down

0 comments on commit 01cd489

Please sign in to comment.