git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@379
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
if (!data)
RAISE_MALLOC;
data->in.size = 0;
if (!data)
RAISE_MALLOC;
data->in.size = 0;
+ if (!(data->in.data = malloc(data->buffsize)))
+ RAISE_MALLOC;
data->in.pos = 0; /* useless, indeed, since size==pos */
data->out.size = 0;
data->in.pos = 0; /* useless, indeed, since size==pos */
data->out.size = 0;
+ if (!(data->out.data = malloc(data->buffsize)))
+ RAISE_MALLOC;
data->out.pos = 0;
// data->buffsize = 32 * 1024 - 4; /* default socket buffsize (32k) - headers */
data->buffsize = 100 * 1024 ; /* 100k */
data->out.pos = 0;
// data->buffsize = 32 * 1024 - 4; /* default socket buffsize (32k) - headers */
data->buffsize = 100 * 1024 ; /* 100k */
/* Let underneath plugin check for direction, we work even in duplex */
gras_assert0(size >= 0, "Cannot send a negative amount of data");
/* Let underneath plugin check for direction, we work even in duplex */
gras_assert0(size >= 0, "Cannot send a negative amount of data");
- if (!data->out.data && !(data->out.data = malloc(data->buffsize)))
- RAISE_MALLOC;
-
while (chunk_pos < size) {
/* size of the chunck to receive in that shot */
long int thissize = min(size-chunk_pos,data->buffsize - data->out.size);
while (chunk_pos < size) {
/* size of the chunck to receive in that shot */
long int thissize = min(size-chunk_pos,data->buffsize - data->out.size);
gras_assert0(size >= 0, "Cannot receive a negative amount of data");
GRAS_IN;
gras_assert0(size >= 0, "Cannot receive a negative amount of data");
GRAS_IN;
- if (!data->in.data && !(data->in.data = malloc(data->buffsize)))
- RAISE_MALLOC;
while (chunck_pos < size) {
/* size of the chunck to receive in that shot */
while (chunck_pos < size) {
/* size of the chunck to receive in that shot */