[Kde-pim] Review Request: Send payload file name to the client [client side]

Andras Mantia amantia at kde.org
Thu Feb 12 09:22:31 GMT 2009



> On 2009-02-11 13:34:40, Kevin Krammer wrote:
> > I wonder if it is possible to send some kind of file handle. Sending the file name is a potential race condition, the file can be deleted before the recipient opens it.
> > 
> > Currently a client can rely on getting the full payload when requesting so.

Indeed, there is a problem with this that we should discuss. As of now, it is the client's job to open the file and read the data from it. This can result in the file being deleted or changed in the (although very short) timeframe when the server writes out the data with the filename into the socket and the client reads it and opens the file. As you could see there is no real error check for this case as I don't know what to do if the file is not readable.
 An idea would be to open the file in the server and send the QFile::handle() (this is not completely portable, WinCE doesn't support it, but I'm not sure we care about). I also couldn't really find how to convert back this handle (int) to a QFile/QIODevice in a portable way. This idea saves our file status, but leaves the closing of the file to the client, which IMO is not good.
I'm open to ideas.


- Andras


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/55/#review61
-----------------------------------------------------------


On 2009-02-11 13:23:51, Andras Mantia wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/55/
> -----------------------------------------------------------
> 
> (Updated 2009-02-11 13:23:51)
> 
> 
> Review request for KDE PIM.
> 
> 
> Summary
> -------
> 
> This patch extends the client/server protocol in a way that if the client supports direct loading of the payload data from a file, the filename is sent through the socket, not the whole data, thus limiting the amount of data that needs to be transported. This is the client side of the patch.
> I'd like to get feedback especially on the protocol extension.
> 
> 
> Diffs
> -----
> 
>   trunk/KDE/kdepimlibs/akonadi/item.cpp 924623 
>   trunk/KDE/kdepimlibs/akonadi/itemfetchjob.cpp 924623 
>   trunk/KDE/kdepimlibs/akonadi/itemfetchscope.h 924623 
>   trunk/KDE/kdepimlibs/akonadi/itemfetchscope.cpp 924623 
>   trunk/KDE/kdepimlibs/akonadi/itemfetchscope_p.h 924623 
>   trunk/KDE/kdepimlibs/akonadi/itemserializer.h 924623 
>   trunk/KDE/kdepimlibs/akonadi/itemserializer.cpp 924623 
> 
> Diff: http://reviewboard.kde.org/r/55/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras
> 
>

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list