ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Linux-NBD/NBD.xs
(Generate patch)

Comparing Linux-NBD/NBD.xs (file contents):
Revision 1.6 by root, Tue Sep 21 11:31:05 2010 UTC vs.
Revision 1.7 by root, Tue Sep 21 11:51:55 2010 UTC

123 XSRETURN_UNDEF; /* should req->eof */ 123 XSRETURN_UNDEF; /* should req->eof */
124 else if (errno != EAGAIN && errno != EWOULDBLOCK) 124 else if (errno != EAGAIN && errno != EWOULDBLOCK)
125 XSRETURN_UNDEF; /* should req->error */ 125 XSRETURN_UNDEF; /* should req->error */
126 126
127 s->data_read = 0; 127 s->data_read = 0;
128
129 if (s->req_read < sizeof (struct nbd_request))
130 XSRETURN_NO;
128 } 131 }
129
130 if (s->req_read < sizeof (struct nbd_request))
131 XSRETURN_NO;
132 132
133 /* now we have a full request, so check for data */ 133 /* now we have a full request, so check for data */
134 if (s->req.magic != htonl (NBD_REQUEST_MAGIC)) 134 if (s->req.magic != htonl (NBD_REQUEST_MAGIC))
135 croak ("Linux::NBD::Server received illegal request magic %08lx - protocol error.\n", ntohl (s->req.magic)); 135 croak ("Linux::NBD::Server received illegal request magic %08lx - protocol error.\n", ntohl (s->req.magic));
136 136
156 s->data_read += res; 156 s->data_read += res;
157 else if (res == 0) 157 else if (res == 0)
158 XSRETURN_UNDEF; /* should req->eof */ 158 XSRETURN_UNDEF; /* should req->eof */
159 else if (errno != EAGAIN && errno != EWOULDBLOCK) 159 else if (errno != EAGAIN && errno != EWOULDBLOCK)
160 XSRETURN_UNDEF; /* should req->error */ 160 XSRETURN_UNDEF; /* should req->error */
161 }
162 161
163 if (s->data_read < len) 162 if (s->data_read < len)
164 XSRETURN_NO; 163 XSRETURN_NO;
164 }
165 165
166 /* fallthrough */ 166 /* fallthrough */
167 case NBD_CMD_READ: 167 case NBD_CMD_READ:
168 s->req_read = 0; 168 s->req_read = 0;
169 169

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines