Mantis Bugtracker

Простой вид комментарии ] расширенный вид ] история ] печать ]
Номер Категория Серьезность Воспроизводимость Создан Изменен
0000038 [obex-data-server] General нововведение всегда 2008-01-24 02:32 2008-02-04 14:57
Инициатор hadess Видимость общая  
Ответственный skirsdeda
Приоритет обычный Решение открыт  
Состояние назначен   Версия продукта
Суть 0000038: No POSIX style API
Подробности There's currently no way to implement read() or write() style APIs using obex-data-server.

The API could be as simple as:
byte CopyRemoteFileToMemory (string remote_filename)
to read a file and:
void SendFileFromMemory (array{byte} data, uint32 len)
to write a file from memory.

Feel free to come up with better APIs though.
Дополнительные сведения
Tэги Нет прикрепленных тэгов.
Вложенные файлы

- Связи

-  Комментарии
(0000054)
skirsdeda (администратор)
2008-01-24 15:42

SendFileFromMemory should also have at least /string name/ argument.
(0000056)
hadess (инициатор)
2008-01-24 16:34

I shouldn't be filing bugs this late at night ;)
(0000065)
skirsdeda (администратор)
2008-01-29 21:27

Let's add such functions then:

byte CopyRemoteFileToMemory (string remote_filename)
void SendFileFromMemory (array{byte} data, string filename, uint64 size)
(0000066)
hadess (инициатор)
2008-01-29 21:34

Even better would be a open/write/close, and open/read/close style API, if that's possible at all. osso-gwobex (from Nokia/Maemo) uses a similar API to what you're proposing though.
(0000067)
skirsdeda (администратор)
2008-01-29 21:39

If we had smth like open/write/close, main loop would have to be blocked while waiting for another write (this is openobex design limitation). It's also the reason why obex-data-server doesn't have authorization manager (to let client application authorize/reject incoming files).
(0000068)
skirsdeda (администратор)
2008-02-02 19:39

We have to discuss this more thoroughly. What is the use case for such functions. Is it worth implementing at all considering OBEX protocol and openobex lib limitations...
(0000070)
hadess (инициатор)
2008-02-04 12:22

This API:
byte CopyRemoteFileToMemory (string remote_filename)
void SendFileFromMemory (array{byte} data, string filename, uint64 size)
would do me fine.

The use would be implementing the ObexFTP backend for gvfs: http://bugzilla.gnome.org/show_bug.cgi?id=509621 [^]

We can browse but can't read or write, which makes the backend quite useless right now :)
(0000071)
skirsdeda (администратор)
2008-02-04 14:57

CopyRemoteFileToMemory has to be different though:
void CopyRemoteFileToMemory (string remote_filename)

and we can have some signal to get all data:
RemoteFileCopiedToMemory (array{byte} data, uint64 size)

So let's say that we have this implemented and do_read function is called in ObexFTP backend. do_read would have to wait until all data is received. This would make reporting progress in e.g. Nautilus broken since it would be 0% for a long time and then up to 100% in no time. Fix me if I'm wrong here..

maybe we could have another signal which would return received data constantly during transfer. In this case, do_read would have to wait until size is bigger than bytes_already_read+buffer_size (since buffer sizes used in ods and gio will definitely differ):
MemoryWritten (array{byte} data, uint64 size)

And do_write would just fill internal buffer, it would call SendFileFromMemory only in do_close_write. As I said earlier, this can't be solved in other way since ods can't block and ods doesn't do threading. Therefore, it would seem to user that file was sent instantly. But probably it's more important to have correct progress when you receive file, not when you send, since you will probably use the file in the device that received it :)

- история
Дата изменения Пользователь Поле Изменение
2008-01-24 02:32 hadess Новый вопрос
2008-01-24 02:32 hadess Отслеживать: hadess
2008-01-24 15:41 skirsdeda Ответственный => skirsdeda
2008-01-24 15:41 skirsdeda Состояние новый => подтвержден
2008-01-24 15:41 skirsdeda Состояние подтвержден => назначен
2008-01-24 15:41 skirsdeda Серьезность малая => нововведение
2008-01-24 15:42 skirsdeda Комментарий добавлен: 0000054
2008-01-24 16:34 hadess Комментарий добавлен: 0000056
2008-01-29 21:27 skirsdeda Комментарий добавлен: 0000065
2008-01-29 21:34 hadess Комментарий добавлен: 0000066
2008-01-29 21:39 skirsdeda Комментарий добавлен: 0000067
2008-02-02 19:39 skirsdeda Комментарий добавлен: 0000068
2008-02-04 12:22 hadess Комментарий добавлен: 0000070
2008-02-04 14:57 skirsdeda Комментарий добавлен: 0000071


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker