Displaying 20 results from an estimated 74 matches for "send_file_end".
2016 Mar 29
0
[PATCH 1/2] rename icat API to download_inode
...+ if (send_file_write(buffer, r) < 0) {
+ pclose(fp);
- while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
- if (send_file_write (buffer, r) < 0) {
- pclose (fp);
return -1;
}
- }
- if (ferror (fp)) {
- fprintf (stderr, "fread: %m");
- send_file_end (1); /* Cancel. */
- pclose (fp);
+ if (ferror(fp)) {
+ fprintf(stderr, "fread: %m");
+ send_file_end(1); /* Cancel. */
+ pclose(fp);
+
return -1;
}
- if (pclose (fp) != 0) {
- fprintf (stderr, "pclose: %m");
- send_file_end (1); /* Cancel. */
+...
2016 Feb 21
2
[PATCH] added ntfscat_i api
...ncel the transfer.
+ */
+ reply (NULL, NULL);
+
+ while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
+ if (send_file_write (buffer, r) < 0) {
+ pclose (fp);
+ return -1;
+ }
+ }
+
+ if (ferror (fp)) {
+ fprintf (stderr, "fread: %ld: %m\n", inode);
+ send_file_end (1); /* Cancel. */
+ pclose (fp);
+ return -1;
+ }
+
+ if (pclose (fp) != 0) {
+ fprintf (stderr, "pclose: %ld: %m\n", inode);
+ send_file_end (1); /* Cancel. */
+ return -1;
+ }
+
+ if (send_file_end (0)) /* Normal end of file. */
+ return -1;
+
+ return 0;
+}
di...
2016 Mar 29
2
[PATCH] renamed daemon/tsk.c to daemon/sleuthkit.c
...we can only cancel the transfer.
+ */
+ reply (NULL, NULL);
+
+ while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
+ if (send_file_write (buffer, r) < 0) {
+ pclose (fp);
+ return -1;
+ }
+ }
+
+ if (ferror (fp)) {
+ fprintf (stderr, "fread: %m");
+ send_file_end (1); /* Cancel. */
+ pclose (fp);
+ return -1;
+ }
+
+ if (pclose (fp) != 0) {
+ fprintf (stderr, "pclose: %m");
+ send_file_end (1); /* Cancel. */
+ return -1;
+ }
+
+ if (send_file_end (0)) /* Normal end of file. */
+ return -1;
+
+ return 0;
+}
diff --git a/dae...
2016 Feb 22
2
Re: [PATCH] added ntfscat_i api
...1, sizeof buffer, fp)) > 0) {
>> + if (send_file_write (buffer, r) < 0) {
>> + pclose (fp);
>> + return -1;
>> + }
>> + }
>> +
>> + if (ferror (fp)) {
>> + fprintf (stderr, "fread: %ld: %m\n", inode);
>> + send_file_end (1); /* Cancel. */
>> + pclose (fp);
>> + return -1;
>> + }
>> +
>> + if (pclose (fp) != 0) {
>> + fprintf (stderr, "pclose: %ld: %m\n", inode);
>> + send_file_end (1); /* Cancel. */
>> + return -1;
>> + }
>>...
2016 Mar 29
3
[PATCH 0/2] rename icat API as download_inode
"icat" name comes from the employed command line tool which might be replaced later on with a different implementation.
The command name is a bit confusing because it's similar to "cat" but act as "donwload". Therefore I am renaming it with a more clear name.
At the same time I cleaned up a bit the code and improved it's readability and code comments.
This
2016 Sep 20
1
Re: [PATCH v2 1/3] New API: internal_find_block
...&img, &fs);
> + if (ret < 0)
> + return ret;
> +
> + reply (NULL, NULL); /* Reply message. */
> +
> + ret = tsk_fs_dir_walk (fs, fs->root_inum, flags,
> + findblk_callback, (void *) &block);
> + if (ret == 0)
> + ret = send_file_end (0); /* File transfer end. */
> + else
> + send_file_end (1); /* Cancel file transfer. */
> +
> + fs->close (fs);
> + img->close (img);
> +
> + return ret;
> +}
> +
> +
(One extra empty line.)
> +static TSK_WALK_RET_ENUM
> +findblk_callback (TSK_...
2016 Aug 25
1
Re: [PATCH 1/3] New API: internal_find_inode
...< 0)
> + return ret;
> +
> + reply (NULL, NULL); /* Reply message. */
> +
> + ret = tsk_fs_dir_walk (fs, fs->root_inum, flags, ifind_callback,
> + (void *) &inode);
Here 'inode' is int64_t ...
> + if (ret == 0)
> + ret = send_file_end (0); /* File transfer end. */
> + else
> + send_file_end (1); /* Cancel file transfer. */
> +
> + fs->close (fs);
> + img->close (img);
> +
> + return ret;
> +}
> +
> /* Inspect the device and initialises the img and fs structures.
> * Return 0 on...
2016 Feb 22
0
Re: [PATCH] added ntfscat_i api
...> + while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
> + if (send_file_write (buffer, r) < 0) {
> + pclose (fp);
> + return -1;
> + }
> + }
> +
> + if (ferror (fp)) {
> + fprintf (stderr, "fread: %ld: %m\n", inode);
> + send_file_end (1); /* Cancel. */
> + pclose (fp);
> + return -1;
> + }
> +
> + if (pclose (fp) != 0) {
> + fprintf (stderr, "pclose: %ld: %m\n", inode);
> + send_file_end (1); /* Cancel. */
> + return -1;
> + }
> +
> + if (send_file_end (0)) /* Norm...
2016 Apr 04
2
Re: [PATCH v2 3/5] daemon: Added internal_filesystem_walk command
...ret < 0)
> > > + return ret;
> > > +
> > > + reply (NULL, NULL); /* Reply message. */
> > > +
> > > + ret = tsk_fs_dir_walk (fs, fs->root_inum, flags, fswalk_callback,
> > NULL);
> > > + if (ret == 0)
> > > + ret = send_file_end (0); /* File transfer end. */
> > > + else
> > > + send_file_end (1); /* Cancel file transfer. */
> > > +
> > > + fs->close (fs);
> > > + img->close (img);
> > > +
> > > + return ret;
> > > +}
> > > +
&g...
2016 Mar 07
0
[PATCH 2/3] added icat API to retrieve deleted or inaccessible files
...we can only cancel the transfer.
+ */
+ reply (NULL, NULL);
+
+ while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
+ if (send_file_write (buffer, r) < 0) {
+ pclose (fp);
+ return -1;
+ }
+ }
+
+ if (ferror (fp)) {
+ fprintf (stderr, "fread: %m");
+ send_file_end (1); /* Cancel. */
+ pclose (fp);
+ return -1;
+ }
+
+ if (pclose (fp) != 0) {
+ fprintf (stderr, "pclose: %m");
+ send_file_end (1); /* Cancel. */
+ return -1;
+ }
+
+ if (send_file_end (0)) /* Normal end of file. */
+ return -1;
+
+ return 0;
+}
diff --git a/gen...
2016 Feb 22
0
Re: [PATCH] added ntfscat_i api
...; >>+ if (send_file_write (buffer, r) < 0) {
> >>+ pclose (fp);
> >>+ return -1;
> >>+ }
> >>+ }
> >>+
> >>+ if (ferror (fp)) {
> >>+ fprintf (stderr, "fread: %ld: %m\n", inode);
> >>+ send_file_end (1); /* Cancel. */
> >>+ pclose (fp);
> >>+ return -1;
> >>+ }
> >>+
> >>+ if (pclose (fp) != 0) {
> >>+ fprintf (stderr, "pclose: %ld: %m\n", inode);
> >>+ send_file_end (1); /* Cancel. */
> >>+ re...
2016 Mar 06
0
[PATCH 1/2] added icat and fls0 APIs
...we can only cancel the transfer.
+ */
+ reply (NULL, NULL);
+
+ while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
+ if (send_file_write (buffer, r) < 0) {
+ pclose (fp);
+ return -1;
+ }
+ }
+
+ if (ferror (fp)) {
+ fprintf (stderr, "fread: %m");
+ send_file_end (1); /* Cancel. */
+ pclose (fp);
+ return -1;
+ }
+
+ if (pclose (fp) != 0) {
+ fprintf (stderr, "pclose: %m");
+ send_file_end (1); /* Cancel. */
+ return -1;
+ }
+
+ if (send_file_end (0)) /* Normal end of file. */
+ return -1;
+
+ return 0;
+}
diff --git a/gen...
2016 Mar 30
4
[PATCH 0/3] rename icat API into download_inode
The command name is a bit confusing because it's similar to "cat" but act as "donwload". Therefore I am renaming it with a more clear name.
At the same go I cleaned up a bit the code following the standards and improved the API documentation.
This patch is ready for review.
Code available at:
https://github.com/noxdafox/libguestfs/tree/download_inode
Matteo Cafasso (3):
2017 Feb 14
0
[PATCH 09/10] New API: mksquashfs
...ransfer.
+ */
+ reply (NULL, NULL);
+
+ while ((r = fread (buffer, 1, GUESTFS_MAX_CHUNK_SIZE, fp)) > 0) {
+ if (send_file_write (buffer, r) < 0) {
+ fclose (fp);
+ return -1;
+ }
+ }
+
+ if (ferror (fp)) {
+ fprintf (stderr, "fread: %s: %m\n", tmpfile);
+ send_file_end (1); /* Cancel. */
+ fclose (fp);
+ return -1;
+ }
+
+ if (fclose (fp) != 0) {
+ fprintf (stderr, "fclose: %s: %m\n", tmpfile);
+ send_file_end (1); /* Cancel. */
+ return -1;
+ }
+
+ if (send_file_end (0)) /* Normal end of file. */
+ return -1;
+
+ return 0;
+}
d...
2016 Nov 22
2
Re: [PATCH v2 4/6] New API: internal_yara_scan
...();
I don't think that's the right place for yr_finalize.
> + return -1;
> + }
> +
> + reply (NULL, NULL); /* Reply message. */
> +
> + ret = yr_rules_scan_fd (rules, fd, 0, yara_rules_callback, (void *) path, 0);
> + if (ret == ERROR_SUCCESS)
> + ret = send_file_end (0); /* File transfer end. */
> + else
> + send_file_end (1); /* Cancel file transfer. */
> +
> + return 0;
> +}
> +
> /* Upload rules file on a temporary file.
> * Return 0 on success, -1 on error.
> */
> @@ -209,6 +244,58 @@ compile_error_callback(int lev...
2016 Mar 02
0
[PATCH] daemon: ntfs: fix format strings
...r ("asprintf");
return -1;
}
@@ -311,14 +311,14 @@ do_ntfscat_i (const mountable_t *mountable, int64_t inode)
}
if (ferror (fp)) {
- fprintf (stderr, "fread: %ld: %m\n", inode);
+ fprintf (stderr, "fread: %" PRIi64 ": %m\n", inode);
send_file_end (1); /* Cancel. */
pclose (fp);
return -1;
}
if (pclose (fp) != 0) {
- fprintf (stderr, "pclose: %ld: %m\n", inode);
+ fprintf (stderr, "pclose: %" PRIi64 ": %m\n", inode);
send_file_end (1); /* Cancel. */
return -1;
}
--
2.5.0
2016 Sep 19
5
[PATCH v2 0/3] New API - find_block
v2:
- use boolean field in struct
- move refactoring to previous series
Matteo Cafasso (3):
New API: internal_find_block
New API: find_block
find_block: added API tests
daemon/tsk.c | 90 ++++++++++++++++++++++++++++++++++++++++++++
generator/actions.ml | 25 ++++++++++++
src/MAX_PROC_NR | 2 +-
src/tsk.c | 17 +++++++++
2016 Feb 29
2
[PATCH 1/2] added ntfscat_i api
...ncel the transfer.
+ */
+ reply (NULL, NULL);
+
+ while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
+ if (send_file_write (buffer, r) < 0) {
+ pclose (fp);
+ return -1;
+ }
+ }
+
+ if (ferror (fp)) {
+ fprintf (stderr, "fread: %ld: %m\n", inode);
+ send_file_end (1); /* Cancel. */
+ pclose (fp);
+ return -1;
+ }
+
+ if (pclose (fp) != 0) {
+ fprintf (stderr, "pclose: %ld: %m\n", inode);
+ send_file_end (1); /* Cancel. */
+ return -1;
+ }
+
+ if (send_file_end (0)) /* Normal end of file. */
+ return -1;
+
+ return 0;
+}
di...
2016 Sep 15
0
[PATCH v5 4/6] New API: internal_find_inode
...ret = open_filesystem (mountable->device, &img, &fs);
+ if (ret < 0)
+ return ret;
+
+ reply (NULL, NULL); /* Reply message. */
+
+ ret = tsk_fs_dir_walk (fs, fs->root_inum, flags,
+ findino_callback, (void *) &inode);
+ if (ret == 0)
+ ret = send_file_end (0); /* File transfer end. */
+ else
+ send_file_end (1); /* Cancel file transfer. */
+
+ fs->close (fs);
+ img->close (img);
+
+ return ret;
+}
+
/* Inspect the device and initialises the img and fs structures.
* Return 0 on success, -1 on error.
*/
@@ -120,6 +150,28 @@ fswalk_...
2016 Aug 25
0
[PATCH v2 4/6] New API: internal_find_inode
...ret = open_filesystem (mountable->device, &img, &fs);
+ if (ret < 0)
+ return ret;
+
+ reply (NULL, NULL); /* Reply message. */
+
+ ret = tsk_fs_dir_walk (fs, fs->root_inum, flags,
+ findino_callback, (void *) &inode);
+ if (ret == 0)
+ ret = send_file_end (0); /* File transfer end. */
+ else
+ send_file_end (1); /* Cancel file transfer. */
+
+ fs->close (fs);
+ img->close (img);
+
+ return ret;
+}
+
/* Inspect the device and initialises the img and fs structures.
* Return 0 on success, -1 on error.
*/
@@ -120,6 +150,28 @@ fswalk_...