Fix CID#1407333
@@ -555,14 +555,12 @@ on_writable(struct neat_flow_operations *opCB)
case CONNECT:
if (config_log_level >= 3) {
- fprintf(stderr, "%s:%d CONNECT'ing with filename: %s\n",
- __func__, __LINE__, filename);
+ fprintf(stderr, "%s:%d CONNECT'ing with filename: %s\n", __func__, __LINE__, filename);
}
//pf->master = 0;
pf->segments_count = pf->fi->segments;
- preparemsg(pf->buffer, pf->buffer_alloc, &pf->buffer_size, CONNECT, 0,
- pf->segments_count, (unsigned char *)filename, sizeof(filename));
+ preparemsg(pf->buffer, pf->buffer_alloc, &pf->buffer_size, CONNECT, 0, pf->segments_count, (unsigned char *)filename, strlen(filename));
break;
case COMPLETE:
@@ -570,16 +568,14 @@ on_writable(struct neat_flow_operations *opCB)
fprintf(stderr, "%s:%d Sending COMPLETE%d\n",
__func__, __LINE__, pf->segments_count);
}
- preparemsg(pf->buffer, pf->buffer_alloc, &pf->buffer_size, COMPLETE,
- 0, pf->segments_count, NULL, 0);
+ preparemsg(pf->buffer, pf->buffer_alloc, &pf->buffer_size, COMPLETE, 0, pf->segments_count, NULL, 0);
break;
case CONNECTACK:
if (config_log_level >= 3) {
fprintf(stderr, "%s:%d CONNECTACK acking segments %d\n",
__func__, __LINE__, pf->segments_count);
}
- preparemsg(pf->buffer, pf->buffer_alloc, &pf->buffer_size, CONNECTACK,
- 0, pf->segments_count, NULL, 0);
+ preparemsg(pf->buffer, pf->buffer_alloc, &pf->buffer_size, CONNECTACK, 0, pf->segments_count, NULL, 0);
break;
case DATA:
if (config_log_level >= 3) {
@@ -610,16 +606,14 @@ on_writable(struct neat_flow_operations *opCB)
}
}
- preparemsg(pf->buffer, pf->buffer_alloc, &pf->buffer_size, DATA,
- 0, pf->segment, buf, bytes);
+ preparemsg(pf->buffer, pf->buffer_alloc, &pf->buffer_size, DATA, 0, pf->segment, buf, bytes);
break;
case ACK:
if (config_log_level >= 3) {
fprintf(stderr, "%s:%d ACK acking segment %d\n",
__func__, __LINE__, pf->segment);
}
- preparemsg(pf->buffer, pf->buffer_alloc, &pf->buffer_size, ACK,
- 0, pf->segment, NULL, 0);
+ preparemsg(pf->buffer, pf->buffer_alloc, &pf->buffer_size, ACK, 0, pf->segment, NULL, 0);
break;
case ERROR:
if (config_log_level >= 3) {
